FIX: Difference between revisions

From ASCEND
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{stub}}
The '''FIX''' statements is used in the [[METHOD]]s part of a model to constrain particular variables in the model. A variable which has been fixed has a known value assigned to it, and ASCEND will not attempt to change that value. The FIXed variables in a model are used as the basis from which the remaining un-FIXed ([[FREE]]) variables can be calculated. By default, no variables are FIXed until an explicit command to FIX them is given.


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>
 
Note that variables can also be FIXed and FREEd in an ad-hoc way, using the ASCEND GUI.
 
See also [[FREE]].


[[Category:Syntax]]
[[Category:Syntax]]

Latest revision as of 09:03, 2 August 2010

The FIX statements is used in the METHODs part of a model to constrain particular variables in the model. A variable which has been fixed has a known value assigned to it, and ASCEND will not attempt to change that value. The FIXed variables in a model are used as the basis from which the remaining un-FIXed (FREE) variables can be calculated. By default, no variables are FIXed until an explicit command to FIX them is given.

(* 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;

Note that variables can also be FIXed and FREEd in an ad-hoc way, using the ASCEND GUI.

See also FREE.