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.
112<br />
<strong>Adams</strong>/<strong>Solver</strong><br />
Note that the computational savings are not always so generous. Consider a function F that<br />
depends on the two 6D measures, DISP and VEL, of a single PART marker, with respect <strong>to</strong><br />
ground. During finite differencing, F must be evaluated 12 times, once for each dimension of<br />
each measure. Meanwhile, the function only depends on the 12 generalized displacements and<br />
velocities of the PART, so the<br />
FORTRAN 77 <strong>Adams</strong>/<strong>Solver</strong> would also only have needed 12 evaluations of F.<br />
• Because you are aware of the functional dependency of the function, F, on the measured<br />
∂ F<br />
---------<br />
∂ Mj quantities, Mi, computing may be straightforward. <strong>Adams</strong>/<strong>Solver</strong> (C++) provides<br />
SYSPAR: an interface you can use <strong>to</strong> register these partial derivatives, in the cases where they<br />
are known and can be efficiently computed.<br />
Note that the potential of user-provided partial derivatives does not only affect the computational<br />
cost of evaluating the system Jacobian, but can also improve the accuracy of simulations and the<br />
rate of convergence. This is because your analytical derivatives are likely <strong>to</strong> be more accurate<br />
than those obtained using finite differencing. When <strong>Adams</strong>/<strong>Solver</strong> uses the Jacobian directly, as<br />
in <strong>Adams</strong>/Linear, the quality of the solution may also be improved.<br />
When F and M have dimension greater than 1, the partial matrix, should be s<strong>to</strong>red in partl<br />
in FORTRAN 77 style column order. In other words, all the partial derivatives of F with respect<br />
<strong>to</strong> the first component of M come before the partial derivatives of F with respect <strong>to</strong> the second<br />
component of M, and so on.<br />
Each call <strong>to</strong> SYSFNC/SYSARY creates what the previous section refers <strong>to</strong> as a measure. For<br />
each of these measures, the crea<strong>to</strong>r of the user subroutine is allowed <strong>to</strong> register the partials of the<br />
function with respect <strong>to</strong> this measure.<br />
You do not need partial derivatives during every call <strong>to</strong> the user's subroutine, because they are<br />
only needed when the Jacobian is being evaluated. You must request the flag that indicates<br />
whether the partial derivatives are required, by calling the following function:<br />
CALL ADAMS_NEEDS_PARTIALS(PARFLG)<br />
∂ F<br />
---------<br />
∂ Mj Note that, ideally, the PARFLG would have been added <strong>to</strong> the user subroutine call, alongside<br />
IFLAG and DFLAG, but the user subroutines have a standard interface that cannot be changed.