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.

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

You can call utility subroutines, such as AKISPL, CUBSPL, SYSARY, and SYSFNC, from VARSUB,<br />

<strong>to</strong> obtain information about system variables, user-defined variables, and splines (see AKISPL,<br />

CUBSPL, SYSARY, and SYSFNC).<br />

The SYSARY and SYSFNC utility subroutines au<strong>to</strong>matically set functional dependencies when the<br />

VARSUB argument iflag is true. To compute solutions efficiently, <strong>Adams</strong>/<strong>Solver</strong> must know the other<br />

variables on which each user-defined variable depends. <strong>Adams</strong>/<strong>Solver</strong> determines these functional<br />

dependencies at the beginning of the simulation by calling VARSUB with the argument iflag set <strong>to</strong> true.<br />

<strong>Adams</strong>/<strong>Solver</strong> does this once for each VARIABLE statement with a FUNCTION=USER() argument.<br />

During each call <strong>to</strong> VARSUB, <strong>Adams</strong>/<strong>Solver</strong> records which calls you make <strong>to</strong> SYSARY and SYSFNC.<br />

<strong>Adams</strong>/<strong>Solver</strong> assumes the user-defined variable depends on those system and user-defined variables,<br />

and no others.<br />

Tip: If the SYSARY or SYSFNC utility subroutines are called <strong>to</strong> access angular displacements,<br />

the values returned by them may contain discontinuities. To avoid the discontinuities, use<br />

the RCNVRT utility subroutine <strong>to</strong> convert the rotational angles from Euler angles <strong>to</strong> some<br />

other rotational representation that does not encounter a singularity.<br />

Caution: • When the iflag argument is true, you should make the same calls <strong>to</strong> SYSARY and<br />

SYSFNC as you do <strong>to</strong> compute the value of the user-defined VARIABLE<br />

statement. This ensures that <strong>Adams</strong>/<strong>Solver</strong> has the proper functional dependencies.<br />

In general, <strong>Adams</strong>/<strong>Solver</strong> may have difficulty converging <strong>to</strong> a solution and/or may<br />

take small integration steps if you fail <strong>to</strong> account for dependencies of the userdefined<br />

VARIABLE statement. These results usually cause large increases in<br />

execution time.<br />

• When the iflag argument is true, SYSARY and SYSFNC return zero values for<br />

system and user-defined variables. Computations that divide these values result in<br />

system errors when you execute <strong>Adams</strong>/<strong>Solver</strong>. You should check for nonzero<br />

values or ensure that the iflag argument is set <strong>to</strong> false before dividing by these<br />

values.<br />

• You must be careful when defining a VARIABLE statement dependent on another<br />

VARIABLE statement, or on other <strong>Adams</strong>/<strong>Solver</strong> statements that contain<br />

functions. If you define a system of equations without a stable solution, the<br />

convergence may fail for the entire <strong>Adams</strong>/<strong>Solver</strong> model. The following example<br />

refers <strong>to</strong> this type of VARIABLE statement:<br />

VARIABLE/1,FUNCTION=VARVAL(1)+1<br />

When looked at as an algebraic equation, it looks like the following:<br />

V=V+1<br />

However, when <strong>Adams</strong>/<strong>Solver</strong> tries <strong>to</strong> solve this equation using the New<strong>to</strong>n-Raphson<br />

iteration, the solution diverges and a message indicates that the correc<strong>to</strong>r has failed <strong>to</strong><br />

converge.<br />

227

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

Saved successfully!

Ooh no, something went wrong!