In [1]:
from sympy import *
init_printing()
State variables:
s
: displacementv
: velocityd
: decelerationParameters:
b
: stiffness
In [2]:
s, v, d, b = symbols('s, v, d, b')
In [3]:
state_variables = Matrix([s, v, d])
state_variables
Out[3]:
In [4]:
def tau_dot(s, v, d):
return s * d / v**2 - 1
In [5]:
d_deceleration = - b * (tau_dot(s, v, d) - (-1/2))
d_deceleration
Out[5]:
In [6]:
full_model = Matrix([
- v,
- d,
d_deceleration
])
full_model
Out[6]:
In [9]:
jac =full_model.jacobian(state_variables)
jac
Out[9]:
In [ ]: