02.04.2013 Views

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

Welcome to Adams/Solver Subroutines - Kxcad.net

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

F(M 1 (q), M 2 (q), ..., M N (q))<br />

<strong>Welcome</strong> <strong>to</strong> <strong>Adams</strong>/<strong>Solver</strong> <strong>Subroutines</strong><br />

Because the user subroutine is effectively a black box, all that <strong>Adams</strong>/<strong>Solver</strong> knows about this function<br />

is that it depends on the measures, Mi, that you call through SYSFNC/SYSARY.<br />

During its analyses, <strong>Adams</strong>/<strong>Solver</strong> must construct a Jacobian matrix of the system of equations. For this<br />

purpose, <strong>Adams</strong>/<strong>Solver</strong> requires the partial derivatives, , of the function relative <strong>to</strong> the system-<br />

generalized coordinates, q.<br />

The FORTRAN 77 version of <strong>Adams</strong>/<strong>Solver</strong> approaches the problem of computing these partial<br />

derivatives in a direct manner, by altering the system states:<br />

∂ F<br />

-----<br />

∂ q<br />

F( qi + ∆)<br />

– F( qi) = -----------------------------------------<br />

∆<br />

We refer <strong>to</strong> this scheme as finite differencing or, more specifically, forward differencing. This approach<br />

has two main problems:<br />

• Some <strong>Adams</strong> elements, particularly the FLEX_BODY element, can have an extremely large<br />

number of generalized coordinates. Computing the partial derivatives in this way can be quite<br />

time consuming. Note that during finite differencing the user subroutine must be evaluated once<br />

for each state, qi, on which it depends.<br />

• You cannot assist <strong>Adams</strong>/<strong>Solver</strong> in the evaluation of the partial derivatives because you do not<br />

have direct access <strong>to</strong> the generalized coordinates, q, that <strong>Adams</strong> uses.<br />

To address these problems, the C++ version of <strong>Adams</strong>/<strong>Solver</strong> takes a different approach <strong>to</strong><br />

computing the partial derivatives. The C++ version applies the chain rule:<br />

∂ F<br />

-------<br />

∂ qi N<br />

∂ F<br />

-------<br />

∂ M<br />

∂ Mj = ∑ --------- =<br />

∂ qi j = 1<br />

N<br />

∑<br />

j = 1<br />

Note that in keeping with the observation that F is a black box, <strong>Adams</strong>/<strong>Solver</strong> continues <strong>to</strong> rely<br />

on finite differencing <strong>to</strong> compute , where Mj is well known and its partial derivatives can<br />

be evaluated analytically. This scheme solves both problems:<br />

• During finite differencing, the user subroutine only needs <strong>to</strong> be evaluated as many times as the<br />

<strong>to</strong>tal dimension of all the measures.<br />

For example, if F depends on the 3D TDISP measure of a marker on a FLEX_BODY, F must<br />

only be evaluated three times during finite differencing, even if the FLEX_BODY has 200<br />

modal generalized coordinates. This is a remarkable computational savings.<br />

∂ F<br />

-----<br />

∂ q<br />

F( Mj + ∆)<br />

– F( Mj) ----------------------------------------------<br />

∆<br />

∂ Mj ---------<br />

∂ qi ∂ F<br />

---------<br />

∂ Mj 111

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!