pylib.numerical.ode_model module¶
Mathmatical models governed by ordinary differential equations.
Describes initial value problems as systems of first order ordinary differential equations.
- Date
2020-01-08
-
disk(d, e, T, method='')[source]¶ Rotation of an eccentric disk.
- Parameters
d (float) – diameter
e (float) – eccentricity
T (float) – torque
method – the method to use, default = ‘’.
- Returns
disk function. This function is independent of the time.
For method = ‘’: f(x, t=0) -> (xp1, xp2, xp3, xp4, xp5, xp6). x is (x, y, phi, x’, y’, phi’) and the return values are (x’, y’, phi’, x’‘, y’‘, phi’‘)
For method = ‘nm’: f(xn, xpn, xppn, t=0) -> (N, dN, dNp, dNpp). xn are the values of the function (x, y, phi), xpn are first derivative values of the function (x’, y’, phi’) and xppn are the second derivative values of the function (x’‘, y’‘, phi’‘). The return values are (N, dN, dNp, dNpp)
For method = ‘nmmdk’: f(xn, xpn, xppn, t=0) -> (rm, rmx, rmxpp, rd, rdx, rdxp, rk, rkx, f). xn are the values of the function (x, y, phi), xpn are first derivative values of the function (x’, y’, phi’) and xppn are the second derivative values of the function (x’‘, y’‘, phi’‘). The return values are (rm, rmx, rmxpp, rd, rdx, rdxp, rk, rkx, f)
- Return type
function
Model
\[\begin{split}\begin{vmatrix} \ddot{x} + \cos(\varphi)\ddot{\varphi} + 2d \,\dot{x} - \sin(\varphi) \,\dot{\varphi}^2 + 2d\cos(\varphi)\, \dot{\varphi} + x &=& 0 \\ \ddot{y} - \sin(\varphi)\ddot{\varphi} + 2d \,\dot{y} - \cos(\varphi) \,\dot{\varphi}^2 + 2d\sin(\varphi)\, \dot{\varphi} + y &=& 0 \\ \ddot{\varphi} + e\,y\sin(\varphi) - e\,x\cos(\varphi) &=& t \end{vmatrix} \\ \begin{vmatrix} \ddot{x} + \cos(\varphi)\ddot{\varphi} &=& -2d \,\dot{x} + \sin(\varphi) \,\dot{\varphi}^2 -2d\cos(\varphi)\, \dot{\varphi} - x \\ \ddot{y} - \sin(\varphi)\ddot{\varphi} &=& -2d \,\dot{y} + \cos(\varphi) \,\dot{\varphi}^2 -2d\sin(\varphi)\, \dot{\varphi} - y \\ \ddot{\varphi} &=& t - e\,y\sin(\varphi) + e\,x\cos(\varphi) \end{vmatrix}\end{split}\]\[\begin{split}\mathbf{M}(\mathbf{x}) \cdot \mathbf{\ddot{x}} &= \mathbf{f}(\mathbf{x}, \mathbf{\dot{x}}) \\ \begin{bmatrix} 1 & 0 & \cos \varphi \\ 0 & 1 & -\sin \varphi \\ 0 & 0 & 1 \end{bmatrix} \cdot \begin{bmatrix} \ddot{x} \\ \ddot{y} \\ \ddot{\varphi} \end{bmatrix} &= \begin{bmatrix} -2d \,\dot{x} + \sin(\varphi) \,\dot{\varphi}^2 -2d\cos(\varphi)\, \dot{\varphi} - x \\ -2d \,\dot{y} + \cos(\varphi) \,\dot{\varphi}^2 -2d\sin(\varphi)\, \dot{\varphi} - y \\ t - e\,y\sin(\varphi) + e\,x\cos(\varphi) \end{bmatrix}\end{split}\]returns
\[\begin{split}x_1 &= x &\quad x_4 &= \dot{x}_1 = \dot{x} &\quad \dot{x}_4 &= \ddot{x} \\ x_2 &= y &\quad x_5 &= \dot{x}_2 = \dot{y} &\quad \dot{x}_5 &= \ddot{y} \\ x_3 &= \varphi &\quad x_6 &= \dot{x}_3 = \dot{\varphi} &\quad \dot{x}_6 &= \ddot{\varphi} \\\end{split}\]\[\begin{split}\dot{q} &= f(x) \\ \begin{bmatrix} \dot{x}_1 \\ \dot{x}_2 \\ \dot{x}_3 \\ \dot{x}_4 \\ \dot{x}_5 \\ \dot{x}_6 \end{bmatrix} &= \begin{bmatrix} x_4 \\ x_5 \\ x_6 \\ \begin{bmatrix} 1 & 0 & \cos x_3 \\ 0 & 1 & -\sin x_3 \\ 0 & 0 & 1 \end{bmatrix}^{-1} \cdot \begin{bmatrix} -2d \,x_4 + \sin(x_3) \,x_6^2 -2d\cos(x_3)\, x_6 - x_1 \\ -2d \,x_5 + \cos(x_3) \,x_6^2 -2d\sin(x_3)\, x_6 - x_2 \\ t - e\,x_2\sin(x_3) + e\,x_1\cos(x_3) \end{bmatrix} \end{bmatrix}\end{split}\]Three explicit differential equations of order 2 reducted to a system of 3x2 first-order differential equations.