CellML Models
CellML is an XML-based markup language for
describing mathematical models of biological systems. CuBIE can import
CellML files and convert them into
SymbolicODE objects.
Loading a CellML Model
import cubie as qb
system = qb.load_cellml_model(
"path/to/model.cellml",
observables=["I_Na", "I_K"],
)
Variables with differential equations become states. Of the
remaining (algebraic) variables, those defined as plain numbers become
parameters.
Variables defined by expressions become anonymous auxiliaries unless
you list them in observables, in which case their trajectories can
be saved.
Optional arguments:
precisionnp.float32(default) ornp.float64.nameOverride the system name (defaults to the filename).
fix_singularities(defaultTrue)Rewrite removable singularities of the Goldman–Hodgkin–Katz form
U/(exp(U) - 1)before parsing. These otherwise destabilise Newton–Krylov solves, especially infloat32.voltage_variableName of the membrane-voltage variable, used by the singularity fix. Auto-detected if omitted.
show_guiLaunch the interactive variable-classification editor.
CellML parsing is handled by cellmlmanip, which ships vendored
inside CuBIE — no extra install is needed.
Limitations
cellmlmanipmay not handle every CellML 2.0 feature.cubie may take a few seconds to parse and differentiate a large CellML model (hundreds of states) the first time you load it. After that, cubie loads the same file and settings from an on-disk cache.