Single-compartment HH cell using the full NeuroML cell element with morphology
Model: SingleCompHHCell
Same HH dynamics as Ex1, but the reference uses the full <cell> element with a single-compartment morphology (soma, area ≈ 1000 μm²), biophysical properties, and channelDensity — the recommended NeuroML format for maximum simulator compatibility.
For a single compartment, channelDensity × area gives the same total conductance as channelPopulation × singleChannelConductance in pointCellCondBased:
Property
Ex5 (<cell>)
Equivalent pointCellCondBased
Capacitance
1.0 uF/cm² × 10⁻⁵ cm²
C = 10 pF
Na
120 mS/cm² × 10⁻⁵ cm² = 1.2 μS
120000 × 10 pS
K
36 mS/cm² × 10⁻⁵ cm² = 360 nS
36000 × 10 pS
Leak
0.3 mS/cm² × 10⁻⁵ cm² = 3 nS
300 × 10 pS
TVBO uses pointCellCondBased with standard NeuroML ion channels, giving numerical identity with the reference to within floating-point precision (max diff < 1 μV).
The reference uses a <cell> element with morphology and channelDensity, while TVBO uses pointCellCondBased with channelPopulation. For single-compartment cells, these are mathematically equivalent — the total conductance is the same. TVBO achieves numerical identity with the reference to within floating-point precision (max diff < 1 μV).
2. Render LEMS XML
xml = exp.render("lems")for line in xml.split('\n'): line_stripped = line.strip()ifany(tag in line_stripped for tag in ['<ionChannel', '<gateHH', '<pointCell','<channelPopulation', '<pulseGenerator', 'Rate type=', '<Include']):print(line_stripped)