Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODE for an AUC compartment #34

Open
KevSmart opened this issue Oct 14, 2021 · 1 comment
Open

ODE for an AUC compartment #34

KevSmart opened this issue Oct 14, 2021 · 1 comment

Comments

@KevSmart
Copy link

Hi!

Ive been playing with assemblerr after the Roche training today. I really like the tool!

Im trying to recreate an existing model, and would like to add a differential equation to allow derivation of AUC - just a normal output we may find useful. Normally, I would code like this:

$DES
CP = A(1)/V1
DADT(1) = K21 * A(2) - (K12 + K10) * A(1)
DADT(2) = K12 * A(1) - K21 * A(2)
DADT(3) = CP
$ERROR
AUC = A(3)

In assembler, I've not found a way to create an empty, user defined ODE, nor have I found a way to add an algebraic equation into the $DES block. To trick it, I have used this:

m_pk_test2<-model()+
...
compartment("auc",volume=1)+
...
algebraic(cp~A(1)/s1)+
...
flow(cp,from="central",to="auc")+
...
algebraic(auc
A["auc"])+
obs_proportional(~conc)

When I render, the model looks like this:

CP = A(1)/S1
$DES
DADT(1) = K21 * A(2) - (K12 * A(1) + K10 * A(1) + CP)
DADT(2) = K12 * A(1) - K21 * A(2)
DADT(3) = CP
$ERROR
CONC = A(1)/V1
AUC = A(3)
Y = CONC + CONC * EPS(1)

By removing the + CP from DADT(1) and moving the CP equation into $DES, then things work fine.

I wondered if there is a better way to create a user defined DADT()??

Many thanks in advance!

@sebastianueckert
Copy link
Collaborator

Good point; this functionality should undoubtedly be added. It does, unfortunately, require some more extensive changes than it might seem. I'll keep it in mind for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants