*SetSolverArray()

Sets the values for the solver array.

Syntax

SolverArraytypeIC:

*SetSolverArray(a_array, MATH, expression) 
*SetSolverArray(a_array, VALUE, num_values, val1, val2) 
*SetSolverArray(a_array, FILE, "path/filename", "type", "request", "comp") 

SolverArraytypePLANT_INPUT|PLANT_OUTPUT:

*SetSolverArray(a_array, hold_order, true|false, sampling_time, true|false,
offset_time)

Arguments

a_array
The variable name of the solver array for which the set of values will apply.
Data type: varname
MATH
Indicates that the IC component of the array is an expression.
expr
A mathematical expression for the IC component of the curve.
Data type: NumericVector
VALUE
This argument indicates that the data for the IC component of the array is specified as discrete values.
num_values
The number of values.
Data type: real
val1, val2, val3, ..., valn
Discrete values for the IC component of the array.
Data type: real
FILE
Indicates that the data for the IC component of the array comes from a file.
"[path]/filename"
Filename for the IC component of the array.
Data type: filename
type
Specifies the type of data from a data file for the IC component of the curve.
Data type: string
request
Specifies a request from a data file for the IC component of the curve.
Data type: string
Component
Specifies a component of a request from a data file for the IC component of the curve.
Data type: String
hold_order
Specifies the order of interpolation/extrapolation applied to the Plant_Input/Plant_Output signals.
Data type: 0|1|2
sampling_time
Specifies sample time for the Plant_Input/Plant_Output ports.
Data type: Real
offset_time
Specifies sample time offset for the Plant_Input/Plant_Output ports.
Data type: Real

Example

*BeginMDL( model, "Model 1")
 *StandardInclude(FILE)
 *SetCurrentSolverMode(MotionSolve)
 *Curve( crv_0, "Curve 0", 2D, CARTESIAN, WRITE, CURVE_POINTS, OPEN )
 *SolverArray( sa_x, "SolverArray 0", X )
 *SolverArray( sa_u, "SolverArray 1", U, sv_0, sv_1 )
 *SolverArray( sa_y, "SolverArray 2", Y )
 *SolverArray( sa_ic, "SolverArray 3", IC )
 *SolverArray( sa_pi, "SolverArray 4", PLANT_INPUT, sv_0, sv_1 )
 *SolverArray( sa_po, "SolverArray 5", PLANT_OUTPUT, sv_0, sv_1 )
 *SolverVariable( sv_0, "SolverVariable 0" )
 *SolverVariable( sv_1, "SolverVariable 1" )
 *SolverVariable( sv_2, "SolverVariable 2" )
 *SetCurve( crv_0, VALUE, 4, 0, .1, .2, .3, VALUE, 
 4, 1, 2, 3, 4 )
 *SetSolverVariable( sv_0, EXPR, `SIN(TIME)`, OFF )
 *SetSolverVariable( sv_1, CRV, crv_0, , `time`, OFF )
 *SetSolverVariable( sv_2, LIN, 5, OFF )
 *SetSolverArray( sa_ic, VALUE, 1, 4 )
 *SetSolverArray( sa_pi, 0, true, 0.1, true, 1 )
 *SetSolverArray( sa_po, 0, true, 0.1, true, 1 )
*EndMDL()

Context

*BeginMdl()

*DefineAnalysis()

*DefineSystem()

Comments

The *SetSolverArray statement is used for setting values of array of type IC, PLANT_INPUT, and PLANT_OUTPUT. Array values can be used to define a list of constants that are referred to by a function expression or an argument within the list of parameters that are passed into a user subroutine.