Dynamics

Dynamics of mechanical systems

Dynamical Systems

Many systems in engineering can be modeled using the differential equation, known as the state equation.

x˙=f(t,x,u)\dot{x}=f(t,x,u)
SymbolDescriptionDimension
ttTime1×11 \times 1
xxStaten×1n \times 1
uuInputm×1m \times 1

The output vector y is given by:

y=h(t,x,u)y = h(t,x,u)

which comprises of variables of particular interest in the analysis of the dynamical system.

There exists variations of the state equation:

VariationEquationDescription
Unforcedx˙=f(t,x)\dot{x}=f(t,x)No inputs
Autonomousx˙=f(x)\dot{x}=f(x)No inputs or time dependence

Linear Mechanical Systems

Simple mechanical systems can be expressed as linear systems, where the state equation takes the very simple and special form

x˙=Ax+Buy=Cx\begin{aligned} \dot{x}=Ax + Bu \\ y=Cx \end{aligned}
SymbolDescriptionDimension
xxStatenx×1n_x \times 1
uuInputnu×1n_u \times 1
yyOutputny×1n_y \times 1
AAState transition matrixnx×nxn_x \times n_x
BBInput mapping matrixnx×mn_x \times m
CCOutput mapping matrixny×nxn_y \times n_x

Non-linear Mechanical Systems

Lagrangian Dynamics

Lagrangian dynamics describe mechanical systems in terms of generalized coordinates and their derivatives

M(q)q¨+C(q,q˙)q˙+D(q,q˙)q˙+g(q)=G(q)u+J(q)λM(q)\ddot{q} + C(q,\dot{q})\dot{q} +D(q,\dot{q})\dot{q} +g(q) = G(q)u +J(q)\lambda

or in state representation

x˙=[q˙q¨]=[q˙M1(q)[G(q)u+J(q)λC(q,q˙)q˙D(q,q˙)q˙g(q)]]\dot{x} = \begin{bmatrix} \dot{q} \\ \ddot{q} \end{bmatrix} =\left[\begin{array}{c} \dot{q} \\ M^{-1}(q)\left[G(q)u + J(q)\lambda - C(q, \dot{q})\dot{q} - D(q, \dot{q})\dot{q} - g(q)\right] \end{array}\right]
SymbolDescriptionDimensionProperties
qqGeneralized coordinatesnq×1n_q \times 1
q˙\dot{q}Generalized velocitynq×1n_q \times 1
q¨\ddot{q}Generalized accelerationnq×1n_q \times 1
xxStatenx×1n_x \times 1x=[q;q˙]x = [q; \dot{q}], nx=2×nqn_x = 2 \times n_q
uuInputsnq×1n_q \times 1
yyOutputsnq×1n_q \times 1
M(q)M(q)Mass matrixnq×nqn_q \times n_qorthogonal
C(q,q˙)C(q,\dot{q})Coriolis matrixnq×nqn_q \times n_q
D(q,q˙)D(q,\dot{q})Damping matrixnq×nqn_q \times n_q
g(q)g(q)Gravitational termsnq×1n_q \times 1
G(q)G(q)Input mapping matrixnq×nun_q \times n_u
Jc(q)J_c(q)Constraint jacobiannq×ncn_q \times n_c
λ\lambdaExternal forcesnc×1n_c \times 1

port-Hamiltonian Dynamics

port-Hamiltonian (pH) dynamics describe mechanical systems in terms of generalized coordinates and generalized momenta

x˙=[q˙p˙]=[0nq×nqInqInqD(q,p)][qHpH]+[0nq×nu0nq×ncG(q)J(q)][uλ]H(q,p)=12pM1(q)p+V(q)\begin{aligned} &\dot{x} = \begin{bmatrix} \dot{q} \\ \dot{p} \end{bmatrix} = \begin{bmatrix} 0_{n_q \times n_q} & I_{n_q} \\ -I_{n_q} & -D(q,p) \end{bmatrix} \begin{bmatrix} \nabla_qH\\\nabla_pH\end{bmatrix} + \begin{bmatrix} 0_{n_q\times{n_u}} & 0_{n_q\times{n_c}} \\ G(q) & J(q) \end{bmatrix}\begin{bmatrix} u \\ \lambda \end{bmatrix} \\ &{H}(q, p)=\frac{1}{2} p^{\top} M^{-1}(q) p+V(q) \end{aligned}
SymbolDescriptionDimensionProperties
qqGeneralized coordinatesnq×1n_q \times 1
ppGeneralized momentumnq×1n_q \times 1
xxStatenx×1n_x \times 1x=[q;p]x = [q;p]
uuInputsnu×1n_u \times 1
yyOutputsny×1n_y \times 1
H(x)H(x)Hamiltonian (total system energy)1×11 \times 1
G(q)G(q)Input mapping matrixnq×nun_q \times n_u
D(q,p)D(q,p)Damping matrixnq×nqn_q \times n_q
λ\lambdaExternal forces actingnc×1n_c \times 1
Jc(q)J_c(q)Constraint jacobiannq×ncn_q \times n_c

Coordinate Transformations

Consider a mechanical pH system subject to physical damping, and no external constraints, under the coordinate transformation

(q,p)=f(q,p):=(fq(q),QT(q)p)\mathbf{(q,p)} = \mathbf{f}(q,p) := (f_q(q),Q^T(q)p)

where fq:RnqRnqf_q : \mathbb{R}^{n_q} \rightarrow \mathbb{R}^{n_q} is invertible and differentiable and Q0(q)Rnq×nqQ_0(q) \in \mathbb{R}^{n_q\times n_q} is full-rank for all qq.

The pH system can be equivalently expressed as

[q˙p˙]=[0nq×nqQ(q)Q(q)C(q,p)D(q,p)][qHpH]+[0G(q)]u\begin{bmatrix}\mathbf{\dot{q}} \\ \mathbf{\dot{p} }\end{bmatrix} = \begin{bmatrix} 0_{n_q \times n_q} & \mathbf{Q}(q) \\ -\mathbf{Q}^\top(q) & \mathbf{C}(q,p)-\mathbf{D}(q,p) \end{bmatrix} \begin{bmatrix} \nabla_qH\\\nabla_pH\end{bmatrix} + \begin{bmatrix} 0 \\ G(q) \end{bmatrix}u

where

Q(q)=q(fq)Q0q=fq1(q)D(q,p)=Q0DQ0q=fq1(q)C(q,p)=Q0(q){q[Q0(q)p]q[Q0(q)p]}Q0(q)q=fq1(q)M(q)=Q0(q)M(q)Q0(q)q=fq1(q)G(q)=Q0(q)Gp(q)q=fq1(q)V(q)=V(q)q=fq1(q).\begin{aligned} \mathbf{Q}(\mathbf{q}) & =\left.\frac{\partial}{\partial q}\left(f_{\mathbf{q}}\right) Q_0\right|_{q=f_{\mathbf{q}}^{-1}(\mathbf{q})} \\ \mathbf{D}(\mathbf{q}, \mathbf{p}) & =\left.Q_0^{\top} D Q_0\right|_{q=f_{\mathbf{q}}^{-1}(\mathbf{q})} \\ \mathbf{C}(\mathbf{q}, \mathbf{p}) & =\left.Q_0^{\top}(q)\left\{\frac{\partial^{\top}}{\partial q}\left[Q_0^{-\top}(q) \mathbf{p}\right]-\frac{\partial}{\partial q}\left[Q_0^{-\top}(q) \mathbf{p}\right]\right\} Q_0(q)\right|_{q=f_{\mathbf{q}}^{-1}(\mathbf{q})} \\ \mathbf{M}(\mathbf{q}) & =\left.Q_0^{\top}(q) M(q) Q_0(q)\right|_{q=f_{\mathbf{q}}^{-1}(\mathbf{q})} \\ \mathbf{G}(\mathbf{q}) & =\left.Q_0^{\top}(q) G_p(q)\right|_{q=f_{\mathbf{q}}^{-1}(\mathbf{q})} \\ \mathbf{V}(\mathbf{q}) & =\left.V(q)\right|_{q=f_{\mathbf{q}}^{-1}(\mathbf{q})} . \end{aligned}

Constraints

Holonomic constraints are expressed as a static relationship between configuration variables expressed as

fc(q)=0nc×1f_c(q) = 0_{n_c\times1}

Nonholomic constraints are expressed as a non-integrable, linear combination of generalised velocities. An important class are called nonholonomic Pfaffian constraints

Jc(q)q˙=0nc×1,J_c^{\top}(q) \dot{q}=0_{n_c \times 1},

Note Holonomic constraints can also be expressed as Pfaffian constraints by simply taking the time derivative

Eliminating holonomic constraints (pH)

Holonomic constraints can be eliminated from the dynamics equations of motion via the appropriate selection of generalised coordinates.

Consider the mechanical pH system with q=col(q^,q),q^Rnqncq=\operatorname{col}(\hat{q}, \mathfrak{q}), \hat{q} \in \mathbb{R}^{n_q-n_c} and qRnc\mathfrak{q} \in \mathbb{R}^{n_c}, subject to the holonomic constraint

q=fc(q^).\mathfrak{q}=f_c(\hat{q}) .

The system can be written in the constraint-free form

[q^˙p^˙]=[0(nqnc)×(nqnc)InqncInqncD^(q^,p^)][q^H^p^H^]+[0(nqnc)×nuG^(q^)]uy=G^(q^)p^H^H^(q^,p^)=12p^M^1(q^)p^+V^(q^),\begin{aligned} {\left[\begin{array}{c} \dot{\hat{q}} \\ \dot{\hat{p}} \end{array}\right] } & =\left[\begin{array}{cc} 0_{\left(n_q-n_c\right) \times\left(n_q-n_c\right)} & I_{n_q-n_c} \\ -I_{n_q-n_c} & -\hat{D}(\hat{q}, \hat{p}) \end{array}\right]\left[\begin{array}{c} \nabla_{\hat{q}} \hat{H} \\ \nabla_{\hat{p}} \hat{H} \end{array}\right]+\left[\begin{array}{c} 0_{\left(n_q-n_c\right) \times n_u} \\ \hat{G}(\hat{q}) \end{array}\right] u \\ y & =\hat{G}^{\top}(\hat{q}) \nabla_{\hat{p}} \hat{H} \\ \hat{H}(\hat{q}, \hat{p}) & =\frac{1}{2} \hat{p}^{\top} \hat{M}^{-1}(\hat{q}) \hat{p}+\hat{V}(\hat{q}), \end{aligned}

where

p^(q^,p)=[Inqncfcq^]pq=fc(q^)M^(q^)=[Inqncfcq^]Mq=fc(q^)[Inqncfcq^]D^(q^,p^)=[Inqncfcq^]Dq=fc(q^)[Inqncfcq^]G^(q^)=[Inqncfcq^]Gpq=fc(q^).\begin{aligned} \hat{p}(\hat{q}, p) & =\left.\left[\begin{array}{ll} I_{n_q-n_c} & \frac{\partial^{\top} f_c}{\partial \hat{q}} \end{array}\right] p\right|_{\mathfrak{q}=f_c(\hat{q})} \\ \hat{M}(\hat{q}) & =\left.\left[\begin{array}{ll} I_{n_q-n_c} & \frac{\partial^{\top} f_c}{\partial \hat{q}} \end{array}\right] M\right|_{\mathfrak{q}=f_c(\hat{q})}\left[\begin{array}{c} I_{n_q-n_c} \\ \frac{\partial f_c}{\partial \hat{q}} \end{array}\right] \\ \hat{D}(\hat{q}, \hat{p}) & =\left.\left[\begin{array}{ll} I_{n_q-n_c} & \frac{\partial^{\top} f_c}{\partial \hat{q}} \end{array}\right] D\right|_{\mathfrak{q}=f_c(\hat{q})}\left[\begin{array}{c} I_{n_q-n_c} \\ \frac{\partial f_c}{\partial \hat{q}} \end{array}\right] \\ \hat{G}(\hat{q}) & =\left.\left[\begin{array}{ll} I_{n_q-n_c} & \frac{\partial^{\top} f_c}{\partial \hat{q}} \end{array}\right] G_p\right|_{\mathfrak{q}=f_c(\hat{q})} . \end{aligned}

Eliminating nonholonomic constraints (pH)

Nonholonomic constraints can be elimiated from a pH mechanical system by applying the momentum transform

p~=[μspr]=[Jc(q)Jc(q)]:=Q(q)p0\tilde{p}=\left[\begin{array}{c} \mu_s \\ p_r \end{array}\right]=\underbrace{\left[\begin{array}{c} J_c^{\top}(q) \\ J_c^{\perp}(q) \end{array}\right]}_{:=Q(q)} p_0

obtaining reduced-order model

[q˙p˙s]=[0nJc(q)Jc(q)Cs(pr,q)][qHrprHr]+[0n×mGs(q)]uHr(pr,q)=12prMs1(q)pr+V(q),\begin{aligned} \begin{bmatrix} \dot{q} \\ \dot{p}_s \end{bmatrix} =& \left[\begin{array}{cc} 0_n & J_c^{\perp\top}(q) \\ -J_c^{\perp}(q)& C_s(p_r, q) \end{array}\right] \left[\begin{array}{c} \nabla_q H_r \\ \nabla_{p_r} H_r \end{array}\right] + \left[\begin{array}{c} 0_{n \times m} \\ G_s(q) \end{array}\right] u\\ &H_r(p_r, q) =\frac{1}{2} p_r^{\top} M_s^{-1}(q) p_r+\mathcal{V}(q), \end{aligned}

where

Gs(q)=Jc(q)G0(q)Cs(pr,q)=Jc(q){q[M0(q)Jc(q)Ms1(q)pr]q[M0(q)Jc(q)Ms1(q)pr]}Jc(q)Jc(q)D0(q,p0)Jc(q)Ms(q)=Jc(q)M0(q)Jc(q)\begin{aligned} G_s(q) & =J_c^{\perp}(q) G_0(q)\\ C_s(p_r, q) & =J_c^{\perp}(q)\left\{\frac{\partial^{\top}}{\partial q}\left[M_0(q) J_c^{\perp\top}(q)M_s^{-1}(q) p_r\right]\right. \\ & \left.\quad-\frac{\partial}{\partial q}\left[M_0(q) J_c^{\perp\top}(q) M_s^{-1}(q) p_r\right]\right\} J_c^{\perp\top}(q) \\&- J_c^{\perp}(q) D_0\left(q, p_0\right) J_c^{\perp\top}(q) \\ M_s(q) & =J_c^{\perp}(q) M_0(q) J_c^{\perp\top}(q) \end{aligned}

Note Generalized momentum vector pp can be recovered by the expression

p=M0(q)Jc(q)Ms1(q)pr.p = M_0(q)J_c^{\perp\top}(q)M_s^{-1}(q)p_r.

Eliminating nonholonomic constraints (Lagrangian)

Let us begin with the widely used Lagrange-d'Alembert equations

ddt(Lq˙)T(Lq)T=Fext +Jcλ,\frac{\mathrm{d}}{\mathrm{d} t}\left(\frac{\partial L}{\partial \dot{{q}}}\right)^{\mathrm{T}}-\left(\frac{\partial L}{\partial {q}}\right)^{\mathrm{T}}={F}_{\text {ext }}+ J_c{\lambda},

which describe the dynamics of systems subject to kk nonholonomic (Pfaffian) constraints of the form

Jcq˙=0.J_c^\top \dot{{q}}={0} .

The matrix form of is given as

M(q)q¨+C(q)q˙+g(q)=G(q)u+Jcλ{M}(q) \ddot{{q}}+{C}(q) \dot{{q}}+g(q)=G(q)u+ J_c\lambda

Due to the nonholonomic constraints, the admissible velocitie must be of the form

q˙=Sq˙r \dot{q} = S\dot{q}_r
Mqr˙+Cqr+STqV=τ+Jqr{M} \dot{q_r}+{C} q_r+{S}^{\mathrm{T}} \nabla_{{q}} V=\boldsymbol{\tau}+{J} q_r