You are here

Working with equations : Intermediate variables

Intermediate variables

 

Local variable assignments can be made before an expression, separated from the expression by a comma.  The expression returning the value of the element must come at the end.  The local variables can be used in the expression, often to simplify it.

In the following example, the local variable q is assigned a value, then the main expression follows after a comma, with q being used to simplify what would otherwise be an extremely complex expression:

q=(Topt-Tmin)/(Tmax-Topt),

if ((T>Tmin)&&(T<Tmax)) then

   (((T-Tmin)^q) * (Tmax-T)) / (((Topt-Tmin)^q) * (Tmax-Topt))

else

   0

 

There are four parameters influencing this expression, T, Topt, Tmin, and Tmax, through influence arrows in the normal way.  The assignment of a value to q is a purely local affair.

In: Contents >> Working with equations >> Components of an equation