# PK Model With Dissolution and Bioavailability

**URL:** <https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635>\
**Category:** Modelling and Simulation\
**Created:** [September 2, 2022, 6:48pm UTC](https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635 "2022-09-02T18:48:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![littlepetinga](https://avatars.discourse-cdn.com/v4/letter/l/eb8c5e/32.png) [@littlepetinga](https://forum.certara.com/u/littlepetinga)\
**Post date:** [September 2, 2022, 6:48pm UTC](https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635/1 "2022-09-02T18:48:14Z")

</div>

Hello everyone

I am constructing a PK model which is preceded by a dissolution model (a Weibull model) in the GI track. From the dissolved drug in the GI, I pretend that only a fraction (F) is absorbed to the central compartment. However, I have questions on how to do so, since I defined the GI as the dosepoint.

Does anyone know how should I proceed?

Thank you very much in advance

Sara

---

<div class="post-metadata">

**Author:** ![SimonDavis](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@SimonDavis](https://forum.certara.com/u/SimonDavis)\
**Post date:** [September 3, 2022, 6:44am UTC](https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635/2 "2022-09-03T06:44:23Z")

</div>

Can you post your project file to see how far you have got? I assume you have worked through some of the graphical model building examples in the help e.g. [https://onlinehelp.certara.com/phoenix/8.3/index.html#t=topics%2Fnlmeextwodosept.htm%23XREF\_97540\_Creating\_a\_two](https://onlinehelp.certara.com/phoenix/8.3/index.html#t=topics%2Fnlmeextwodosept.htm%23XREF_97540_Creating_a_two)

---

<div class="post-metadata">

**Author:** ![littlepetinga](https://avatars.discourse-cdn.com/v4/letter/l/eb8c5e/32.png) [@littlepetinga](https://forum.certara.com/u/littlepetinga)\
**Post date:** [September 3, 2022, 4:24pm UTC](https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635/3 "2022-09-03T16:24:32Z")

</div>

Hi Simon

Thank you for your reply.

I am not using graphical model, I am using PML instead.

You may find below the model text:

```auto
test(){

# GI compartment
deriv(Aa = - ((Fmax*(Beta*scB)*(t^((Beta*scB)-1))*exp(-(t^((Beta*scB)))/(Alpha*scA)))/(Alpha*scA)) * Aa)
# Central compartment
deriv(A1_p = ((Fmax*(Beta*scB)*(t^((Beta*scB)-1))*exp(-(t^((Beta*scB)))/(Alpha*scA)))/(Alpha*scA)) * Aa - (Cl_p * C_p)- (Q_p * (C_p - C2_p)) - (VMax_p_m * C_p / (C_p + Km_p_m)))
# Peripheral compartment
deriv(A2_p = (Q_p * (C_p - C2_p)))

# Define Dosepoint
dosepoint(Aa)

# Concentrations definition
C_p = A1_p / V_p
C2_p = A2_p / V2_p

# Model erro
error(CEps_p = 0.1)
observe(Parent = C_p * exp(CEps_p))

# Initial estimates
# Dissolution (Weibull)
fixef(Fmax(freeze) = c(, 1, ))
fixef(Alpha(freeze) = c(, 7, ))
fixef(Beta(freeze) = c(, 1.5, ))
fixef(scA = c(, 80, ))
fixef(scB = c(, 2, ))
# Central compartment
fixef(V_p = c(0, 88, 400))
fixef(Cl_p = c(0, 28, 60))
fixef(F_p = c(0, 0.05, 0.4))
# Peripheral compartment
fixef(V2_p = c(0, 181, 3000))
fixef(Q_p = c(0, 22, 300))
# Metabolite conversion
fixef(VMax_p_m = c(0, 329, 6000))
fixef(Km_p_m = c(0, 700, 5000))
}

```

My idea is, that from the dose dissolved in Aa, only a fraction (F) is absorbed to the central compartment (A1\_p).

Thank you!

Sara

---

<div class="post-metadata">

**Author:** ![bwendt](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@bwendt](https://forum.certara.com/u/bwendt)\
**Post date:** [September 5, 2022, 11:59am UTC](https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635/4 "2022-09-05T11:59:50Z")

</div>

Hi Sara,

I did not check the code in much detail, just used your formulas to do:

1. define dissolution rate outside of the deriv statement

2. limit the drate to 0-+Inf

3. added bioavailability (F\_p) to the absorption

4. defined the static value Aadose as total dose amount

Here is the code:

test()  
{

# GI compartment

deriv(Aa = - drate \* F\_p \* Aadose)

# Central compartment

deriv(A1\_p = drate \*F\_p \* Aa - (Cl\_p \* C\_p)- (Q\_p \* (C\_p - C2\_p)) - (VMax\_p\_m \* C\_p / (C\_p + Km\_p\_m)))

# Peripheral compartment

deriv(A2\_p = (Q\_p \* (C\_p - C2\_p)))

# Define Weibull for dissolution rate

drate=max(0,((Fmax\*(Beta_scB)_(t^((Beta_scB)-1))exp(-(t^((BetascB)))/(Alpha_scA)))/(Alpha\*scA)))

# Define Dosepoint

dosepoint(Aa, idosevar=Aadose)

# Concentrations definition

C\_p = A1\_p / V\_p  
C2\_p = A2\_p / V2\_p

# Model erro

error(CEps\_p = 0.1)  
observe(Parent = C\_p \* exp(CEps\_p))

# Initial estimates

# Dissolution (Weibull)

fixef(Fmax(freeze) = c(, 1, ))  
fixef(Alpha(freeze) = c(, 7, ))  
fixef(Beta(freeze) = c(, 1.5, ))  
fixef(scA = c(, 80, ))  
fixef(scB = c(, 2, ))

# Central compartment

fixef(V\_p = c(0, 88, 400))  
fixef(Cl\_p = c(0, 28, 60))  
fixef(F\_p = c(0, 0.05, 0.4))

# Peripheral compartment

fixef(V2\_p = c(0, 181, 3000))  
fixef(Q\_p = c(0, 22, 300))

# Metabolite conversion

fixef(VMax\_p\_m = c(0, 329, 6000))  
fixef(Km\_p\_m = c(0, 700, 5000))  
}

An here are some plots:

[attachment=3740:drate.png]

[attachment=3742:compartments.png]

Let me know if this does not work for you.

Bernd

 ![drate.png](https://us1.discourse-cdn.com/certara/original/2X/7/70da6987da4b5ecdf5355d5a224a21df47894b0f.png) ![compartments.png](https://us1.discourse-cdn.com/certara/original/2X/8/8b2c02efcdf5885f97990773faafe248ffd7a730.png)

---

<div class="post-metadata">

**Author:** ![littlepetinga](https://avatars.discourse-cdn.com/v4/letter/l/eb8c5e/32.png) [@littlepetinga](https://forum.certara.com/u/littlepetinga)\
**Post date:** [September 9, 2022, 4:48pm UTC](https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635/5 "2022-09-09T16:48:25Z")

</div>

Hi Bernd,

Thank you so much! It worked perfectly!

If I want the remaining fraction of the dose (1-F\_p) to go to a different compartment, can I do it just adding another differential equation?:

deriv(A3 = drate \*(1-F\_p) \* Aa - …)

Thank you so much once again!

Sara

---

<div class="post-metadata">

**Author:** ![bwendt](https://avatars.discourse-cdn.com/v4/letter/b/f4b2a3/32.png) [@bwendt](https://forum.certara.com/u/bwendt)\
**Post date:** [September 22, 2022, 3:12pm UTC](https://forum.certara.com/t/pk-model-with-dissolution-and-bioavailability/3635/6 "2022-09-22T15:12:29Z")

</div>

Hi Sara,

absolutely, please go ahead.

Bernd
