physical-quantity-set

This is a set of physical-quantity(s). Physical-quantities characterize a module quantitatively. One of the important roles of the physical-quantity is to describe “state” of the module and spatiotemporal evolution of the state that is mathematically formulated, for example, by differential equations. A physical-quantity is composed of children tags; name, value-type-set, dimension, initial-value, argument-set, domain, problem-condition-set and implementation. A physical-quantity must specify its type and physical-quantity-id which is sequential unique number within a module. Type must be one of the followings; state, variable-parameter, static-parameter, func-expression, nominal, morphology and timeseries. For any type of physical-quantity(s) except morphology and timeseries, at least the following four children tags, name, precision, unit and dimension, must be defined.

A value defined on a physical-quantity can be exported via an out-port. In such case, the association between the physical-quantity and the out-port must be defined. Similarly, a value exported at another module can be received by a physical-quantity via an in-port. In this case, the association between the physical-quantity and the in-port must be defined.

Physical-quantities can be assigned morphology data and timeseries data. By such physical-quantities, morphology data and timeseries data can be integrated in a model.

The shape physical-quantity is used to represent the morphology data defined in the module. Hence when a module includes its own morphology data, there must be the shape physical-quantity to utilize the morphology data. Since the morphology data is assigned to a physical-quantity, the morphological data can be exported from an out-port and import from an in-port in a similar way to other physical-quantities.

Each type of the physical-quantity is explained below.

state

The state represents “state” of the module as dynamic variables that, for example, appears in definitions of ODE, PDE or rule based dynamics governing evolution of the state. The implementation must be defined always. The initial-value must be defined. If the definition of the implementation includes delay elements, the initial value must be defined using time variable. For example, the initial value for time < 0 and initial value at time = 0 are defined. If not the case, the defined value is considered as the initial value at time = 0. The max-delay must be defined if the definition of the implementation includes delay elements. The argument-set must be defined. If the state is declared for ODE, time is a unique argument. The domain must be defined when the state is used for PDE definition. The problem-condition must be defined if the equations written in the implementation is needed to be solved with constraint or boundary conditions.

variable-parameter

The variable-parameter is used to express values that vary during simulation such as a computed value of a mathematical function of dynamic variables (state). The value with mathematical formula is defined in the implementation. If the definition of implementation takes type assign and sub-type timeseries, this physical-quantity represents the value recorded in the timeseries data. The max-delay, initial-value, argument-set, domain and problem-condition-set must be empty.

static-parameter

The static-parameter is used to describe a constant value throughout simulations. The value is defined in the implementation. The max-delay, initial-value, argument-set, domain and problem-condition-set must be empty.

func-expression

The func-expression does not provide values but the analytical formulation of a mathematical function written in text (mathML) format. Argument variables of the func-expression must be defined in argument-set. The domain of the function can be defined in domain if necessary. The user can omit to define the domain, meaning no restriction on the domain. The formula is described in implementation. The max-delay, initial-value and problem-condition-set must be empty.

nominal

The nominal does not have implementation, and is not be required to be used in numerical calculations. This is a kind of a type declaration to be used in definition of the argument variables of func-expression or state. The max-delay, initial-value, argument-set, domain, implementation and problem-condition-set must be empty.

morphology

The physical-quantity with the morphology type can be assigned morphological data (numerical data) as its implementation, which is used in numerical calculations such as structural mechanics formulated by partial differential equations. For this type, only name and implementation must be defined and others (precision, unit, dimension, max-delay, initial-value, argument-set, domain and problem-condition-set) must be empty.

<is:physical-quantity-set>
  <is:physical-quantity type="static-parameter" physical-quantity-id="1">
    ... children of physical-quantity ...
  </is:physical-quantity>
</is:physical-quantity-set>

Physical-quantities can be exported via output port (sender) and can take value from input port (receiver). The relationship of the types of sender and receiver physical-quantities are the following:

sender receiver
state variable-parameter
variable-parameter variable-parameter
static-parameter static-parameter / variable-parameter
func-expression func-expression
nominal -
morphology morphology

1 name

This is a free text to describe the name of this physical-quantity. The name must be unique within the module in which this physical-quantity is. The name must be start with [a-zA-Z_] and be composed of [a-zA-Z0-9_].

<is:name>I_Na</is:name>

2 description

Description for this physical quantity is written as free text.

3 value-type-set

This is a set of value-type tags specifying precision and unit of the physical-quantity.

According to the dimension type which is defined as type in the dimension, the value-type is defined. If the dimension type is scalar, there is only one value-type tag. If it is vector or matrix, the value-type tags have attributes specifying col and row to point one element in the vector or matrix. Note that in the case of a row vector, row is always “1”. Similarly in the case of a column vector, col is always “1”. The precision of values of physical quantities considered in the sense of the computer language is specified here, that takes one of double, integer, character and boolean.

The unit of the physical quantity is specified by unit ID (unit-id) which is defined in unit-set. If the physical quantity is dimensionless, unit-id=”0” is given.

<is:value-type-set>
  <is:value-type precision="double" unit-id="2"/>
</is:value-type-set>
<is:value-type-set>
  <is:value-type col="1" row="1" precision="double" unit-id="2"/>
  <is:value-type col="2" row="1" precision="double" unit-id="2"/>
  <is:value-type col="1" row="2" precision="double" unit-id="3"/>
  <is:value-type col="2" row="2" precision="double" unit-id="3"/>
</is:value-type-set>

If all elements or elements in a sub-matrix have the same unit and precision, then span of row and col can be expressed using “:”. For example ‘col=”1:3”’ means columns from 1 to 3, i.e. columns 1, 2 and 3.

<is:value-type-set>
  <is:value-type col="1" row="1" precision="double" unit-id="2"/>
  <is:value-type col="1" row="2" precision="double" unit-id="2"/>
  <is:value-type col="1" row="3" precision="double" unit-id="2"/>
</is:value-type-set>

is equivalent to

<is:value-type-set>
  <is:value-type col="1" row="1:3" precision="double" unit-id="2"/>
</is:value-type-set>

4 dimension

This defines dimension of the physical quantity as type which can be one of the following: scalar, vector and matrix. In the cases of vector and matrix, number of column and row should be given by col and row tags, respectively. In the case of a row vector, row is always “1”. Similarly in the case of a column vector, row is always “1”. In the case that the dimension of the physical quantity may change during numerical simulation, for example it depends on mesh-digitization determined during simulation, discretization-dependent must be specified at the col and/or row.

scalar

<is:dimension type="scalar"/>

vector with 3 elements

<is:dimension type="vector">
  <is:col>3</is:col>
  <is:row>1</is:row>
</is:dimension>

3×3 matrix

<is:dimension type="matrix">
  <is:col>3</is:col>
  <is:row>3</is:row>
</is:dimension>

matrix with discretization-dependent

<is:dimension type="matrix">
  <is:col>discretization-dependent</is:col>
  <is:row>discretization-dependent</is:row>
</is:dimension>

To specify elements in matrix in equations, row and column number are specified using <selector> of MathML. The index of column and row start from 1. For example, an element at the second row and the third column of a matrix M (i.e. M[2][3]) is

<m:math>
  <m:apply>
    <m:selector/>
    <m:ci type="matrix">M</m:ci>
    <m:cn>2</m:cn>
    <m:cn>3</m:cn>
  </m:apply>
</m:math>

To specify a sub-matrix, for example, a sub matrix in rows from 2 to 4 and columns from 1 to 3, the row and column are described using span expression with ”:”, the MathML will be

<m:math>
  <m:apply>
    <m:selector/>
    <m:ci type="matrix">M</m:ci>
    <m:cn>2:4</m:cn>
    <m:cn>1:3</m:cn>
  </m:apply>
</m:math>

5 max-delay

In delay differential equations, the value of the dynamic variables (physical-quantity(s)) at past time are referred to describe the current state. The max-delay defines the maximum limit of delay to refer a value at . In the process of solving this kind of equations numerically, the time course of physical-quantity on simulation must be store in memory. The max-delay is used to define the length of memory to store history of the physical-quantity. The unit of the delay is the same with the one defined at unit-id of time-discretization in a capsule module directly including this module.

<is:max-delay>10</is:max-delay>

6 initail-value

In the case that the type of a physical-quantity is state, the initial-value must be defined in mathML format in a definition tag as equality. When the physical-quantity is used in PDE as a dynamic variable, the initial value (initial condition) must be described in problem-condition-set which can describe a complicated definition of the initial value such as a morphology dependent boundary condition. In this case the initial-value must be empty. If the definition of the implementation includes delay elements, the initial value must be defined using time variable. For example, the values for time < 0 and value at time = 0 are defined.

V=30

<is:initial-value>
  <is:definition format="mathml">
    <m:math>
      <m:apply><m:eq/>
          <m:ci> V </m:ci>
        <m:cn> 30 </m:cn>
      </m:apply>
    </m:math>
  </is:definition>
</is:initial-value>

where V is the name of the physical-quantity.

X = (0.1, 10, 2.5)

<is:initial-value>
  <is:definition format="mathml">
    <m:math>
      <m:apply><m:eq/>
        <m:ci> X </m:ci>
        <m:vector>
          <m:cn>0.1</m:cn>
          <m:cn>10</m:cn>
          <m:cn>2.5</m:cn>
        </m:vector>
      </m:apply>
    </m:math>
  </is:definition>
</is:initial-value>

where X is the name of the physical-quantity declared as a vector with 3 elements.

7 argument-set

The argument-set to list a set of arguments is defined only for the cases of func-expression and state physical-quantity. Note that if the state physical-quantity is declared for an ODE, time is its unique argument and is not necessary to be described here since time is considered as the default argument. The physical-quantity-id of the physical-quantity of any type is listed in argument tag. These arguments are used to define the domain and implementation of mathematical formulae of func-expression and to define state declared for partial differential equations.

<is:argument-set>
  <is:argument order="1" physical-quantity-id="3"/> 
  <is:argument order="2" physical-quantity-id="5"/>
</is:argument-set>

8 domain

The domain specifies the domain in the mathematical sense on which the function or differential equations are evaluated or solved. The domain must be defined here only when the physical-quantity is func-expression or state type. The domain is defined in a definition tag by using arguments declared in the argument-set with mathML expression or morphological data. In the case of mathML format, an attribute format of the definition is mathml. Logical operators such as and, or can be used in mathML in the definition.

<is:domain>
  <is:name>domain_1</is:name>
  <is:definition format="mathml">
    <m:math>
      <m:apply><m:leq/>
        <m:apply><m:plus/>
          <m:apply><m:power/>
            <m:ci>x</m:ci>
            <m:cn>2</m:cn>
          </m:apply>
          <m:apply><m:power/>
            <m:ci>y</m:ci>
            <m:cn>2</m:cn>
          </m:apply>
          <m:cn>-1</m:cn>
        </m:apply>
        <m:cn>0</m:cn>
      </m:apply>
    </m:math>
  </is:definition>
</is:domain>

<is:domain>
  <is:name>domain_1</is:name>
  <is:definition format="mathml">   
    <m:math>
      <m:apply><m:and/>
        <m:apply><m:geq/> 
          <m:ci>x</m:ci>
          <m:cn>10</m:cn>
        </m:apply>
        <m:apply><m:leq/> 
          <m:ci>x</m:ci>
          <m:cn>30</m:cn>
        </m:apply>
      </m:apply>
    </m:math>
  </is:definition>
</is:domain>

In the case that the domain is given by the morphological data, the attribute format specifies “morphology”. The physical-quantity-id of a morphology type physical-quantity is specified in reference tag in the definition. The morphology data must be once assigned to a morphology type physical-quantity to utilize it. The physical-quantity can be the shape physical-quantity of this module to specify the morphology data defined in this module, or the other physical-quantities with type=“morphology” which is assigned to an in-port to receive morphological data from another module.

<is:domain>   
  <is:name>domain_1</is:name>
  <is:definition format="morphology">
    <is:reference physical-quantity-id="3"/>
  </is:definition>
</is:domain>

If segments are defined in the morphology data specified by the physical-quantity, a geometry-id can be written here to specify a geometry.

<is:domain>   
  <is:name>domain_1</is:name>
  <is:definition format="morphology">
    <is:reference physical-quantity-id="5" geometry-id="2"/>
  </is:definition>
</is:domain>

If the implementation type of the physical-quantity is graph, all node name appear in the definition of the graph must be listed here as a set of MathML.

<is:domain>
  <is:name>domain_1</is:name>
  <is:definition format="mathml">
    <m:math>
      <m:set>
        <m:ci>node1</m:ci>
        <m:ci>node2</m:ci>
        <m:ci>node3</m:ci>
      </m:set>
    </m:math>
  </is:definition>
</is:domain>

9 implementation

This section describes the implementation of the physical-quantity such as values for variable- and static-parameters and mathematical formulae for states. Specific definition is described in a child tag definition. The format of the definition is specified by a type attribute, which takes one of ode (ordinary differential equation), pde (partial differential equation), de (difference equation), ae (algebraic equation), assign, func-expression, graph, conditional and loop. The user can use arithmetic, algebraic and statistic expressions includes vectors and matrices in equations and inequalities for describing conditional branching. If users need to solve differential equations with constraint conditions or boundary conditions, the conditions must be defined in problem-condition-set. The initial conditions for PDE also must be described in problem-condition-set.

9.1 definition

Only one definition section can be written in a implementation section. Mathematical formulations, reference to other data and graphs representing state transitions are described in the math with MathML format, reference and graph tags, respectively. Each type of definition is explained separately below. Definition takes a type attribute which takes either ode, pde, de, ae, assign, func-expression, graph, conditional or loop.

The types stand for as follows. ode: ordinary differential equation, pde: partial differential equation, de: difference equation, ae: algebraic equation, assign: assignment to an in-port and other resources, func-expression: definition of a function formula itself (not a value), graph: graph with nodes and arcs, conditional: if-then rules, and loop: definition of for-like and while-like loops.

The definitions with the type ode, pde can involve values of the function at previous times, i.e. the equations are delay differential equations. In this case, an attribute delay must be set to “true”. Similarly when ode and pde type equations involve stochastic values, an attribute stochastic must be set to “true”.

<is:implementation>
  <is:definition type="ode" delay="true" stochastic="true">
    <m:math> ... </m:math>
  </is:definition>
</is:implementation>

One equation includes sometimes derivatives of several variables. For example, there appear two variables pressure and velocity in Navier-Stokes equation. Each variable must be declared as a state physical-quantity which has its implementation. To avoid duplication of the definition of the equation and to declare explicitly that the state physical-quantity (A) is used in the implementation of the other state physical-quantity (B), the definition of the physical-quantity (A) must specify the associated tag pointing the physical-quantity-id of the physical-quantity (B). If (A) appears also in the implementation (C) and (D), the associated can be multiple.

<is:implementation>
  <is:definition type="pde" sub-type="parabolic">
    <is:associated physical-quantity-id="2" />
  </is:definition>
</is:implementation>

9.1.1 ode

Ordinary differential equation. The equation must include only the first derivative of this physical-quantity differentiated by time and any arithmetic and algebraic expressions which can involve names of other physical-quantities defined in this module.

  <is:implementation>
    <is:definition type="ode" format="mathml">
      <m:math>
       <m:apply>
        <m:eq/>
        <m:apply>
         <m:diff/>
         <m:bvar>
          <m:ci>time</m:ci>
         </m:bvar>
         <m:ci>V</m:ci>
        </m:apply>
        <m:apply>
         <m:divide/>
         <m:apply>
          <m:minus/>
          <m:ci>I_ext</m:ci>
          <m:ci>I</m:ci>
         </m:apply>
         <m:ci>C</m:ci>
        </m:apply>
       </m:apply>
      </m:math>
    </is:definition>
  </is:implementation>

9.1.2 pde

Partial differential equation. All terms should be written in left hand side of the equation, and the right hand side is 0. Only for pde the definition tag has a sub-type attribute to specify the type of PDE as one of elliptic, parabolic, hyperbolic and others, and form attribute to specify if the equation is written weak form using variational formulation or strong form using PDF with derivatives. The left-hand side of the equation can involve names of other physical-quantity(s) defined in this module.

<is:implementation>
  <is:definition type="pde" sub-type="parabolic" form="strong" format="mathml">
    <m:math>
     <m:apply><m:eq/>
      <m:apply>
       <m:plus/>
       <m:apply>
        <m:partialdiff/>
        <m:bvar><m:ci>t</m:ci></m:bvar>
        <m:ci>T</m:ci>
       </m:apply>
       <m:apply>
        <m:times/>
        <m:ci>K</m:ci>
        <m:apply>
         <m:partialdiff/>
         <m:degree><m:cn>2</m:cn></m:degree>
         <m:bvar><m:ci>x</m:ci><m:degree><m:cn>2</m:cn></m:degree></m:bvar>
         <m:ci>T</m:ci>
        </m:apply>
       </m:apply>
       <m:ci>u</m:ci>
      </m:apply>
      <m:cn>0</m:cn>
     </m:apply>
    </m:math>
  </is:definition>
</is:implementation>

9.1.3 de

Difference equation describing the discrete dynamical systems. A shift operator S which takes two arguments: the first one is the physical-quantity on which time shift (delay or advance) is evaluated and the second is the amount of shift, is used in the equation. A negative shift means a time delay and a positive shift corresponds to a time advance. If the second argument is omitted, it is considered that the time shift is 1. The S is one of the insilicoML-defined operators.

9.1.4 ae

Algebraic equation. The left-hand side must be only name of this physical-quantity. The right-hand side of the equation can be any arithmetic and algebraic expressions.

<is:implementation>
  <is:definition type="ae" format="mathml"> 
    <m:math>
      <m:apply><m:eq/>
          <m:ci>V</m:ci>
        <m:cn>-60.3</m:cn>
      </m:apply>
    </m:math>
  </is:definition>
</is:implementation>

9.1.5 assign

The type of assign is used to assign either time series data, morphological data or an input port to this physical-quantity. These suggest the source of the value inputing to this physical-quantity. A sub-type attribute takes one of port, timeseries, morphology and bridge to specify the respective target to be assigned to the physical-quantity. The format must be reference.

The sub-type=“port” is used to assign a value coming from an in-port to the physical-quantity. port-id must be specified in the reference tag.

The sub-type=“timeseries” is used to refer values written in timeseries data from the physical-quantity. timeseries-id must be specified in the reference tag. If the value of the timeseries is vector or matrix, element-id also must be specified, which indicates the position in the vector or matrix (see the insilico-timeseries specification)

The sub-type=“bridge” is used to take a value from a variable or parameters in an imported model at the section of import. Specific target is defined in the bridge section.

If a variable-parameter type physical-quantity receives a value from an input port, the implementation must be defined with type=“assign” sub-type=“port” and with port-id in the reference tag.

port

<is:implementation>
  <is:definition type="assign" sub-type="port" format="reference">
    <is:reference port-id="2"/>
  </is:definition>
</is:implementation>

timeseries

<is:implementation>
  <is:definition type="assign" sub-type="timeseries" format="reference">
    <is:reference timeseries-id="8F5029F1-B085-47C7-A44A-EB0423696333" element-id="2"/>
  </is:definition>
</is:implementation>

bridge

  <is:defintion type="assign" sub-type="bridge"/>
  <is:bridge type="sbml" sub-type="parameter" direction="get">
    <is:connector type="species">k13</is:connector>
  </is:bridge>

For the shape physical-quantity, definition is written as type=”assign” and format=”morphology” to assign the content of the shape defined in the morphology section in this module.

<is:physical-quantity type="morphology" physical-quantity-id="1">
  <is:name>shape</is:name>
  <is:implementation> 
    <is:definition type="assign" sub-type="morphology" format="morphology" />
  </is:implementation>
</is:physical-quantity>

9.1.6 func-expression

The func-expression physical-quantity defines an expression of any arithmetic and algebraic mathematical formula. The left-hand side of the equation must be the name of the physical-quantity as function of arguments. In the case of the definition of algebraic equation (ae), the value obtained by evaluation of the right-hand side of the equation is used as the value of the physical-quantity in the left-hand side. In the case of func-expression, however, the right-hand side is treated as a text formulation as it is.

<is:implementation>
  <is:definition type="func-expression" format="mathml"> 
    <m:math>
      <m:apply><m:eq/>
        <m:apply><m:ci type="function">phi</m:ci>
          <m:ci>Vk</m:ci>
        </m:apply>
        <m:apply><m:divide/>
          <m:ci>Vk</m:ci>
          <m:cn>0.04</m:cn>
        </m:apply>
      </m:apply>
    </m:math>
  </is:definition>
</is:implementation>

The func-expression can be used as a kind of user-defined function which returns value when the func-expression receives the values as arguments. A func-expression can be used in definitions of the mathematical formulation of other physical-quantity(s). The func-expression is used by referring its name in mathML as follows.

<is:implementation>
  <is:definition type="func-expression" format="mathml"> 
    <m:math>
      <m:apply><m:eq/>
        <m:apply><m:ci type="function">phi</m:ci>
          <m:ci>V</m:ci>
        </m:apply>
        <m:apply><m:times/>
          <m:cn>12</m:cn>
          <m:apply><m:ci type="function">phi</m:ci>
            <m:cn>1.3</m:cn>
          </m:apply>
        </m:apply>
      </m:apply>
    </m:math>
  </is:definition>
</is:implementation>

where “phi” is a name of a physical-quantity with type=“func-expression”.

9.1.7 graph

The graph type is used to describe state transition models using Markov chains or any other graphs. This takes an attribute type defining the type of the graph either directed or undirected. A graph is composed of some nodes and arcs described in node-set and arc-set, respectively.

<is:implementation>
  <is:definition type="graph" format="isml">
    <is:graph type="directed">
      <is:node-set> 
      ... children of node-set ...
      </is:node-set>
      <is:arc-set> 
      ... children of arc-set ...
      </is:arc-set>
    </is:graph>
  </is:definition>
</is:implementation>

A node tag describes a node in a graph representing a state. A node has a node-id attribute which is sequential number starts from 1. A node is characterized by its name and description. The name of the node is the value of the physical-quantity. Thus if there are several nodes, the value of the physical-quantity changes among name of nodes according to the transition rule defined in this implementation.

<is:node node-id="2">
  <is:name>close</is:name>
  <is:description>
    close state of the channel
  </is:description>
</is:node>

An arc has arc-id and type attributes. The arc-id is a sequential number starting from 1. The type takes either unidirectional, or bidirectional. An arc specifies the nodes to link to each other by head and tail. Both of head and tail specify node-id as its attribute. State transition rules are described in transition tag of the arc. A transition has an attribute, type, which takes either conditional or probability. When it is conditional, the state moves to another state when the condition described in definitions tag is satisfied. When it is probability, the transition occurs statistically, and only the probability must be written in the definition tag.

<is:arc arc-id="1" type="unidirectional">
  <is:tail node-id="1"/>
  <is:head node-id="2"/>
</is:arc>

9.1.8 conditional

The conditional type of the definition is used to introduce conditional branches like IF – THEN structure of the programing languages into the definition. A case-set tag is used as child of the definition, which includes several cases that have children tags condition and definition. The case-set has an attribute case-set-id to express a set of IF, ELSE-IF and ELSE, i.e. cases in the same case-set with are considered to be in the same set of IF, ELSE-IF and ELSE. Cases have substructure-id (representing “substructure id”) which is unique sequential number within the implementation. Logical operators such as and, or can be used in mathML in the definition. The IF condition is described in the condition in the MathML format. And the corresponding THEN phrase is described in the definition. If the condition is omitted in a case section, the case is considered as ELSE phrase, and the corresponding definition will be evaluate for all cases which did not match to previous conditions.

<is:implementation>
  <is:definition type="conditional">
    <is:case-set case-set-id="1">
      <is:case substructure-id="1">
        <is:condition format="mathml">
          <m:math> 
            <m:apply><m:leq/>
              <m:ci>T</m:ci>
              <m:cn>36.5</m:cn>
            </m:apply>
          </m:math>
        </is:condition>
        <is:definition type="ae" format="mathml"> 
          <m:math> 
            <m:apply><m:eq/>
              <m:ci>k</m:ci>
              <m:cn>12</m:cn>
            </m:apply>
          </m:math>
        </is:definition>
      </is:case>
    </is:case-set>
  </is:definition>
</is:implementation>

The condition branch (case) can be chained and nested as follows.

<is:implementaion>
  <is:definition type="conditional">
    <is:case-set case-set-id="1">
      <is:case substructure-id="1">
        <is:condition format="mathml">
          <m:math> condition1 </m:math>
        </is:condition>
        <is:definition type="ae" format="mathml">
          <m:math> ... </m:math>
        </is:definition>
      </is:case>
      <is:case substructure-id="2">
        <is:condition format="mathml">
          <m:math> condition2 </m:math>
        </is:condition>
        <is:definition type="conditional">
          <is:case-set case-set-id="2">
            <case substructure-id="3">
              <is:condition format="mathml">
                <m:math> condition3 </m:math>
              </is:condition>
              <is:definition type="ae" format="mathml"> 
                <m:math> ... </m:math>
              </is:definition>
            </case>
          </is:case-set>
        </is:definition>
      </is:case>
    </is:case-set>
  </is:definition>
</is:implementaion>

The above example corresponds to

if (condition1){ 
  ...
}else if(condition2){
  if(condition3){ 
    ...
  }
}

9.1.9 loop

The loop type is the implementation of the loop structure which is similar idea with the one in computer language such as C, Java etc. Two types of loop structure can be described here. One is the iteration among an aggregate of elements (i.e. “for”-like loop) and an attribute sub-type must be “iteration”. And the other is a loop continuing until a certain condition is fulfilled (i.e. “while”-like loop) and the sub-type=“while”.

For the former loop, there is the iteration tag which has an attribute substructure-id (representing “substructure id”), which is unique sequential number within the implementation, and three children tags iterator, aggregate and begin to define the loop-related configurations. The iterator defines a kind of a temporal variable which is available in the mathematical expressions in the implementation definition in the loop. Thus the iterator must be an unique string which is not used as any other physical-quantity name.

<is:definition type="loop" sub-type="iteration">
  <is:iteration substructure-id="1">
    <is:iterator>Ia</is:iterator>
    <is:aggregate type="port" port-id="2"/>
    <is:aggregate type="list" initial="1" step="2" upto="11"/>
    <is:aggregate type="physical-quantity" physical-quantity-id="1"/>
    <is:begin format="mathml">
      <m:math> ... </m:math>
    </is:begin>
    <is:definition type="ae" format="mathml">
      <m:math>
        ...
      </m:math>
    </is:definition>
  </is:iteration>
</is:definition>

The aggregation can describe in three ways. An attribute type can take either port, list or physical-quantity. When type=“port”, a port-id of an input port must be given. When type=“list”, initial, step, and upto must be given by number. When type=“physical-quantity”, a physical-quantity-id of a physical-quantity defined by a vector must be given.

<is:aggregate type="port" port-id="2"/>
<is:aggregate type="list" initial="1" step="2" upto="11"/>
<is:aggregate type="physical-quantity" physical-quantity-id="1"/>

The begin defines the initial condition of the physical-quantity evaluated before beginning the iteration. For example, in each iteration if one wants to count items in the aggregate satisfying some conditions, it is necessary to reset the physical-quantity (which is a kind of counter in this case) to zero at the beginning of the iteration. This must be described as equation form such as C=0 in MathML format.

Note that the iteration in a port means the following. An input port can receives multiple edges if the sender modules of these edges satisfy a certain condition. The condition that modules can send edges to the same input port is the following. The instances of the same template module can send the edges from a port with the same port-id to one input port of a module. The iterator takes each value coming along edges from the instances to the input port.

The second type of loop is defined in a tag while which has an attribute loop-id (sequential positive number) and two children tags break-condition to define a condition to break out of the loop when the condition becomes true, and begin to initialize the physical-quantity before beginning each loop if necessary. The break-condition must be defined using MathML.

<is:definition type="loop" sub-type="while">
  <is:while substructure-id="2">
    <is:break-condition format="mathml">
      <m:math>
        ...
      </m:math>
    </is:break-condition>
    <is:begin format="mathml">
      <m:math> ... </m:math>
    </is:begin>
    <is:definition type="ode">
      <m:math>
        ...
      </m:math>
    </is:definition>
  </is:while>
</is:definition>

9.1.10 To include terms with delay in ODEs and PDEs

ODEs and PDEs can include terms referring values at past time. When equations include terms with delay, an attribute delay of the tag definition must be set to “true”. Such terms can be written by using a delay operator Delay which takes two arguments: the first one is the physical-quantity on which time delay is evaluated and the other is the amount of time delay. The unit of the delay is the same with the one defined at unit-id of time-discretization in a capsule module directly including this module. The maximum delay must be defined in the max-delay in this physical-quantity, and the amount of time delay used here must be less than the maximum delay. The Delay operator is one of intrinsic insilicoML-defined operator.

<is:implementation>
  <is:defintion type="ode" delay="true" format="mathml">
    <m:math>
      <m:apply><eq/>
        <m:apply><m:diff/>
          <m:bvar><ci>t</ci></m:bvar>
          <m:ci>x</m:ci>
        </m:apply>
        <m:apply><m:plus/>
          <m:apply><m:minus/>
          <m:ci>x</m:ci>
        </m:apply>
          <m:apply><m:csymbol>Delay</m:csymbol>
            <m:ci>x</m:ci>
            <m:cn>10</m:cn>
          </m:apply>
          <m:cn>4</m:cn>
        </m:apply>
      </m:apply>
    </m:math>
  </is:defintion>
</is:implementation>

9.1.11 To include stochastic variables in ODEs and PDEs

Users can describe the ODEs and PDEs including stochastic functions, e.g. probability density functions or random value generators. Several functions to generate stochastic values are pre-defined in insilicoML, such as Gaussian(mean, variance), Poisson(mean) and so on. The available functions related to stochastic process is listed somewhere else.

9.2 extra-implementation

In this section, additional implementation for this physical-quantity can be described. Only one extra-implementation can be written in an implementation section. This tag takes definition as its child. For example, a dynamical variable v which is a state type physical-quantity and its implementation is as follows:

In this case, the first equation (ODE) must be written in definition in implementation. And the condition v >= 30 must be written in extra-implementation. The extra-implementation has a type attribute which takes instantaneous, restriction, additional or supplementary, and an order attribute which takes before or after. The order determines the order of numerical evaluation in the simulation. For example, in the above example, the extra-implementation must be written as follows:

<is:extra-implementation order="after" type="instantaneous">
  <is:definition type="conditional">
    <is:case-set case-set-id="1">
      <is:case substructure-id="1">
        <is:condition format="mathml">
          <m:math> 
            <m:apply><m:geq/>
            <m:ci>V</m:ci>
            <m:cn>30</m:cn>
            </m:apply>
          </m:math>
        </is:condition>
        <is:definition type="ae" format="mathml">
          <m:math>
            <m:apply><m:eq/>
                <m:ci> v </m:ci>
                <m:apply><m:plus/>
                    <m:ci>v</m:ci>
                    <m:ci>d</m:ci>
                </m:apply>
            </m:apply>
          </m:math>
        </is:definition>
      </is:case>
    </is:case-set>
  </is:definition>
</is:extra-implementation>

where order=”after” means the extra-implementation will be evaluated after the numerical integration routine which is applied for .

When a model includes template and instances, a port can be receive multiple inputs from instance modules of a common template. In a such case, extra-implementation can be used to process such multiple inputs using iterative calculation. In this case, the type of the extra-implementation must be ”multiple-input-assignment”. The result value is set in this physical-quantity as the association between this physical-quantity and the port receiving multiple inputs is described in the definition of the implementation section. Note that a port receiving multiple input must be set an attribute multiple-inputs=”true”.

<is:implementation>
  <is:definition type="assign" sub-type="port" format="reference>
    <is:reference port-id="1"/>
  </is:definition>
  <is:extra-implementation type="multiple-input-assignment">
    <is:definition type="loop" sub-type="iteration">
      <is:iteration sub-structure-id="1">
        <is:iterator>Itr</is:iterator>
        <is:aggregate type="port"/>
        <is:begin>
          <is:definition>
            ...
          </is:definition>
        </is:begin>
        <is:definition>
          ...
        </is:definition>
      </is:iteration>
    </is:definition>
  </is:extra-implementation>
      </is:implementation>

9.3 bridge

This describes the relationship between this physical-quantity and an element defined in a imported model at the import section. Bridge has an attribute type which takes sbml for the moment, which means that the imported model is written in SBML format. Another attribute direction taking either “set” or “get” defines a functional meaning of the relationship. sub-time attribute takes either “species” or “parameter”, defining the target type in the imported SBML model to be associated to this physical-quantity.

When direction=”get”, the value defined in the target element is taken and assigned to the physical-quantity. On the contrary when direction=”set”, the value defined in the physical-quantity is sent to the element in the imported model, and the value of the element is replaced by the value of the physical-quantity. If the element in the imported model has a dynamics (described by a differential equation, for example), the dynamics is completely overrode by the one defined in the physical quantity.

Connector defines a specific target to which this physical-quantity is associated. In the case of type=”sbml”, type attribute takes either species, reaction or parameter. When sub-type of bridge is species, a connector with type=”species” is necessary. The value of the id attribute of species tag in a listOfSpecies tag in a SBML model must be given. When sub-type of bridge is parameter, there are connectors with type=”reaction” (optional) and “parameter” (necessary). The value of the reaction id in listOfReaction tag and reaction-id and parameter-id are given, respectively.

<is:implementation>
  <is:definition type="ode" format="mathml">
    <m:math> ...ds_1/dtime = -s_1*k ... </m:math>
  </is:definition>
 
  <is:bridge type="sbml" sub-type="species" direction="set">
    <is:connector type="species">s_1</is:connector>
  </is:bridge>
</is:implementation>
<is:implementation>
  <is:definition type="ae" format="mathml">
    <m:math> ...k13 = 0.5... </m:math>
  </is:definition>
 
  <is:bridge type="sbml" sub-type="parameter" direction="set">
    <is:connector type="reaction">re_1</is:connector>
    <is:connector type="parameter">k13</is:connector>
  </is:bridge>
</is:implementation>
<is:implementation>
  <is:definition type="assign" sub-type="bridge"/>
 
  <is:bridge type="sbml" sub-type="parameter" direction="get">
    <is:connector type="parameter">k13</is:connector>
  </is:bridge>
</is:implementation>

9.4 description

Free text to describe about the definition of the physical-quantity.

10 problem-condition-set

This is a set of problem-conditions, in which the constraint, boundary or initial conditions are defined to solve with ordinary or partial differential equations. The problem-condition has a type attribute which takes either of the following:

The constraint for constraint conditions, initial for initial conditions for PDE, boundary for boundary conditions. The material describes the physical properties of the material composing the morphological data. The mesh provides the information to generate mesh on the morphological data. The solver gives the information used by the solver for the finite element method to solve PDE with the morphological data. The post is used to define the post-processors.

<is:problem-condition-set>
  <is:problem-condition type="boundary" problem-condition-id="1">
    ... children of problem-condition ...
  </is:problem-condition>
</is:problem-condition-set>

10.1 constraint

For the case of constraint conditions, the space Mx that satisfies x 1 Mx where x is the target physical-quantity to be constrained is defined in the definition section. Mx can be described either in a mathematical format such as {x | f(x)=0} (with format=”mathml”) or a set of points represented by morphological data for the digitized case (with format=”morphology”). In the case that the dynamics of x is constrained on a time-series, the format is ”timeseries”. When the definition is described in mathematical format, all terms must be written in the left-hand side of the equation or inequality and the right-hand side must be zero. If the constraint condition is applied on a boundary, the boundary ID must be given in configured-at tag.

<is:problem-condition type="constraint" problem-condition-id="1">
  <is:definition format="mathml">
    <m:math>
      <m:apply><m:eq/>
        <m:apply><m:minus/>
          <m:apply><m:times/>
            <m:ci>x</m:ci>
            <m:apply><m:transpose/>
              <m:ci>x</m:ci>
            </m:apply>
          </m:apply>
          <m:cn>1</m:cn>
        </m:apply>
        <m:cn>0</m:cn>
      </m:apply>
    </m:math>
  </is:definition>
</is:problem-condition>

morphological data

<is:problem-condition type="constraint" problem-condition-id="1">
  <is:definition format="morphology"> 
    <is:reference physical-quantity-id="1" segment-id="3"/>
  </is:definition>
</is:problem-condition>

or

<is:problem-condition type="constraint" problem-condition-id="1">
  <is:definition format="morphology"> 
    <is:reference physical-quantity-id="2" geometry-id="3"/>
  </is:definition>
</is:problem-condition>

timeseries data

<is:problem-condition type="constraint" problem-condition-id="1">
  <is:definition format="morphology"> 
    <is:reference timeseries-id="157e74b5-7210-4c5f-ba51-d482a641425b" element-id="1"/>
  </is:definition>
</is:problem-condition>

10.2 boundary

The definition tag has an attribute “type” and “format”. The type takes either neumann, dirichlet or robin to specify, respectively, the boundary condition is Neumann, Dirichlet or Robin type. The format takes mathml or external. When format is external, the URI is given as an attribute iref (for local path) or xref (for remote path) at reference, the child element of definition. In the configured-at tag, the boundary on which the condition is configured must be specified by segment-id. The direction of the value (for example force and flow) is given by argument variables (such as x, y), perpendicular, parallel or other with respect to the tangential plane (line) at the boundary is specified in the direction tag (notice that thus perpendicular is the direction of the normal vector).

Dirichlet type: T = 36.5

<is:problem-condition type="boundary" problem-condition-id="1">
  <is:configured-at physical-quantity-id="4" segment-id="1"/>
  <is:definition type="dirichlet" format="mathml">
    <m:math>
      <m:apply><m:eq/>
        <m:ci> T </m:ci>
        <m:cn> 36.5 </m:cn>
      </m:apply>
    </m:math>
  </is:definition>
  <is:direction>perpendicular</is:direction>
</is:problem-condition>

Neumann type: the value the derivative of a solution is to take on the boundary is given.

<is:problem-condition type="boundary" problem-condition-id="1">
  <is:configured-at physical-quantity-id="4" segment-id="3"/>
  <is:definition type="neumann" format="mathml">
    <m:math> ... partialdiff(u,n) = h(x,y) ... </m:math>
  </is:definition>
  <is:direction>perpendicular</is:direction>
</is:problem-condition>

10.3 initial

The initial condition is defined in a similar way with the boundary condition. An attribute format in this type definition takes mathml or external. In the configured-at tag, the location on which the initial condition is configured must be specified by structure-id. If it is necessary to specify the direction of the value (for example force and flow), perpendicular or parallel against the tangential plane is specified at the direction tag.

<is:problem-condition type="initial" problem-condition-id="1">
  <is:configured-at physical-quantity-id="4" segment-id="4"/>
  <is:definition format="mathml">
    <m:math>
      <m:apply><m:eq/>
        <m:ci> f </m:ci>
        <m:cn> 0 </m:cn>
      </m:apply>
    </m:math>
  </is:definition>
  <is:direction>perpendicular</is:direction>
</is:problem-condition>

10.4 material

The material describes the physical properties of the material composing the morphological data. As default properties the following 14 materials are prepared: young (Young’s modulus), poisson (Poisson’s ratio), density (Density), friction (Friction coefficient), thermal-conductivity (Thermal conductivity), specific-heat (Specific heat), enthalpy (Enthalpy), magnetic-permeability (Relative magnetic permeability), coercivity (Coercivity), permittivity (Relative permittivity), resistivity (Electrical resistivity), viscosity (Viscosity), thermal-expansion (Coefficient of thermal expansion), and sound-speed (Speed of sound). These names are ISML pre-defined.

Those material properties are defined on certain structures defined in configured-at by structure-id. The format in this definition takes mathml or external.

mathml

<is:problem-condition type="material" problem-condition-id="1">
  <is:configured-at physical-quantity-id="1" segment-id="1"/>
  <is:definition format="mathml">
    <m:math>
      <m:apply><m:eq/>
        <m:ci> density </m:ci>
        <m:cn> 10.1 </m:cn>
      </m:apply>
    </m:math>
  </is:definition>
</is:problem-condition>

or

external

<is:problem-condition type="material" problem-condition-id="1">
  <is:configured-at physical-quantity-id="1" segment-id="1"/>
  <is:definition format="external">
    <is:reference iref="../data/resistivity.txt">
  </is:definition>
</is:problem-condition>

The user can define new materials if they are not in the default list.

10.5 solver

The solver gives the information used by the solver for the finite element method to solve PDE with the morphological data. As solving method, insilicoML has the following six choices:

  • LU
  • Cholesky
  • Crout
  • CG
  • GMRES
  • UMFPACK

And convergence criterion also must be specified. In the case that the solver algorithm specified in the method tag requires options, the option-set and option tags are available as children of the method.

<is:problem-condition type="solver" problem-condition-id="1">
  <is:method>LU</is:method>
</is:problem-condition>

10.6 post

The post is used to define the post-processors. According post-processor type, such as gnuplot and medit, the format of the result file is determined. In the case that the post-processor specified in the processor tag requires options, the option-set and option tags are available as children of the method.

<is:problem-condition type="post" problem-condition-id="1">
  <is:processor>medit</is:processor>
</is:problem-condition>

11 Miscellaneous Notes

11.1 Intrinsic functions

In the mathematical expressions in condition, definition and domain, several intrinsic functions are available. At first, well-know mathematical functions which are defined in mathML specification are available, such as trigonometric, logarithm, exponential functions , power root, absolute value and so on (c.f. http://www.w3.org/TR/MathML2/chapter4.html ).

The insilicoML-defined functions are the following. distance(m1, m2): distance between frame-origin of modules m1 and m2. distance_c(m1, m2): distance between centers of morphological data (shape) assigned to modules m1 and m2. distance_s(m1, m2): the shortest distance between surface to surface of morphological data (shape) assigned to modules m1 and m2. angle(m1, m2): Euler angle from a frame-angle of module m1 to module m2 counted in an anti-clockwise way in the global coordinate. direction(m1, m2): direction vector from a module m1 to m2. position(m1, m2): the coordinate of a module m2 in the local coordinate system with respect to m1. Functions defined within insilicoML is listed elsewhere.

These functions take two module-id as arguments. The first argument usually represents the origin module and the second destination. If only one argument is given, the current module is considered to be the first argument. For example, direction(module_2) means that the direction from this module to module_2.

<is:definition type="conditional">
  <is:case substructure-id="1">
    <is:condition format="mathml">   
      <m:math>
        <m:apply><m:eq/>
            <m:apply>
            <m:ci type="function"> distance_s </m:ci>
            <m:ci>DDF9D510-179F-4A64-AA33-6EE560FA18FC</m:ci>
          </m:apply>
          <m:cn> 0 </m:cn>
        </m:apply>
      </m:math>
    </is:condition>
    <is:definition type="ae" format="mathml">  
      <m:math> ... </m:math>
    </is:definition>
  </is:case>
</is:definition>

Note that when a template module is given as an argument of these insilicoML-defined functions, the function calculation will apply to all instances of the template. For example, distance_c(module_1, template_2) calculates distances from the center of module_1 to centers of all instance modules of template_2. And if it is used in a condition, the condition is evaluated as true when all of such distances satisfy the condition.

isml/specifications/ismodel/module-set/physical-quantity-set.txt · Last modified: 2011/10/13 17:04 by okamoto
Driven by DokuWiki Recent changes RSS feed Valid XHTML 1.0