Welcome to Adams/Solver Subroutines - Kxcad.net
Welcome to Adams/Solver Subroutines - Kxcad.net
Welcome to Adams/Solver Subroutines - Kxcad.net
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
202<br />
<strong>Adams</strong>/<strong>Solver</strong><br />
Input Arguments<br />
id An integer variable that contains the ID of the SFORCE statement that<br />
requests information from SFOSUB. From the identifier, <strong>Adams</strong>/<strong>Solver</strong><br />
au<strong>to</strong>matically knows other information (such as the par argument)<br />
available in the corresponding statement.<br />
time A double-precision variable through which <strong>Adams</strong>/<strong>Solver</strong> conveys the<br />
current simulation time.<br />
par A double-precision array of constants taken in order from the USER<br />
parenthetical list of the SFORCE statement.<br />
dflag A logical variable that <strong>Adams</strong>/<strong>Solver</strong> sets <strong>to</strong> true when it calls SFOSUB<br />
<strong>to</strong> evaluate partial derivatives of the function. Otherwise, <strong>Adams</strong>/<strong>Solver</strong><br />
sets dflag <strong>to</strong> false. See Using the DFLAG Variable.<br />
npar An integer variable that indicates the number of constants specified in the<br />
USER parenthetical list. The primary purpose of npar is <strong>to</strong> provide<br />
SFOSUB with the number of values s<strong>to</strong>red in the par array.<br />
iflag A logical variable that <strong>Adams</strong>/<strong>Solver</strong> sets <strong>to</strong> true when it needs the<br />
functional dependency of the user-defined SFORCE. Set functional<br />
dependencies by making the same calls <strong>to</strong> SYSARY and SYSFNC that<br />
you make <strong>to</strong> compute the value of the user-defined SFORCE (see<br />
SYSARY and SYSFNC). If the iflag argument is false, compute the value<br />
of the user-written SFORCE.<br />
Output Argument<br />
value A double-precision variable that contains the force value that SFOSUB<br />
computes.<br />
Extended Definition<br />
The SFORCE statement (C++ or FORTRAN) with a function expression is usually adequate for defining<br />
most single-component forces. If the expression becomes lengthy and awkward, however, you should use<br />
the FUNCTION=USER() argument in the SFORCE statement, and write an SFOSUB <strong>to</strong> calculate the<br />
single-component force.<br />
You can call utility subroutines, such as SYSARY, SYSFNC, AKISPL, and CUBSPL, from SFOSUB <strong>to</strong><br />
obtain information about system variables, user-defined variables, and splines.<br />
The SYSARY and SYSFNC utility subroutines au<strong>to</strong>matically set functional dependencies when the<br />
SFOSUB argument iflag is true. For <strong>Adams</strong>/<strong>Solver</strong> <strong>to</strong> compute solutions efficiently, it must know<br />
on which other variables each user-defined SFORCE directly depends. <strong>Adams</strong>/<strong>Solver</strong> determines these<br />
functional dependencies at the beginning of the simulation by calling SFOSUB evaluation subroutine<br />
with argument iflag set <strong>to</strong> true. <strong>Adams</strong>/<strong>Solver</strong> does this once for each SFORCE statement with a<br />
FUNCTION=USER() argument. During each call <strong>to</strong> SFOSUB, <strong>Adams</strong>/<strong>Solver</strong> records which calls you