Subroutine Type |
Modeling |
|
Definition |
Used to compute outputs for a user-defined request element. This is typically done when the output quantities are too complicated to be expressed as explicit functions. |
|
Use |
User-defined request calling a REQSUB for the calculation of output quantities: |
|
<Post_Request comment = "reqsub" id = "70000006" type = "USERSUB" usrsub_param_string = "USER(30102,30123,30003)" usrsub_dll_name = "NULL" /> |
||
Calling Syntax |
Fortran SUBROUTINE REQSUB (ID, TIME, PAR, NPAR, IFLAG, RESULTS)
C void STDCALL REQSUB (int *id, double *time, double *par, int *npar, int *iflag, double *results)
Python def REQSUB(id, time, par, npar, iflag): return results
MATLAB function results = REQSUB(id, time, par, npar, iflag) |
|
Input Arguments |
[integer] ID |
The user-defined request element identifier. |
[double precision] TIME |
The current simulation time. |
|
[double precision] PAR |
An array that contains the constant arguments from the list provided in the user-defined statement. |
|
[integer] NPAR |
The number of entries in the PAR array. |
|
[logical] IFLAG |
The initialization flag. |
|
Output Values |
[double precision] RESULTS |
The vector output value of dimension eight that contains the computed outputs. |
Example |
def REQSUB(id, time, par, npar, iflag):
states = 9*[0.0] ipar = 3*[0]
results = 8*[0.0]
ipar[0] = int(par[1]) ipar[1] = int(par[2]) ipar[2] = int(par[3])
[states, errflg] = py_sysary("TFORCE", ipar) results[1] = states[0] results[2] = states[1] results[3] = states[2]
[states, errflg] = py_sysary("RFORCE", ipar) results[5] = states[0] results[6] = states[1] results[7] = states[2]
return results |