Data2Dynamics/d2d

SBML import not working for models with constant=False compartments

matthiaskoenig opened this issue · 3 comments

SBML models with non-constant compartments cannot be imported in d2d.
This is a problem with the SBML importer and SBML support in D2D.

This was originally reported in
#76

An example model is attached:
limax_pkpd_39.xml.zip

Trying to load the model with

arImportSBML('limax_pkpd_39.xml)

Results in the following message:

Specified tEnd
Level 3 packages detected. Information WILL be lost.
Error using arImportSBML (line 128)
non-constant compartments are not yet supported in D2D!

Best Matthias

@hhass I will write an SBML->def converter which should solve the issue for me. One question I have is how I can define calculated values from my states which I want to use in the ODEs? Is this possible, or do I have to write out everything in the ODES?

E.g. if I have the states
x0, x1
and parameters
p0, p1
and some assignment rules like
y0 = p1*p2*x1

Where do I define the assignment y0 in the def file ? So I can write the ODEs as

dx0/dt = y0 - p1*x0
dx1/dt = p1

Or do I have to insert all intermediate assignments directly in the ODEs?, i.e.

dx0/dt = p1*p2*x1 - p1*x0
dx1/dt = p1

You could use the preprocessor, but have to be aware that it's a literal replacement and it is not aware of any math that may be going on.

#define Y0 (p1*p2*x1)

Always use extra brackets to be on the safe side.

Can also use derived variables. They get substituted into the rate equations.