Kinematic Exports

Kinematic Variables and Functions

Every system is modeled by a set of generalized coordinates, q, and generalized speeds, p. The time derivatives of q are related to p through a derived set of kinematic transformations. If the coordinates, q, are not independent, they are related to each other through a set of position constraints.  Similarly, if the speeds, p, are dependent, their inter-relationships are defined by the velocity constraints, and their derivatives by the acceleration constraints. The table below summarizes these exported kinematic variables and functions.

 Expression Model Export Description Variables $q$ vQ Generalized coordinates selected by user (n x 1 column matrix) $p$ vP Generalized speeds selected by user (n x 1 column matrix) $[\begin{array}{c}p\\ q\end{array}]$ vX State variables, comprised of generalized speeds and coordinates (2n x 1 column matrix) $\frac{ⅆq}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}$ vQdot Time derivative of generalized coordinates $\frac{ⅆp}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}$ vPdot Time derivative of generalized speeds $[\begin{array}{c}\frac{ⅆp}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}\\ \frac{ⅆq}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}\end{array}]$ vXdot Time derivative of state variables Transformations $\frac{ⅆq}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}-h\left(p,q,t\right)=0$ GetKinTrans() Transformation between vQdot and vP (n x 1 column matrix) $h\left(p,q,t\right)$ vKinTransRHS Right-hand side of GetKinTrans() function Position Constraints $\mathrm{\Phi }\left(q,t\right)=0$ GetPosCons() Position-level kinematic constraint equations in terms of the n coordinates (m x 1 matrix) ${\mathrm{\Phi }}_{q}$ xJacPos Jacobian matrix of the position constraint equations with respect to the generalized coordinates (m x n matrix) Velocity Constraints $\mathrm{\Psi }\left(p,q,t\right)=0$ $={\mathrm{\Psi }}_{p}\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}p-c$ GetVelCons() Velocity-level kinematic constraint equations, which are nonlinear in the coordinates q and linear in the speeds p (m x 1 column matrix) ${\mathrm{\Psi }}_{p}$ xJacVel Jacobian matrix of the velocity constraint equations with respect to the generalized speeds (m x n matrix) $c$ vVelRHS Right-hand side of velocity-level kinematic constraint equations Acceleration Constraints $\mathrm{\chi }\left(\frac{ⅆp}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t},p,q,t\right)=0$ $={\mathrm{\Psi }}_{p}\frac{ⅆp}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}-e$ GetAccCons() Acceleration-level kinematic constraint equations, which are nonlinear in p and q,  and linear in accelerations (m x 1 column matrix) ${\mathrm{\chi }}_{\frac{ⅆp}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}}={\mathrm{\Psi }}_{p}={\mathrm{\Phi }}_{q}{h}_{p}$ xJacVel Jacobian matrix of the acceleration-level constraints is identical to that for velocity-level constraints, and equal to the product of ${\mathrm{\Phi }}_{q}$and ${h}_{p}$, where ${h}_{p}$is the partial derivative of h with respect to the speeds p $e\left(p,q,t\right)$ $=\frac{ⅆc}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}-\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}\frac{ⅆ{\mathrm{\Psi }}_{p}}{ⅆ\phantom{\rule[-0.0ex]{0.2em}{0.0ex}}t}p$ vAccRHS Right-hand side of acceleration-level kinematic constraint equations

GetFrameMotion Command

The GetFrameMotion command generates expressions for the translational or rotational motion of any moving frame in the system, in terms of the defined coordinates and speeds.  The general form of this command is:

> sModelName:="MB"

> MB:-GetFrameMotion(vector_type,end_frame,start_frame,ref_frame,[ListNumSubs]);

where the vector describes the motion of the end_frame relative to the start_frame (the default is the inertial frame), resolved in components along the ref_frame (default is the inertial frame).

The vector_type string may take one of the following values:

 • "r" - translational position vector
 • "v" - translational velocity vector
 • "vdot" - translational acceleration vector
 • "R" - rotation transformation matrix (gives orientation of end_frame relative to start_frame; the ref_frame string must be omitted when this 3x3 matrix is requested)
 • "w" - angular velocity vector
 • "wdot" - angular acceleration vector

Finally, the ListNumSubs list is used to enter numeric values for parameters that appear in the motion expressions in symbolic form. To determine which system parameters have not been assigned numerical values, use the GetParams command. The ListNumSubs list takes the general form [pd_1=value_1, pd_2=value_2, ...], where pd_i is the i_th parameter or driver and value_i is  the numeric parameter value or driving function of time.

A few examples will help to clarify these concepts.

> GetFrameMotion("v","CoM");

gives the three global X, Y, Z components of the translational velocity of the CoM frame relative to the inertial frame.

> GetFrameMotion("vdot","CoM","Base");

gives the three global X, Y, Z components of the translational acceleration of the CoM frame relative to the Base frame.

> Params:= [L1=1, L2=0.5]:

> GetFrameMotion("w","CoM","Base","Ref",Params);

gives the angular velocity of the CoM frame relative to the Base frame, resolved into x, y, and z components along the Ref frame.  Numerical values for L1 and L2 are stored in the Params list, and substituted into the symbolic expressions.

> GetFrameMotion("R","CoM","Base");

gives the 3x3 rotation matrix transformation from the Base frame to the CoM frame.  A complete description of rotation matrices is given in the section Building System Models / Bodies and Frames.

 GetNodeName Command The GetNodeName command collects the generated names for the system nodes.  In multibody modeling when connecting two distinctly named nodes, MapleSim arbitrarily picks one of the node names and uses that name for the connected node. The general form of this command is:   > MB:-GetNodeNames()   where   > sModelName:="MB"

 GetParams Command The GetParams command collects all of the system parameters the have not been assigned numerical values (symbols) in the system.  The general form of this command is:   > MB:-GetParams()   where   > sModelName:="MB"

Examples

The example below shows an embedded MapleSim model of a planar slider-crank mechanism.  In this example, the embedded component name is Simulation0, and the model name is SliderCrank.

 > $\mathrm{leArguments}≔\left['\mathrm{InputString}'=\mathrm{MapleSim}:-\mathrm{Multibody}:-\mathrm{GetMultibodyInput}\left("Simulation0"\right),'\mathrm{ModelName}'="SliderCrank",'\mathrm{KinSimpType}'="Simplify",'\mathrm{DynSimpType}'="Simplify",'\mathrm{AugType}'="Lagrange",'\mathrm{MaxSmallQOrder}'=1,'\mathrm{SaveToLib}'=\mathrm{false},'\mathrm{SilentMode}'=\mathrm{false}\right]:$$\mathrm{MapleSim}:-\mathrm{Multibody}:-\mathrm{BuildEQs}\left(\mathrm{op}\left(\mathrm{leArguments}\right)\right):$
 ${"Analyzing system..."}$
 ${"Performing constraint analysis..."}$
 ${"The system has 1 degree\left(s\right) of freedom. It is modeled using 3 generalized coordinate\left(s\right) coupled by 2 algebraic constraint\left(s\right)."}$
 ${"Peforming a dynamic analysis using an augmented Lagrange formulation - system variables shown below:"}$
 ${"vQ"}{,}\left[\begin{array}{c}{\mathrm{s_P2}}{}\left({t}\right)\\ {\mathrm{theta_R1}}{}\left({t}\right)\\ {\mathrm{theta_R5}}{}\left({t}\right)\end{array}\right]{,}{"vP"}{,}\left[\begin{array}{c}\frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{s_P2}}{}\left({t}\right)\\ \frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R1}}{}\left({t}\right)\\ \frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R5}}{}\left({t}\right)\end{array}\right]{,}{"vPdot"}{,}\left[\begin{array}{c}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}{}{\mathrm{s_P2}}{}\left({t}\right)\\ \frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}{}{\mathrm{theta_R1}}{}\left({t}\right)\\ \frac{{{ⅆ}}^{{2}}}{{ⅆ}{{t}}^{{2}}}{}{\mathrm{theta_R5}}{}\left({t}\right)\end{array}\right]{,}{"vLambda"}{,}\left[\begin{array}{c}{\mathrm{λ1}}{}\left({t}\right)\\ {\mathrm{λ2}}{}\left({t}\right)\end{array}\right]$
 ${"Dynamic analysis complete."}$ (1.5.1)
 > $\mathrm{SliderCrank}:-\mathrm{vX}$
 $\left[\begin{array}{c}\frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{s_P2}}{}\left({t}\right)\\ \frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R1}}{}\left({t}\right)\\ \frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R5}}{}\left({t}\right)\\ {\mathrm{s_P2}}{}\left({t}\right)\\ {\mathrm{theta_R1}}{}\left({t}\right)\\ {\mathrm{theta_R5}}{}\left({t}\right)\end{array}\right]$ (1.5.2)
 > $\mathrm{SliderCrank}:-\mathrm{GetPosCons}\left(\right)$
 $\left[\begin{array}{c}{-}{1.}{}{\mathrm{cos}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right){}{\mathrm{s_P2}}{}\left({t}\right){+}{0.5000000000}{}{\mathrm{cos}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right){}{\mathrm{cos}}{}\left({\mathrm{theta_R1}}{}\left({t}\right)\right){+}{0.5000000000}{}{\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right){}{\mathrm{sin}}{}\left({\mathrm{theta_R1}}{}\left({t}\right)\right){+}{1.}\\ {\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right){}{\mathrm{s_P2}}{}\left({t}\right){-}{0.5000000000}{}{\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right){}{\mathrm{cos}}{}\left({\mathrm{theta_R1}}{}\left({t}\right)\right){+}{0.5000000000}{}{\mathrm{cos}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right){}{\mathrm{sin}}{}\left({\mathrm{theta_R1}}{}\left({t}\right)\right)\end{array}\right]$ (1.5.3)
 > $\mathrm{SliderCrank}:-\mathrm{GetFrameMotion}\left("v","R6_frame_b","GROUND","GROUND"\right)$
 $\left[\begin{array}{c}{-}{0.5000000000}{}\left(\frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R1}}{}\left({t}\right)\right){}{\mathrm{sin}}{}\left({\mathrm{theta_R1}}{}\left({t}\right)\right)\\ {0.5000000000}{}\left(\frac{{ⅆ}}{{ⅆ}{t}}{}{\mathrm{theta_R1}}{}\left({t}\right)\right){}{\mathrm{cos}}{}\left({\mathrm{theta_R1}}{}\left({t}\right)\right)\\ {0.}\end{array}\right]$ (1.5.4)
 > $\mathrm{SliderCrank}:-\mathrm{GetFrameMotion}\left("R","R6_frame_b","GROUND","GROUND"\right)$
 $\left[\begin{array}{ccc}{\mathrm{cos}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)& {\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)& {0}\\ {-}{\mathrm{sin}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)& {\mathrm{cos}}{}\left({\mathrm{theta_R5}}{}\left({t}\right)\right)& {0}\\ {0}& {0}& {1}\end{array}\right]$ (1.5.5)