Tabular format
The Heta standard includes different forms of modeling platform representation. All formats share the same meaning and similar properties where possible.
For many reasons the tabular representation can be useful for the model development:
- Easier for those who are unfamiliar with the Heta syntax;
- Code parser is not required for external tools;
- Simplify model content review and annotation;
- Excel and other table processor utilization.
See also format comparison example.
Basics
The content of the tables can be loaded with include statement of the
table
type. There are also addition properties for this type, see Modules chapter.Example:
heta#include {source: ./components.xlsx, type: table, sheet: 0, omitRows: 1};
The modeling platforms can be created from single Heta table, several tables, or with mixture of modules of different types without restrictions.
Colors, fonts and other decoration available for specific table processors do not play a role for modeling platform meaning.
The first raw of the table is the header. It describes the meaning of cells content of other raws. The header syntax follows the rules for describing component properties and sub-properties.
Each row represents a single Heta action. Empty rows will be skipped. Rows with
on
property set to0
or empty will be skipped as well.Each cell represents the property value or values. Empty cell means the value is not set.
Boolean values in cells can be set with
false
,true
values or equivalently0
,1
Simple string or numeric arrays can be declared with values divided by semicolon:
A;B;C
or1;2;3
The quotation for strings in cells should not be applied in opposite to Heta code syntax.
Header syntax rules
Simple property (of first level) like
title
,id
,num
should be set in the header as a string. Example:id class num title k1 Const 1.1 rate constant 1 k2 Const 0.1 This table is an equivalent of the following plain Heta:
heta{id: k1, class: Const, num: 1.1, title: rate constant 1}; {id: k2, class: Const, num: 0.1};
And the same in shortened version:
hetak1 @Const = 1.1 'rate constant 1'; k2 @Const = 0.1;
Sub-properties like
start_
,ode_
inassignments
, etc. can be declared with dot symbol. Example:id class assignments.start_ assignments.sw1 x1 Record 10 100 x2 Record 0.1 This table is an equivalent of the following plain Heta:
heta{id: x1, class: Record, assignments: {start_: 10, sw1: 100}}; {id: x2, class: Record, assignments: {start_: 0.1}};
And the same in shortened version:
hetax1 @Record .= 10 [sw1]= 100; x2 @Record .= 0.1;
Arrays can be declared with square brackets
Example:
id class num tags[] coef1 Const 1e-3 A;B;C This table is an equivalent of the following plain Heta:
heta{id: coef1, class: Const, num: 1e-3, tags: [A,B,C]};
And the same in shortened version:
hetacoef1 @Const = 1e-3 {tags: [A,B,C]};
There is one specific header
on
. The value0
or empty in correspondent cells means "skip this row". It is the mechanism to mimic a single-line comment or a header.Example:
on id class num title 1 k1 Const 1.1 this will not be skipped 0 k2 Const 0.1 this will be skipped This is equivalent to the following:
hetak1 @Const = 1.1 'this will not be skipped';