Skip to content
Beta.cellml@modelscript/cellml 10 diagnostic rules
Parser WASM GLR
Diagnostics 10 rules
DAE Arena Lowering
Simulation Native Solvers
Projections Modelica, DAE
Live ExampleHodgkinHuxleyMembrane.cellml

CellML 2.0 Cardiac & Excitable Membrane Action Potential

Component-based physiological electrophysiology model enforcing strict dimensional units (mV, ms, uA_per_cm2, mS_per_cm2).

Playground
Source (11 lines)
1<?xml version="1.0" encoding="UTF-8"?>
2<model xmlns="http://www.cellml.org/cellml/2.0#" name="HodgkinHuxleyMembrane">
3  <units name="ms"><unit prefix="milli" units="second"/></units>
4  <units name="mV"><unit prefix="milli" units="volt"/></units>
5  <component name="membrane">
6    <variable name="t" units="ms" interface="public"/>
7    <variable name="V" units="mV" initial_value="-75.0" interface="public"/>
8    <variable name="Cm" units="dimensionless" initial_value="1.0"/>
9    <variable name="I_ion" units="dimensionless" initial_value="0.0" interface="public"/>
10  </component>
11</model>
CellML Component Encapsulation & Ion Channel Ports
dimensional check integrate ODE «cellml 2.0 units» Units Registry «parameters» ms = 1e-3 s mV = 1e-3 V «cellml component» membrane «model» V_init = -75.0 mV Cm = 1.0 uF/cm2 «ode solver» ActionPotential «verification» dV/dt = -I_ion / Cm public port encapsulation
Drag to pan · Click % to reset

CellML Cellular Electrophysiology & Physiome Modeling (.cellml) ​

@modelscript/cellml (languages/cellml) provides native WebAssembly parsing, 7-base SI dimensional unit consistency and component port directionality verification, Hodgkin-Huxley / cardiac action-potential and 0D microvascular Windkessel ODE integration, DAEBuilder lowering, and Modelica 3.x / SBML projections for IUPS Physiome Project CellML (1.0 / 1.1 / 2.0) physiological models.


Supported Extensions & Standards ​

ExtensionFormatDescription
.cellml, .xmlCellML 1.0 / 1.1 / 2.0Modular XML specification of units, component, variable, MathML math ODEs, connection, and encapsulation

Key Capabilities ​

1. Modular Components, Encapsulation & 7-Base SI Units ​

  • Parses <units> definitions (prefix, multiplier, exponent over SI base units ampere, candela, kelvin, kilogram, metre, mole, second) and verifies dimensional homogeneity across <map_variables> component connections.
  • Enforces public_interface and private_interface (in / out / none) encapsulation rules.

2. Cardiac Action Potential & Microvascular Hemodynamics Solver ​

  • Integrates membrane voltage Vm and ionic gating variables (m,h,n,d,f,xr) across Hodgkin-Huxley, Noble, Luo-Rudy, and ten Tusscher cardiac electrophysiology models alongside 0D Windkessel arterial/venous perfusion loops:CmdVmdt=−(INa+IK+ICaL+Ileak−Istim(t)),dydt=αy(Vm)(1−y)−βy(Vm)y

3. DAE Arena Lowering & Modelica / SBML Projection ​

  • Lowers modular CellML equations into @modelscript/runtime's DAEBuilder arena and projects models into Modelica 3.x (cellmlToModelica) and SBML (cellmlToSbml).

Pre-Flight Diagnostics ​

10 rules8 error2 warning

CodeRuleSeverityMessage
M9301cellml-missing-model-nameerrorCellML '<model>' element is missing a non-empty 'name' attribute.
M9302cellml-unresolved-unitserrorVariable '<targetName>' in component '<componentName>' references unresolved units '<unitName>'.
M9303cellml-interface-direction-conflicterrorVariable mapping between '<comp1>.<var1>' (interface '<iface1>') and '<comp2>.<var2>' (interface '<iface2>') has incompatible interface directions.
M9304cellml-unit-dimensional-mismatchwarningConnected variables '<comp1>.<var1>' ('<units1>') and '<comp2>.<var2>' ('<units2>') have incompatible physical SI base dimensions.
M9305cellml-uninitialized-state-variablewarningDifferential state variable '<varName>' in component '<compName>' has no 'initial_value' attribute.
M9306cellml-encapsulation-hierarchy-cycleerrorCircular component reference '<compName>' detected in '<encapsulation>' hierarchy.
M9307cellml-unresolved-connection-membererrorConnection references unknown <memberKind> '<memberName>' in '<contextName>'.
M9308cellml-overconstrained-variableerrorVariable '<varName>' in component '<compName>' has an 'in' interface or prior assignment and cannot be assigned by an equation or ODE.
M9309cellml-undefined-math-cierrorEquation in component '<compName>' references undeclared variable identifier '<ciName>'.
M9310cellml-duplicate-variable-or-componenterrorDuplicate <entityKind> '<name>' declared in component '<compName>'.

Generated from languages/cellml/src/lints/rules.ts. All languages →


CLI Usage ​

bash
# Inspect CellML components, variables, units, and connections
msx cellml inspect HodgkinHuxley.cellml

# Validate SI dimensional unit compatibility and interface directions
msx cellml validate HodgkinHuxley.cellml

# Integrate cellular electrophysiology ODE trajectories
msx cellml simulate HodgkinHuxley.cellml

# Project CellML model to Modelica 3.x or SBML
msx cellml to-modelica HodgkinHuxley.cellml > HodgkinHuxley.mo
msx cellml to-sbml HodgkinHuxley.cellml > HodgkinHuxley.sbml

Open-Core under the GNU AGPL v3 License; Enterprise Edition (ee/) under the ModelScript Enterprise License. • Pricing • Trademark Policy