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

Correction in ODE output #1256

Open
anugnair opened this issue Feb 12, 2025 · 1 comment
Open

Correction in ODE output #1256

anugnair opened this issue Feb 12, 2025 · 1 comment

Comments

@anugnair
Copy link

The ODE output generated by the tellerium getODEFromX() methods is missing the volume normalization term, which is quite confusing. I have a simple model:

species drugExtraVenous, drugCentral, drugPeripheral;

drugExtraVenous in extraVenous;
drugCentral in central;
drugPeripheral in peripheral;

drugExtraVenous -> drugCentral; ka_Central*drugExtraVenous*extraVenous;                     # absorption
drugExtraVenous -> ; kcl_extraVenous*drugExtraVenous*extraVenous;                           # non-bioavailable fraction
drugCentral => drugPeripheral; Q12*drugCentral - Q12*drugPeripheral;    # distribution phase
drugCentral -> ; clearance*drugCentral;                                                  # elimination phase

central = 1                          # liter
peripheral = 1                       # liter
extraVenous = 1                        # liter
ka = 1                                 # 1/hour
F = 1
ka_Central = ka * F                       # 1/hour
kcl_extraVenous = ka * (1-F)              # 1/hour
clearance = 1                         # liter/hour
Q12 = 1                                 # liter/hour

All the species are in the concentration units, and of course the reaction rates are in amount/time unit. I get meaningful simulation output where it seems that rate equation evaluations are normalized by the compartment volume to get the left-hand side species concentration. However, when I look at the equations generated by te.getODEsFromModel(), the volume normalization terms are not present on the right-hand side of the ODEs. I get the following ODEs:

v_J0 = ka_Central*drugExtraVenous*extraVenous
v_J1 = kcl_extraVenous*drugExtraVenous*extraVenous
v_J2 = Q12*drugCentral-Q12*drugPeripheral
v_J3 = clearance*drugCentral

ddrugExtraVenous/dt = (-v_J0 - v_J1)
ddrugCentral/dt = (v_J0 - v_J2 - v_J3)
ddrugPeripheral/dt = v_J2

Shouldn't the correct ODEs be the following?

ddrugExtraVenous/dt = (-v_J0 - v_J1) / extraVenous
ddrugCentral/dt = (v_J0 - v_J2 - v_J3) / central
ddrugPeripheral/dt = v_J2 / peripheral

Best regards,
Anu

@hsauro
Copy link

hsauro commented Feb 12, 2025 via email

luciansmith added a commit to sys-bio/tellurium that referenced this issue Feb 22, 2025
Corrects ODE output to include division by the compartment volume, when necessary.  If the species is set substanceOnly, the correction is not made, and if the compartment is named "default_compartment" and the volume is 1, it is also not added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants