ParX

Model Syntax Rules

When writing a model definition file, there are a number of additional syntax and grammar rules that must be satisfied:

  • All keywords, function names, and special-number names are case-sensitive and ASCII only.
  • All header keywords can be shortened to a minimum of three characters.
  • All strings, symbol names and units support the full UTF8 character set, except for a small number of character tokens that already have a syntactical meaning.
  • Block comments are enclosed in /* and */.
  • Single line comments are started by // (alternatively ||), and run to the end of the line.
  • Spaces and tabs are not significant except in strings.
  • Strings must be enclosed in (dumb) double quotation marks " when spaces are to be preserved.
  • Statements are closed by the end of the line.
  • Statements can be extended over multiple lines by placing a continuation mark \ at the end of the line.
  • Multiple declarations can be on a single line separated by commas ,.
  • Multiple equations can be on a single line separated by semicolons ;.
  • All numbers can be written using these formats: integer, fixed-point, floating-point, scientific and engineering.
  • Numbers in scientific notation use a lower case e for the exponent (the upper case E means Exa).
  • In declarations the special numbers inf or -inf are allowed, signifying infinite.
  • All variables and parameters are limited to a dynamic range from 1e-99 to 1e+99.

Engineering notation uses the following (SI) suffixes:

suffixes
q = 1e-30 quecto
r = 1e-27 ronto
y = 1e-24 yocto
z = 1e-21 zepto
a = 1e-18 atto
f = 1e-15 femto
p = 1e-12 pico
n = 1e-9 nano
u = 1e-6 micro
m = 1e-3 milli
k = 1e+3 kilo
M = 1e+6 Mega
G = 1e+9 Giga
T = 1e+12 Tera
P = 1e+15 Peta
E = 1e+18 Exa
Z = 1e+21 Zetta
Y = 1e+24 Yotta
R = 1e+27 Ronna
Q = 1e+30 Quetta