Jump to content


Photo

PML: Calculate max value in compartment

PML

  • Please log in to reply
1 reply to this topic

#1 Teresa Collins

Teresa Collins

    Member

  • Members
  • PipPip
  • 12 posts

Posted 15 April 2015 - 02:45 PM

Hi,

 

I was hoping someone knew of a way to automatically calculate the maximum value of compartment so that this can be used in a PML defined model. 

 

The WNL PK model templates code the Tmax and Cmax as secondary parameters, so I think this might be possible:

 

For an oral 2 compartment PK model (WNL model 11):

secondary(Tmax = CalcTMax(A,Alpha, B, Beta, C, Gamma))
secondary(Cmax = A*exp(-Alpha*Tmax)+B*exp(-Beta*Tmax)+C*exp(-Gamma*Tmax))

 

Is CalcTMax a function that will work on any compartment?

 

Teresa



#2 smouksassi1

smouksassi1

    Advanced Member

  • Members
  • PipPipPip
  • 231 posts
  • LocationMontreal

Posted 27 April 2015 - 02:28 PM

CalcTmax can be found in the file named:  Mutil.c

C:\Program Files (x86)\Pharsight\Phoenix 1.4\application\lib\NLME\Executables\Mutil.c

 

it is a function that take macro constants as input and return the time where output ( concentration) is maximum i.e Tmax.
note how it uses all compartments parameters i.e alpha beta and gamma and A, B , C.

 

The short answer is no CalcTmax only return the Tmax where the central compartment is maximum.
Similar functions can be written to find the maximum for a closed form function of your peripheral concentrations.

 

A more general way for any ODE is, once you have all your parameters, to simulate over a fine time grid then you can find the maximum.

 

You can do it in two steps where first you find the maximum peripheral concentrations then you fit another model correlatiing the Cmax in peripheral to your PD endpoint.

 

 

other pml useful functions are defined in this file in C code:

 

// find x where A*exp(-ax) + B*exp(-bx) + C*exp(-cx) is maximum
double CalcTMax(double A, double a, double B, double b, double C, double c){
double amax, x1, x0, d0, d1, xm, dm;
// first derivative = -Aa*exp(-ax) - Bb*exp(-bx) -Cc*exp(-cx)
// assume x >= 0 and largest of ax, bx, cx < 100
#define DERIV(x) (-A*a*exp(-a*(x)) - B*b*exp(-b*(x)) -C*c*exp(-c*(x)))
if (a <= 0 || b <= 0 || c <= 0) return 0;
amax = a;
if (amax < B) amax = b;
if (amax < c) amax = c;
x1 = 200 / amax;
x0 = 0;
d0 = DERIV(x0);
d1 = DERIV(x1);
 
if (d0 * d1 >= 0) return 0;
xm = (x0 + x1)/2;
dm = DERIV(xm);
while(x1 - x0 > 1.0e-10){
if (dm == 0) break;
if (d1 * dm > 0){
x1 = xm; d1 = dm;
} else {
x0 = xm; d0 = dm;
}
xm = (x0 + x1)/2;
dm = DERIV(xm);
}
#undef  DERIV
return xm;
}






Also tagged with one or more of these keywords: PML

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users