>[!quote] In a Nutshell >Fundamental model used in #Dynamics , #Control and more specifically #Robotics. Mathematically, the following are special cases of ... >- [[ODEs - Ordinary Differential Equations]] >- [[PDEs - Partial Differential Equations]] >- [[SDE - Stochastic Differential Equation]] For a very important special case, see **[[LTI - Linear Time Invariant Systems]]**. --- #### As Systems of ODEs >[!info] Dynamic System >Mathematical description of a [[Static, Dynamic and Stochastic Systems|system]] whose values vary over time $t$ based on an [[ODEs - Ordinary Differential Equations|ordinary differential equation]] relating [[- Control Overview -|control]] inputs $\mathbf{u}$ and the system state via a functional$\boldsymbol{0} = \mathbf{F}\left(t,\mathbf{u}(t),\mathbf{y}(t),\mathbf{y}'(t),\ldots, \mathbf{y}^{(n)}(t) \right).$ >[!info] Static System Special case, in which the differential equation is of order $0$, the relationship is purely algebraic and therefore memoryless$\boldsymbol{0}=\mathbf{G}\left(t,\mathbf{u}(t),\mathbf{y}(t)\right).$ >[!brainwaves] From ODEs to physical Laws >In basically every application, the system is not dependent on the independent variable $t$, as a basic property of a physical law is time invariance. --- #### Mathematical Perspective - From Continuous to Discrete to Stochastic >[!info] Continuous Time Dynamical System >We consider a [[Maps and Induced Structures - Functions, Pushforwards and Pullbacks|function]] $f \in C^{1}(\mathbb{R}^{\ell}, \mathbb{R}^{\ell})$ with an [[ODEs - Ordinary Differential Equations|ODE]] $\frac{\partial v}{\partial t}=f(v), \qquad v(0)=u.$If a solution exists for all $u \in \mathbb{R}^{\ell}$ and $t \in \mathbb{R}^{+}$, this solution is element of the space $C^{1}(\mathbb{R}^{+}, \mathbb{R}^{\ell})$ for any given $u$. We say that the ODE generates a **continuous-time dynamical system**. If the solution exists, there is a **one-parameter semi-[[Group|group]] of operators** $\Psi(\cdot;t)$ parameterized by time, with the properties that - For a given $u$, the operator yields the solution at any time $v(t)=\Psi(u;t), \quad t \in (0, \infty).$ - The solution operator can be used recursively $\Psi(u;t+s)=\Psi(\Psi(u;s);t), \quad t,s \in \mathbb{R}^{+}, u \in \mathbb{R}^{\ell}.$ - For $t=0$, the operator always yields the given initial condition $\Psi(u;0)=u \in \mathbb{R}^{\ell}.$ To link this continuous ODE setting to the discrete time setting encountered in e.g. [[Data Assimilation Problem]], we can use the iterated map defined by $\Psi(\cdot)=\Psi(\cdot, h)$ with $h>0$ being the time-step. >[!info] (Gaussian) Stochastic Dynamical System >We consider the **stochastic dynamical system** by adding a Gaussian noise term $v_{j+1}=\Psi(v_j)+\xi_j,\quad j \in \mathbb{Z}^{+}, \quad v_0 \sim \mathcal{N}(m_0,C_0),$via an [[Statistical Independence|i.i.d.]] sequence $\xi=\{ \xi_j\}_{j \in \mathbb{Z}^{+}}$ [[Probability Distribution|distributed]] according to a [[Measure|probability measure]] on $\mathbb{R}^{\ell}$ with density $\rho$. The initial condition $v_0$ is independent of $\xi$, but possibly random. This is the setting used in the #Data-Assimilation lecture. For a more general concept, see [[SDE - Stochastic Differential Equation]] and [[Stochastic Processes]]. --- #### State Space Models A formulation that often serves as a starting point in #Control is based on the [[ODEs - Ordinary Differential Equations|reformulation to a first order system]] in form of a continuous or discrete time-invariant state space model. >[!info] Nonlinear, Time-Invariant, Continuous-Time State Space Models >One of the most general classes (time invariance true for all physical laws). Given by$\begin{align}\dot{\mathbf{x}}(t)&=\mathbf{g}^c(\mathbf{x}(t),\mathbf{u}(t)) \\ \mathbf{y}(t)&=\mathbf{h}^c(\mathbf{x}(t),\mathbf{u}(t))\end{align}$ However, in practice, we need a discrete system to implement a digital controller and ideally want to use all the tools we know from analysing linear systems. - [[Linearization and Discretization of State Space Models]] --- #### In Robotics As mentioned in [[- Robotics, Dynamics and Control -]], certain subfields may use slightly different notation based on the application. Robotics usually analysis a system in [[Generalized Coordinates, Configuration or Joint Space|configuration]] [[Space|space]]. ![[Pasted image 20230216190121.png|center|450]] >[!info] Inverse Dynamics Model >The general form of the system dynamics is relating control inputs to system states via the [[ODEs - Ordinary Differential Equations|nonlinear ODE]]$\boldsymbol{\tau}_{\text{motor}}=\mathbf{M}(\mathbf{q})\ddot{\mathbf{q}}+\mathbf{C}(\mathbf{q},\dot{\mathbf{q}})\dot{\mathbf{q}}+\boldsymbol{\tau}_{\text{g}}(\mathbf{q})+\boldsymbol{\tau}_{\text{fric}}(\dot{\mathbf{q}})+\boldsymbol{\tau}_{\text{ext}},$where the external joint torques are a result of an external [[Robot Grasping|wrench]]$\boldsymbol{\tau}_\text{ext}(\mathbf{q})=\mathbf{J}^\top(\mathbf{q})\cdot \boldsymbol{\omega}$ >[!brainwaves] Intuition >- Mass matrix ... >- Coriolis term describes redistribution of energy based on movement. >[!info] Wrench >A **wrench** is a $6$-dimensional vector of **cartesian** forces and torques applied **at contact point** $c$ with index $i$ $\boldsymbol{\omega} =\begin{pmatrix} f_x \\ f_y \\ f_z \\ \tau_x \\ \tau_y \\ \tau_z \\ \end{pmatrix} =\begin{pmatrix} \mathbf{f} \\ \lambda(\mathbf{d} \times \mathbf{f}) \end{pmatrix}\in \mathbb{R}^{6}.$For details , see [[Wrenches]]. >[!info] Forward Dynamics Model >Determine a [[[Static, Dynamic and Stochastic Systems|systems]]trajectory by solving the ODE $\mathbf{\ddot{q}}=\mathbf{M}^{-1}(\mathbf{q}) \Big(\boldsymbol{\tau}_{\text{motor}}-\mathbf{C}(\mathbf{q},\dot{\mathbf{q}})\dot{\mathbf{q}}-\boldsymbol{\tau}_{\text{g}}(\mathbf{q})-\boldsymbol{\tau}_{\text{fric}}(\dot{\mathbf{q}})-\boldsymbol{\tau}_{\text{ext}} \Big),$with appropriate initial state. Numerical integration yields the full system state. $\boldsymbol{\tau}_{\text{motor}}=\textcolor{red}{\mathbf{M}(\mathbf{q})}\ddot{\mathbf{q}}+\mathbf{C}(\mathbf{q},\dot{\mathbf{q}})\dot{\mathbf{q}}+\textcolor{red}{\boldsymbol{\tau}_{\text{g}}(\mathbf{q})}+\boldsymbol{\tau}_{\text{fric}}(\dot{\mathbf{q}})+\boldsymbol{\tau}_{\text{ext}},$