ParX

Model Declarations

The model equations formulate a relationship between several types of symbols:

  • Variables: these are the external variables of the model. They represent the interface with the outside world and can be set and measured.
  • Auxiliary Variables: these are internal variables of the model, and therefore not open to outside inspection.
  • Parameters: these are the parameters of the model that describe the range of the model behavior.
  • Constants: these represent a priori information about the model.
  • Flags: these allow switching between different “modes” of the model.
  • Residuals: these are the result of the equations and are equal to zero for all solutions of the equations.
  • Intermediate Variables: these are temporary variables that can be used to split the model equations in more manageable parts.

All symbols must be declared and defined except for the intermediate variables. They are declared by their first use.


                                            variable:  v = {1e-6, -1000, 1000} Volt
                                            variable:  i = {1e-6} Ampere
                                            auxiliary: b = {1e-6, -1000, 1000}
                                            parameter: R = {1, 0, 10, 0, 1000} Ω 
                                            parameter: R2 = {0, -10, 10} V/A²
                                            constant: T = {300} K
                                            flag: selfHeating = {0}
                                            residual: zero
                                        

The variables and auxiliaries are defined by three values: their absolute tolerance and two limits. The lower and upper limits are optional, but when specified are enforced during evaluation of the model.

The parameters are defined by five values: their default value, default lower bound, default upper bound, lower limit and upper limit. The limits are again optional.

The constants and flags are defined by one value: their default value. Flags are booleans, where zero represents false and non-zero true.

The variable, parameter and constant declarations have an optional unit string field. If the unit string contains spaces, the string must be delimited by double quotes.