Variables
Main.Variables History
Show minor edits - Show changes to markup
v2 = 2 * p1 ! initializes to 3.0 v3 = exp(p2) * p1 ! initializes to exp(3.0) * 1.5
v2 = 2 * v1 ! initializes to 3.0 v3 = exp(v2) * v1 ! initializes to exp(3.0) * 1.5
x < 5 ! initializes to 1.0 (default) with upper bound 5
x < 5 ! initializes to 1.0 (default) ! with upper bound 5
z = 1.8 < 2.3 >=0 ! initializes to 1.8 with upper and lower bounds
z = 1.8 < 2.3 >=0 ! initializes to 1.8 ! with upper bound 2.3 ! and lower bound 0
Model example Variables v0 ! no initial value, default = 1 v1 = 1.5 ! initializes to 1.5 v2 = 2 * p1 ! initializes to 3.0 v3 = exp(p2) * p1 ! initializes to exp(3.0) * 1.5 my_variable = 1 ! initializes to 1.0 End Variables End Model
Variables v0 ! no initial value, default = 1 v1 = 1.5 ! initializes to 1.5 v2 = 2 * p1 ! initializes to 3.0 v3 = exp(p2) * p1 ! initializes to exp(3.0) * 1.5 x < 5 ! initializes to 1.0 (default) with upper bound 5 y = 2 ! initializes to 2.0 z = 1.8 < 2.3 >=0 ! initializes to 1.8 with upper and lower bounds End Variables
(:cellnr:) Global variable name for variable v0 in model example and file test.apm solved in a steady-state ss simulation.
ss.test.example.v0
(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)
(:table border=1 width=100% align=left bgcolor=#EEEEEE cellspacing=0:)
v0 ! no initial value provided - default = 1
v0 ! no initial value, default = 1
Global variable name for variable v0 in model example and file test solved in a steady-state ss simulation.
Global variable name for variable v0 in model example and file test.apm solved in a steady-state ss simulation.
Global variable name for variable v0 in model example and file test solved in a steady-state ss simulation.
Global variable name for variable v0 in model example and file test solved in a steady-state ss simulation.
Global Name
Variables are identified by the simulation mode, file name, model or object name, and variable name. These names are separated by a period to form a global name. These global names are used in configuration files to identify the variable.
! Example variable declarations
! Example variable declarations in test.apm
(:cellnr:)
Global variable name for variable v0 in model example and file test solved in a steady-state ss simulation. ss.test.example.v0
! Example model that demonstrates parameter declarations
! Example variable declarations
p0 ! no initial value provided - default = 1 p1 = 1.5 ! initializes to 1.5 p2 = 2 * p1 ! initializes to 3.0 p3 = exp(p2) * p1 ! initializes to exp(3.0) * 1.5 my_parameter = 1 ! initializes to 1.0
v0 ! no initial value provided - default = 1 v1 = 1.5 ! initializes to 1.5 v2 = 2 * p1 ! initializes to 3.0 v3 = exp(p2) * p1 ! initializes to exp(3.0) * 1.5 my_variable = 1 ! initializes to 1.0
Parameters
Variables
End Parameters
End Variables
(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0 :)
(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)
(:table class='markup horiz' align='left':) (:cell class='markup1':)
General Usage
(:table align='center':) (:cellnr class='markup1':) What to type (:cell class='markup2':) What it looks like (:tableend:)
Scope
(:markup class=horiz:) All variables have global scope. This facilitates the exchange of information between models but can also lead to name conflicts. Variables that are part of objects have the object name pre-pended. In order to use an object's variable in an equation, a connection must be made to a user-defined variable. (:markupend:)
All variables have global scope. This facilitates the exchange of information between models but can also lead to name conflicts. Variables that are part of objects have the object name pre-pended. In order to use an object's variable in an equation, a connection must be made to a user-defined variable.
All variables have global scope. This facilitates the exchange of information between models but can also lead to name conflicts. Object variables have the object name pre-pended. In order to use an object's variable in an equation, a connection must be made to a user-defined variable.
(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0 :) (:cellnr:) (:table class='markup horiz' align='left':) (:cell class='markup1':)
! Example model that demonstrates parameter declarations Model example Parameters p0 ! no initial value provided - default = 1 p1 = 1.5 ! initializes to 1.5 p2 = 2 * p1 ! initializes to 3.0 p3 = exp(p2) * p1 ! initializes to exp(3.0) * 1.5 my_parameter = 1 ! initializes to 1.0 End Parameters End Model
(:tableend:)
(:table class='markup horiz' align='center':)
(:table align='center':)
(:markup class=horiz:) An empty line
starts a new paragraph. (:markupend:)
(:markup class=horiz:)
A single newline
usually doesn't affect the layout.
Use two backslashes
to break a line.
Use three backslashes
for two line breaks.
(:markupend:)
(:markup class=horiz:) A single backslash joins the next line to the previous one. (:markupend:)
Lists
Scope
- lists are created by using asterisks
- more asterisks produce deeper lists
- the list is terminated
- more asterisks produce deeper lists
by the first line that is not a list
All variables have global scope. This facilitates the exchange of information between models but can also lead to name conflicts. Variables that are part of objects have the object name pre-pended. In order to use an object's variable in an equation, a connection must be made to a user-defined variable.
Example
(:table class='markup horiz' align='left':) (:cell class='markup1':)
! Example model that demonstrates parameter declarations Model example Parameters p0 ! no initial value provided - default = 1 p1 = 1.5 ! initializes to 1.5 p2 = 2 * p1 ! initializes to 3.0 p3 = exp(p2) * p1 ! initializes to exp(3.0) * 1.5 my_parameter = 1 ! initializes to 1.0 End Parameters End Model
(:tableend:)
Lists
(:markup class=horiz:)
- lists are created by using asterisks
- more asterisks produce deeper lists
- the list is terminated
- more asterisks produce deeper lists
by the first line that is not a list (:markupend:)
General Usage
(:table class='markup horiz' align='center':) (:cellnr class='markup1':) What to type (:cell class='markup2':) What it looks like (:tableend:)
(:markup class=horiz:) An empty line
starts a new paragraph. (:markupend:)
(:markup class=horiz:)
A single newline
usually doesn't affect the layout.
Use two backslashes
to break a line.
Use three backslashes
for two line breaks.
(:markupend:)
(:markup class=horiz:) A single backslash joins the next line to the previous one. (:markupend:)
Lists
(:markup class=horiz:)
- lists are created by using asterisks
- more asterisks produce deeper lists
- the list is terminated
- more asterisks produce deeper lists
by the first line that is not a list (:markupend:)
(:tableend:)
(:tableend:)