Jump to content


Photo
- - - - -

ALGEBRAIC EQUATIONS and diff forms thereof


  • Please log in to reply
15 replies to this topic

#1 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 27 January 2017 - 02:42 PM

One can write and use algebraic equations in classic WinNonlin e.g. the attached example describes the use of the Weibull equation to fit a
dissolution. Also in WinNonlin you could write the same equation in
the differential form and use it.

I am wondering whether pml works with exclusively DIFF equations or you can use the algebraic equation in pml. Writing diff equations requires one first to take the first derivative of the algebraic equation.

AngusAttached File  WEIBULL.phxproj   241.26KB   1315 downloads
  • AlexKawn likes this

#2 dlweiner

dlweiner

    Member

  • Members
  • PipPip
  • 23 posts

Posted 28 January 2017 - 08:22 PM

Angus, with PML you can write the model in terms of closed form equations or write them in terms of DEs, just like classic WNL.  For PK library models, there is a box you can check to specify fitting the PK model in closed form or the corresponding DE representation.  There is no advantage to fitting the DE specification of the PK library model, but this can help if you need the DE representation in order to convert the model to text and then edit it.  Note that if one fits a system of DEs that are first order, PHX (by default - but you can turn this off in the Run Options tab) will use a matrix exponentiation solution for the system and then fit that to improve the speed of the optimization process.

 

Dan

One can write and use algebraic equations in classic WinNonlin e.g. the attached example describes the use of the Weibull equation to fit a
dissolution. Also in WinNonlin you could write the same equation in
the differential form and use it.

I am wondering whether pml works with exclusively DIFF equations or you can use the algebraic equation in pml. Writing diff equations requires one first to take the first derivative of the algebraic equation.

Angusattachicon.gifWEIBULL.phxproj



#3 Simon Davis

Simon Davis

    Advanced Member

  • Administrators
  • 1,318 posts

Posted 04 February 2017 - 06:02 PM

Hi Angus, to expand on Dan's answer, here is an example of Weibull annotated in PML.

 

(remember everything preceded with a hash is a remark and just intended to help explain what is going on)

 

test(){
              deriv(T = 1) # take explicit control of time
    
    # original ascii
##    if t<= tlag then
##    F=0
##    else
##    expon= -((t-tlag)/Td)**beta
##    F= 100*(1-dexp(expon))
    
# ?:, is a conditional expression
#                   condition ? evaluated-when-true : evaluated-when-false    
              F = ((T-tlag)<=0? 0                   : 100*(1-exp( -((T-tlag)/Td)**beta)))
              error(FEps = 1)
              observe(FObs(T) = F + FEps)
              fixef(Td = c(, 8, ))
              fixef(beta = c(, 10, ))
              fixef(tlag = c(, 0.1, ))
}



#4 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 05 February 2017 - 02:27 AM

Thanks Simon; I do follow for the most part. some things I find puzzling e.g the first two lines shown below. The first line seems to be standard for all pml code.<br /><br />test(){<br />deriv(T = 1) # take explicit control of time<br /><br /><br /><br />also I found the large space between the 0 and colon: confusing, but in fact you do not need it<br /><br />F = ((T-tlag)&lt;=0? 0 large space : 100*(1-exp( -((T-tlag)/Td)**beta)))<br /><br />Angus



#5 dlweiner

dlweiner

    Member

  • Members
  • PipPip
  • 23 posts

Posted 05 February 2017 - 01:23 PM

Thanks Simon; I do follow for the most part. some things I find puzzling e.g the first two lines shown below. The first line seems to be standard for all pml code.<br /><br />test(){<br />deriv(T = 1) # take explicit control of time<br /><br /><br /><br />also I found the large space between the 0 and colon: confusing, but in fact you do not need it<br /><br />F = ((T-tlag)&lt;=0? 0 large space : 100*(1-exp( -((T-tlag)/Td)**beta)))<br /><br />Angus

Angus,

 

The first line "test" is just a default name.  You can choose any name you like.  In a future release, you will be able to create large libraries of PML models, each with its own unique name.  The use of "t" as time is best reserved for use by the differential equations for library pk and pd models.  If you need time in your user model we suggest you use your own time variable as Simon suggested "deriv(time=1)".  Note that for this example you could have read in the time column as a covariate, but it would not have been a continuous variable if defined that way.  Lastly, as you noted, the spacing that was used before and after the colon (:) was just to make the expression easier to read.

 

Best,

 

Dan Weiner



#6 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 06 February 2017 - 06:54 PM

Thank you Dan: In order to learn pml then one has to study examples,for example the<br />syntax of the conditional statement provided by Simon is unique to pml. The example I provided is the use of an engineering type equation (Weibull) applied to dissolution release. I do<br />have another example of a Hill type equation and in this case I do have the first derivative of<br />the expression. I must look it out<br /><br />Angus



#7 dlweiner

dlweiner

    Member

  • Members
  • PipPip
  • 23 posts

Posted 06 February 2017 - 07:43 PM

Thank you Dan: In order to learn pml then one has to study examples,for example the<br />syntax of the conditional statement provided by Simon is unique to pml. The example I provided is the use of an engineering type equation (Weibull) applied to dissolution release. I do<br />have another example of a Hill type equation and in this case I do have the first derivative of<br />the expression. I must look it out<br /><br />Angus

Angus,

 

PML also supports the use of IF-Then-Else statements, but I used the more compact single statement way to accomplish the same task.  Note that if you purchase the 5th edition of the book I co-authored with Johan Gabrielsson, it contains 105 various PK, PD and PK/PD examples all using Phoenix.  Some use the built-in library models, but many use PML.

 

Dan



#8 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 06 February 2017 - 08:54 PM

Thank you Dan: I have the original book and disc, but not the updated one. I will look into this,<br />Angus



#9 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 08 February 2017 - 02:24 PM

Dan/Simon: I progressed last night and completed another dissolution model (Hill type sigmoid )in pml using Simon's example. It seems that pml is emerging as the way forward. One question I do have relates to the ka being different in different part of the intestinal tract. That I have already simulated (with Simon's help ) at an earlier date. By that I mean I have envisaged(simulated) the drug being absorbed in different parts of the intestine e.g. upper small intestine, mid point of small intestine and colon. There is less water in the colon than the small intestine. I reduced the value of ka (absorption coefficient) as we progress down the intestinal tract. There is less water in the colon. My question is it feasible in pml to perform a fitting to plasma concentrations derived from an extended release formulation absorbed in different parts of the intestine? One would wish to use say 5 different ka values. I am thinking of a fitting requiring more computing power than usual.
Angus

Edited by Angus McLean, 09 February 2017 - 04:27 PM.


#10 dlweiner

dlweiner

    Member

  • Members
  • PipPip
  • 23 posts

Posted 08 February 2017 - 03:07 PM

Angus,  I don't have the benefit of having seen you prior model for simulation, but here are some thoughts.  This sounds a bit like an absorption transit approach.  In a classical transit model the Kout (1/tau) parameter is fixed for all transit compartments.  In your absorption model, Ka changes with time ( or location).  While one could always simulate such a model using PML, I believe it would be difficult to fit such a model unless you had measurements of absorption that were site specific.  If you ignore site of absorption (location)  and instead want to fit Ka as some time dependent function such as 

    

Ka(t) = Ka,inf * (1-exp(-(k*t)*gamma))   where Ka,inf k and gamma are parameters to be estimated, then if you have enough time points during the absorption phase you may be able to fit such a model.

 

Dan



#11 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 08 February 2017 - 03:53 PM

Dan,

    the initial thinking I did was in fact simplified to think first in terms of 100% permeability (in mg) being the same in;
(1) the upper small intestine,
(2) distal parts of the small intestine and the distal small intestine and
(3) proximal colon.

 

   For a highly soluble highly permeable drug like methylphenidate formulated as modified release formulation{ Concerta} there are three such releases;

 

(1)drug released from the over coat on the osmotic tablet
(2) release by osmosis from within the tablet
(3) drug release within the tablet on account of the effect of the influence of water on a swellable polymer causing the drug to release.

 

So the amounts in mg of each of the three releases are known in this formulation are known and one can approximate the absorption time for each of the 3 releases at the different parts of the intestine.

 

What is not known is the ka(absorption coefficient) for each of the 3 releases. So when simulating I made various assumptions for each of the 3 ka values to see what emerged.

 

I compared with the observed PK profile then I iterated the assumptions on a number of occasions to get a result reasonably close to what you observe.

 

This is a very adhoc approach and I thought in terms of a more general simulation approach. Simulations plus I think uses transit compartments (Amidon) and the founder of the company is an aerospace mechanical engineer. I guess then I am thinking in terms of developing pml to be able to do what that program does.


Edited by Simon Davis, 08 February 2017 - 09:56 PM.
Edited formatting to make reading easier


#12 dlweiner

dlweiner

    Member

  • Members
  • PipPip
  • 23 posts

Posted 08 February 2017 - 04:19 PM

<br />Dan: the initial thinking I did was in fact simplified to think first in terms of 100% permeability (in mg) being the same in (1) the upper small intestine, (2) distal parts of the small intestine and the distal small intestine and (3) proximal colon. For a highly soluble highly permeable drug like methylphenidate formulated as modified release formulation{ Concerta} there are three such releases (1)drug released from the over coat on the osmotic tablet (2) release by osmosis from within the tablet (3) drug release within the tablet on account of the effect of the influence of water on a swellable polymer causing he drug to release. So the amounts in mg of each of the three releases are known in this formulation are known and one can approximate the absorption time for each of the 3 releases at the different parts of the intestine. What is not known is the ka(absorption coefficient) for each of the 3 releases. So when simulating I made various assumptions for each of the 3 ka values to see what emerged. I compared with the observed PK profile then I iterated the assumptions on a number of occasions to get a result reasonably close to what you observe. This is a very adhoc approach and I thought in terms of a more general simulation approach. Simulations plus I think uses transit compartments (Amidon) and the founder of the company is an aerospace mechanical engineer. I guess then I am thinking in terms of developing pml to be able to do what that program does.

Angus,  you may want to consider using a quasi-empirical approach to mimic what is happening mechanistically.  You could certainly build a PK model, and add multiple absorption components (compartments) each having its own tlag and Ka.  The different tlags would account for the differing sites of absorption.  It is very easy to do this with the graphical model builder.  

 

Dan



#13 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 08 February 2017 - 04:45 PM

Dan: Yes; I can do that....this approach gives useful information in simulating dosage forms.

Angus

Edited by Angus McLean, 09 February 2017 - 04:28 PM.


#14 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 08 February 2017 - 10:43 PM

Simon; let me try again. I can do that ....this approach gives useful information in simulating dosage forms.

Angus

Edited by Angus McLean, 09 February 2017 - 04:29 PM.


#15 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 08 February 2017 - 10:45 PM

the unwelcome formatting is inserted when I press on "enter" on the keyboard to provide spacing



#16 Angus McLean

Angus McLean

    Advanced Member

  • Members
  • PipPipPip
  • 223 posts

Posted 09 February 2017 - 04:30 PM

Let me try thisI am thinking that using the enter key puts in the extra letters b/r


Edited by Angus McLean, 09 February 2017 - 04:30 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users