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

C+----------------------------------------------------*<br />

C<br />

Evaluation pass: Define the second partial<br />

C<br />

derivatives of the coupler constraint<br />

C+----------------------------------------------------*<br />

C<br />

...<br />

...<br />

DFDA2(1) = ...<br />

DFDA2(2) = ...<br />

...<br />

...<br />

C<br />

ENDIF<br />

C<br />

C<br />

RETURN<br />

END<br />

C Style - Pro<strong>to</strong>type<br />

typedef void adams_c_COUSUB(const struct s<strong>Adams</strong>Coupler* coupler,<br />

double TIME, double*, int IFLAG, double* PHI);<br />

typedef void adams_c_COUXX(const struct s<strong>Adams</strong>Coupler* coupler,<br />

double TIME, double*, int IFLAG, double* dFda);<br />

typedef void adams_c_COUXX2(const struct s<strong>Adams</strong>Coupler* coupler,<br />

double TIME, double*, int IFLAG, double* d2Fda2);<br />

/*<br />

* COUPLER -------------------------------------------------<br />

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

*/<br />

struct s<strong>Adams</strong>Coupler<br />

{<br />

int ID;<br />

int NPAR;<br />

const double* PAR;<br />

int NJOINT;<br />

int JOINTS[3];<br />

char TYPE[3];<br />

};<br />

Examples<br />

The mechanical system shown in Figure 1 consists of three rigid bodies and two joints; the first is a<br />

revolute joint and the second translational. The translational joint represents an actua<strong>to</strong>r whose output<br />

displacement controls the angular motion in the revolute joint.<br />

Let the displacement in the translational joint be defined as and the rotation in revolute joint as a.<br />

147

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

Saved successfully!

Ooh no, something went wrong!