Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Image: ubuntu1804
Sympy initiation and dynamic system definition
In the next block, necessary modules are called and dynamic system is defined by its kinetic and potential energy.
System Lagrangian
Lagrange function is given by the difference of kinetic and potential energy
Determining of the governing equations
In order to obtain equations of motion, the Lagrangian Mechanics was applied. Reduction of the differential equations system allows to obtain the state space equations of the dynamic system. The right hand sides of system under consideration were found in this way.
First method
Direct differentiation of the Lagrange function (L)
Second method
Application of the LagrangesMethod class.
Numeriacal form of right hand sides of the equations of motion
In order to determine the numerical model, regular Python function has to be created.
Numerical simulations
Application of the appropriate integrating procedure enables to obtain a numerical solution of the sytem under consideration. The solve_ivp code from scipy.integrate module was used in this case.