Main
~~!! Constants~~

## Constants

## Main.Constants History

Hide minor edits - Show changes to output

Deleted lines 0-1:

Changed line 7 from:

(:table border=1 width=~~50~~% align=left bgcolor=#EEEEEE cellspacing=0:)

to:

(:table border=1 width=100% align=left bgcolor=#EEEEEE cellspacing=0:)

Changed line 5 from:

Constants are declared in the ''Constants ... End Constants'' section of the model file. The constants may be defined in one section or in multiple declarations throughout the model. ~~Parameter~~ initialization is performed sequentially, from top to bottom. If a ~~parameter~~ does not have an initial value given, a default value of 1.0 is assigned. Constants may also be a function of other constants~~ or variable initial conditions~~. These initial conditions are processed once as the first step after the model parsing.

to:

Constants are declared in the ''Constants ... End Constants'' section of the model file. The constants may be defined in one section or in multiple declarations throughout the model. Constant initialization is performed sequentially, from top to bottom. If a constant does not have an initial value given, a default value of 1.0 is assigned. Constants may also be a function of other constants. These initial conditions are processed once as the first step after the model parsing.

Added lines 1-30:

!! Constants

Constants are fixed values that represent model inputs, fixed constants, or any other value that does not change. Constants are not modified by the solver as it searches for a solution. As such, constants do not contribute to the number of degrees of freedom (DOF).

Constants are declared in the ''Constants ... End Constants'' section of the model file. The constants may be defined in one section or in multiple declarations throughout the model. Parameter initialization is performed sequentially, from top to bottom. If a parameter does not have an initial value given, a default value of 1.0 is assigned. Constants may also be a function of other constants or variable initial conditions. These initial conditions are processed once as the first step after the model parsing.

!!! Example

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)

(:cellnr:)

! Example model that demonstrates constant declarations

Model example

Constants

c0 ! no initial value provided - default = 1

c1 = 1.5 ! initializes to 1.5

c2 = 2 * c1 ! initializes to 3.0

c3 = exp(c2) * c1 ! initializes to exp(3.0) * 1.5

my_constant = 5 ! initializes to 5.0

End Parameters

Variables

x[1:c2] = my_constant ! create a vector of 3 initialized to 5

End Variables

Equations

x[1:c2-1] = c3

x[c2] = c1 + c2 + x[1]

End Equations

End Model

(:tableend:)

Constants are fixed values that represent model inputs, fixed constants, or any other value that does not change. Constants are not modified by the solver as it searches for a solution. As such, constants do not contribute to the number of degrees of freedom (DOF).

Constants are declared in the ''Constants ... End Constants'' section of the model file. The constants may be defined in one section or in multiple declarations throughout the model. Parameter initialization is performed sequentially, from top to bottom. If a parameter does not have an initial value given, a default value of 1.0 is assigned. Constants may also be a function of other constants or variable initial conditions. These initial conditions are processed once as the first step after the model parsing.

!!! Example

(:table border=1 width=50% align=left bgcolor=#EEEEEE cellspacing=0:)

(:cellnr:)

! Example model that demonstrates constant declarations

Model example

Constants

c0 ! no initial value provided - default = 1

c1 = 1.5 ! initializes to 1.5

c2 = 2 * c1 ! initializes to 3.0

c3 = exp(c2) * c1 ! initializes to exp(3.0) * 1.5

my_constant = 5 ! initializes to 5.0

End Parameters

Variables

x[1:c2] = my_constant ! create a vector of 3 initialized to 5

End Variables

Equations

x[1:c2-1] = c3

x[c2] = c1 + c2 + x[1]

End Equations

End Model

(:tableend:)