REQSUB
ModelingUsed 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
<Post_Request
comment = "reqsub"
id = "70000006"
type = "USERSUB"
usrsub_param_string = "USER(30102,30123,30003)"
usrsub_dll_name = "NULL"
/>
Format
- Fortran Calling Syntax
-
SUBROUTINE REQSUB (ID, TIME, PAR, NPAR, IFLAG, RESULTS)
- C/C++ Calling Syntax
-
void STDCALL REQSUB (int *id, double *time, double *par, int *npar, int *iflag, double *results)
- Python Calling Syntax
-
def REQSUB(id, time, par, npar, iflag): return results
- MATLAB Calling Syntax
-
function results = REQSUB(id, time, par, npar, iflag)
Attributes
- ID
- [integer]
- TIME
- [double precision]
- PAR
- [double precision]
- NPAR
- [integer]
- IFLAG
- [logical]
Output
- RESULTS
- [double precision]
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