gen_dynamics.py
Go to the documentation of this file.
1 from sympy import Symbol, sin, diff
2 from pprint import pprint
3 
4 theta = Symbol('theta')
5 theta_dot = Symbol('thetadot')
6 u = Symbol('u')
7 m_ = Symbol('m_')
8 g_ = Symbol('g_')
9 b_ = Symbol('b_')
10 l_ = Symbol('l_')
11 
12 theta_ddot = (u - m_ * g_ * l_ * sin(theta) - b_ * theta_dot) / (m_ * l_ * l_)
13 f = [theta_dot, theta_ddot]
14 fx = [
15  # d/dtheta, d/dthetadot
16  [0, 1],
17  [diff(theta_ddot, theta), diff(theta_ddot, theta_dot)]
18 ]
19 
20 fu = [
21  0, diff(theta_ddot, u)
22 ]
23 
24 pprint(fx)
25 pprint(fu)


exotica_pendulum_dynamics_solver
Author(s): Traiko Dinev
autogenerated on Sat Apr 10 2021 02:35:47