Welcome to Adams/Solver Subroutines - Kxcad.net
Welcome to Adams/Solver Subroutines - Kxcad.net
Welcome to Adams/Solver Subroutines - Kxcad.net
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
174<br />
<strong>Adams</strong>/<strong>Solver</strong><br />
Use<br />
Corresponding Statement<br />
GSE_DERIV<br />
Calling Sequence and Structure<br />
SUBROUTINE GSE_DERIV (ID, TIME, PAR, NPAR, DFLAG, IFLAG, NS, XDOT)<br />
Input Arguments<br />
id An integer variable containing the ID of the GSE statement requesting<br />
information from the GSE subroutine. From the identifier, <strong>Adams</strong>/<strong>Solver</strong><br />
au<strong>to</strong>matically recognizes other information (such as the PAR argument)<br />
that is associated with that GSE statement.<br />
time A double-precision variable containing the current simulation time.<br />
par A double-precision array containing the constant parameters taken in<br />
order from the USER parenthetical list in the GSE statement.<br />
npar An integer variable containing the number of constants in the<br />
Function=USER(...) parenthetical list in the GSE statement. The primary<br />
purpose is <strong>to</strong> provide the subroutine with the number of entries in the par<br />
array.<br />
dflag A logical variable that is set <strong>to</strong> true when <strong>Adams</strong>/<strong>Solver</strong> calls the<br />
subroutine <strong>to</strong> obtain partial derivatives of the function fc().<br />
iflag A logical variable that is set <strong>to</strong> true when <strong>Adams</strong>/<strong>Solver</strong> calls the<br />
subroutine during the code initialization pass. For other evaluation<br />
subroutines, the flag is used when <strong>Adams</strong>/<strong>Solver</strong> needs functional<br />
dependency information and normally controls calls <strong>to</strong> the SYSFNC and<br />
SYSARY utility subroutines. You can use the IFLAG argument <strong>to</strong> control<br />
any other initialization you might need <strong>to</strong> do in the GSE evaluation<br />
subroutine.<br />
ns An integer variable containing the number of continuous states in the<br />
GSE; taken from the NS argument <strong>to</strong> the GSE statement.<br />
Output Arguments<br />
xdot A double-precision array of dimension NS, containing the derivatives of<br />
the state Xc.<br />
Examples<br />
For an example of this subroutine, see gse_deriv.f