Main
~~!! Variable Constraints~~

## Variable Constraints

## Main.VariableConstraints History

Hide minor edits - Show changes to output

Deleted lines 0-1:

Changed line 9 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 7 from:

Variable constraints may lead to infeasible solutions. For square problems (n'_var_'=n'_eqn_'), the constraints are generally not needed but may help guide the solver to a feasible solution. Constraints are particularly advantageous to keep variable values away from strongly non-linear regions of the equation residuals. Good solvers correctly identify infeasible solutions and terminate.

to:

Variable constraints may lead to infeasible solutions. For square problems (n'_var_'=n'_eqn_'), the constraints are generally not needed but may help guide the solver to a feasible solution. Constraints are particularly advantageous to keep variable values away from strongly non-linear regions of the equation residuals. Good solvers correctly identify infeasible solutions and terminate with an appropriate message.

Added lines 1-31:

!! Variable Constraints

Constraints serve to bound a parameter or variable with upper and lower limits. Variable constraints may be expressed as absolute numbers or functions of parameters or variable initial conditions. A variable constraint is included in the variable declarations section along with the initial condition. The constraints less than or equal (<=) or simply less than (<) are considered to be equivalent for numerical solutions. Likewise, greater than or equal (>=) and greater than (>) are equivalent.

!!! Infeasible Solution

Variable constraints may lead to infeasible solutions. For square problems (n'_var_'=n'_eqn_'), the constraints are generally not needed but may help guide the solver to a feasible solution. Constraints are particularly advantageous to keep variable values away from strongly non-linear regions of the equation residuals. Good solvers correctly identify infeasible solutions and terminate.

!!! Example

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

(:cellnr:)

! Example model that demonstrates parameter declarations

Model example

Parameters

p1 = 1, >=0, < 2

p2 <= 5

End Parameters

Variables

v1 = 0, >-1, <1

v2 = 1, >=p1, <=p5*p1

End Variables

Equations

v1 * v2 = p2

v1 + v2 = p1

End Equations

End Model

(:tableend:)

Constraints serve to bound a parameter or variable with upper and lower limits. Variable constraints may be expressed as absolute numbers or functions of parameters or variable initial conditions. A variable constraint is included in the variable declarations section along with the initial condition. The constraints less than or equal (<=) or simply less than (<) are considered to be equivalent for numerical solutions. Likewise, greater than or equal (>=) and greater than (>) are equivalent.

!!! Infeasible Solution

Variable constraints may lead to infeasible solutions. For square problems (n'_var_'=n'_eqn_'), the constraints are generally not needed but may help guide the solver to a feasible solution. Constraints are particularly advantageous to keep variable values away from strongly non-linear regions of the equation residuals. Good solvers correctly identify infeasible solutions and terminate.

!!! Example

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

(:cellnr:)

! Example model that demonstrates parameter declarations

Model example

Parameters

p1 = 1, >=0, < 2

p2 <= 5

End Parameters

Variables

v1 = 0, >-1, <1

v2 = 1, >=p1, <=p5*p1

End Variables

Equations

v1 * v2 = p2

v1 + v2 = p1

End Equations

End Model

(:tableend:)