How Expressions are Evaluated
User expressions for parameters are evaluated when all of the independent parameters are known. When it is time to evaluate an expression, Solve constructs the following macro:
DEFINE Pdeval
PARAMETER <independent parameter name 1>
:
PARAMETER <independent parameter name N>
<user expression>
END_DEFINE
The dependent parameter is then assigned to the value of
Pdeval <value of independent parameter 1> ...
For example, if the expression for parameter A is (B+10) and at some point in the solution process B becomes 6, then Pdeval will be:
DEFINE Pdeval
PARAMETER B
(B+10)
END_DEFINE
And A is assigned to be the result of
Pdeval 6
A syntax error can occur during the evaluation. When this happens, a message is displayed indicating which dependent parameter has the faulty expression and Solve is terminated. Since the offending expression is the last expression to be evaluated, you can view it by running EDIT_MACRO Pdeval immediately after the failure occurs. This procedure may point out problems that might otherwise escape attention, since there is very little syntax checking done when the expression is defined.
For example, if the above sample expression were (rad+10) then the above macro would be:
DEFINE Pdeval
(rad+10)
END_DEFINE
which fails because rad is a keyword and keywords are not recognized as parameters, even if there was a parameter called Rad.