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:

precision

np.float32 (default) or np.float64.

name

Override the system name (defaults to the filename).

fix_singularities (default True)

Rewrite removable singularities of the Goldman–Hodgkin–Katz form U/(exp(U) - 1) before parsing. These otherwise destabilise Newton–Krylov solves, especially in float32.

voltage_variable

Name of the membrane-voltage variable, used by the singularity fix. Auto-detected if omitted.

show_gui

Launch the interactive variable-classification editor.

CellML parsing is handled by cellmlmanip, which ships vendored inside CuBIE — no extra install is needed.

Limitations

  • cellmlmanip may 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.