![]() | Respecifies an expression or redefines and passes constants to a user-written subroutine to define a variable. If you want to define the variable with an expression, FUNCTION must be followed with an equal sign and the expression. If you want to define the variable with a user-written subroutine, FUNCTION must be followed with an equal sign, the character string USER, and the selected values (r1[,...,r30]) that Adams Solver (C++) passes to the user-written subroutine VARSUB (see the VARSUB subroutine). |
IC=r | Respecifies an approximate initial value for the VARIABLE. Adams Solver (C++) may adjust the value of IC when it performs an initial condition analysis. Entering an accurate value for IC may help Adams Solver (C++) converge to the initial conditions solution. |
LIST | Lists the current values of the VARIABLE arguments. |
ROUTINE=libname::subname | Specifies an alternative library and name for the user subroutine VARSUB. Learn more about the ROUTINE Argument. |
Tip: | Consider using ARRAY instead of VARIABLE if the function is a constant value |
Caution: | ■Caution should be used when defining a VARIABLE statement that is dependent on another VARIABLE statement or on an Adams Solver (C++) statement that contains functions. If a defined system of equations does not have a stable solution, convergence may fail for the entire Adams Solver (C++) model. The following example refers to this type of VARIABLE statement: VARIABLE/1, FUNCTION= VARVAL(1)+1 When looked at as an algebraic equation, it looks like the following: V=V+1. However, when Adams Solver (C++) tries to solve this equation using the Newton-Raphson iteration, the solution diverges and a message appears on the screen indicating that the solution has failed to converge. ■The IC argument can be altered only prior to a simulation. If you run a simulation and then try to alter IC, Adams Solver (C++) rejects the entire VARIABLE command. ■The IC argument should be used whenever a zero value might cause a floating point exception or lead Adams Solver (C++) away from the desired solution. |