Model structure

Model structure#

Models can be spread over multiple files. The root element in each file is Lems.


Schema against which LEMS based on these should be valid: LEMS_v0.7.6.xsd. Generated on 18/06/24 from this commit. Please file any issues or questions at the issue tracker here.


Lems#

Root element for any lems content

dimensions

Dimension

constants

Constant

units

Unit

assertions

Assertion

componentTypes

ComponentType

components

Component

targets

Target

Target#

A lems file can contain many component definitions. A Target elements specifies that a components should be treated as the entry point for simulation or other processing

component

String

Reference to the entry point component

reportFile

String

Optional attribute specifying file in which to save short report of simulation

timesFile

String

Optional attribute specifying file in which to save times used in simulation

<xs:complexType name="Target">
  <xs:attribute name="component" type="xs:string" use="required"/>
  <xs:attribute name="reportFile" type="xs:string" use="optional">
    <xs:annotation>
      <xs:documentation>jLEMS only optional attribute to also write a short report with simulation duration, version, etc.</xs:documentation>
    </xs:annotation>
  </xs:attribute>
  <xs:attribute name="timesFile" type="xs:string" use="optional">
    <xs:annotation>
      <xs:documentation>jLEMS only optional attribute to also write a file containing actual times used in the simulation.</xs:documentation>
    </xs:annotation>
  </xs:attribute>
</xs:complexType>
<Target component="sim1"/>
<Target component="sim1"/>
<Target component="sim1"/>
<Target component="sim1"/>
<Target component="sim1"/>

Constant#

A constant quantity: like a parameter for which the value is supplied in the class definition itself rather than when a component is defined.

name

String

A readable name for the constant.

symbol

String

The symbol used in expressions to refer to this constant.

value

String

The value of a constant must be a plain number (no units) giving the SI magnitude of the quantity or an expression involving only plain numbers or other constants.

dimension

String

<xs:complexType name="Constant">
  <xs:attribute name="name" type="xs:string" use="required"/>
  <xs:attribute name="dimension" type="xs:string" use="optional" default="none"/>
  <xs:attribute name="value" type="PhysicalQuantity" use="required"/>
  <xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Constant name="kte" dimension="voltage" value="25.3mV"/>
<Constant name="kte" dimension="voltage" value="25.3mV"/>

Include#

Include LEMS files in other LEMS files. Files are included where the Include declaration occurs. The enclosing Lems block is stripped off and the rest of the content included as is

file

String

the name or relative path of a file to be included

<xs:complexType name="Include">
  <xs:attribute name="file" type="xs:string" use="required"/>
</xs:complexType>
<Include file="SimpleNetwork.xml"/>
<Include file="SingleSimulation.xml"/>
<Include file="ex2dims.xml"/>
<Include file="hhchannel.xml"/>
<Include file="hhcell.xml"/>