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 />

INTEGER IORD<br />

LOGICAL IFLAG<br />

DOUBLE PRECISION VALUE<br />

C<br />

C ID Identifier of calling MOTION statement<br />

C TIME Current time<br />

C PAR Array containing passed parameters<br />

C NPAR Number of passed parameters<br />

C IORD Derivative order of value <strong>to</strong> be returned<br />

C IFLAG Initialization pass flag<br />

C VALUE Derivative value of MOTION returned <strong>to</strong> ADAMS<br />

C<br />

C - Local variable and parameter definitions ----<br />

C<br />

...<br />

C<br />

C === Executable code =================================<br />

C<br />

C Assign parameters <strong>to</strong> readable variable names<br />

C<br />

...<br />

C<br />

IF ( IFLAG ) THEN<br />

C<br />

C - Subroutine initialization -----------<br />

C<br />

...<br />

C<br />

ENDIF<br />

C<br />

C - Compute and assign the motion displacement ---<br />

C<br />

IF ( IORD .EQ. 0 ) THEN<br />

C<br />

C Your algorithm<br />

C<br />

...<br />

C<br />

C Assign a value <strong>to</strong> VALUE for the motion displacement<br />

C<br />

VALUE = ...<br />

C<br />

C - Compute and assign the motion velocity -----<br />

C<br />

ELSE IF ( IORD .EQ. 1 ) THEN<br />

C<br />

C Your algorithm<br />

C<br />

...<br />

C<br />

C Assign a value <strong>to</strong> VALUE for the motion velocity<br />

C<br />

VALUE = ...<br />

C<br />

187

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

Saved successfully!

Ooh no, something went wrong!