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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

each user-defined variable depends. <strong>Adams</strong>/<strong>Solver</strong> determines these functional dependencies at the<br />

beginning of the simulation by calling CFFSUB with the argument iflag set <strong>to</strong> true. <strong>Adams</strong>/<strong>Solver</strong> does<br />

this once for each CONTACT statement with a<br />

FRICTION_FUNCTION=USER() argument.<br />

During each call <strong>to</strong> CFFSUB, <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 that the CONTACT components depend on those <strong>Adams</strong>/<strong>Solver</strong> variables that<br />

are accessed through SYSARY and SYSFNC.<br />

Using the DFLAG Variable<br />

The use of the DFLAG variable is optional. Its purpose is <strong>to</strong> simply let you know that CFFSUB is being<br />

called <strong>to</strong> evaluate a partial derivative. One of the states on which the CFFSUB depends has been<br />

perturbed very slightly. In many situations, it is likely that major calculations in the CFFSUB are<br />

insensitive <strong>to</strong> small changes in state, and therefore, need not be recalculated. In such situations, you can<br />

structure the CFFSUB not <strong>to</strong> redo these calculations.<br />

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

values returned by CFFSUB may contain discontinuities. Discontinuities occur if there is<br />

an Euler singularity. To avoid the Euler singularity (and thus the discontinuities), use the<br />

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

other coordinate system that does not encounter a singularity.<br />

Fortran - Pro<strong>to</strong>type<br />

• If the calculations always use the same SYSARY and SYSFNC calls through the<br />

whole simulation, and you have no initialization <strong>to</strong> do, you do not need <strong>to</strong> check<br />

the flag argument at all. You can just call SYSARY and/or SYSFNC, compute the<br />

user-defined variable value, and return <strong>to</strong> <strong>Adams</strong>/<strong>Solver</strong> (FORTRAN)<br />

Caution: When the iflag argument is true:<br />

• You must make all the calls <strong>to</strong> SYSARY and SYSFNC as they are made <strong>to</strong><br />

compute the component values of the CONTACT statement. This ensures that<br />

<strong>Adams</strong>/<strong>Solver</strong> has the proper functional dependencies. In general, failure <strong>to</strong><br />

account for dependencies in the CONTACT statement components can make it<br />

difficult for <strong>Adams</strong>/<strong>Solver</strong> <strong>to</strong> converge <strong>to</strong> a solution and/or can force<br />

<strong>Adams</strong>/<strong>Solver</strong> <strong>to</strong> take small integration steps, potentially causing large increases in<br />

execution time.<br />

• SYSARY and SYSFNC return zero values for system and user-defined variables.<br />

When you use <strong>Adams</strong>/<strong>Solver</strong>, computations that divide by these values result in<br />

fatal errors. You should check for nonzero values, or ensure the iflag argument is<br />

set <strong>to</strong> false, before dividing by these values.<br />

A sample structure for CFFSUB is shown next. The comments explain how the subroutine works.<br />

131

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

Saved successfully!

Ooh no, something went wrong!