FIX: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 2: | Line 2: | ||
The '''FIX''' and '''FREE''' statements are used to constrain (fix) and unconstrain (free) variables. A variable which has been fixed has a known value assigned to it, and ASCEND will not attempt to change that value. On the other hand, with free variables, ASCEND will try to determine a way to calculate the value, using equations defined in the [[MODEL]] and the known values of other variables that have already been solved or fixed. | The '''FIX''' and '''FREE''' statements are used to constrain (fix) and unconstrain (free) variables. A variable which has been fixed has a known value assigned to it, and ASCEND will not attempt to change that value. On the other hand, with free variables, ASCEND will try to determine a way to calculate the value, using equations defined in the [[MODEL]] and the known values of other variables that have already been solved or fixed. | ||
<source lang="a4c">(* add this to the example on the FIX page *) | |||
METHOD solve_x; | |||
(* reconfigure the model to solve for x such that y=0 *) | |||
FREE x; | |||
FIX y; | |||
y:= 0; | |||
END solve_x;</source> | |||
See also [[FREE]]. | |||
[[Category:Syntax]] | [[Category:Syntax]] | ||
Revision as of 09:01, 2 August 2010
The FIX and FREE statements are used to constrain (fix) and unconstrain (free) variables. A variable which has been fixed has a known value assigned to it, and ASCEND will not attempt to change that value. On the other hand, with free variables, ASCEND will try to determine a way to calculate the value, using equations defined in the MODEL and the known values of other variables that have already been solved or fixed.
(* add this to the example on the FIX page *) METHOD solve_x; (* reconfigure the model to solve for x such that y=0 *) FREE x; FIX y; y:= 0; END solve_x;
See also FREE.