In [1]:
from sympy.abc import*
from sympy import *
from sympy import MatrixSymbol, Identity
init_printing(use_latex=True) #For good look equations
from tools import*
In [2]:
#Functions respect to time (Variables)
x,y,th = def_vars (['x','y','\\theta'],True)
In [3]:
#Constants
b3s = Function('\\beta _{3s}')(t)
#Constants
d = Symbol('d')
gamma = Symbol('\\gamma')
In [4]:
z1 = Matrix([[x + d*cos(th + gamma)], [ y + d*sin(th + gamma)]])
z1
Out[4]:
In [5]:
M = simplify(z1.diff(t))
M
Out[5]:
In [6]:
x1,x2,x3,x4,x5 = def_states('x',5,True)
In [7]:
thd, thdd = def_state_der('\\theta',2,True)
xd, xdd = def_state_der('x',2,True)
yd, ydd = def_state_der('y',2,True)
In [8]:
l = ['x','y','\\theta']
In [9]:
M = sub_derlist(M, l)
M
Out[9]:
In [10]:
V = Symbol('V')
M = M.subs(xd,V*cos(th))
M = M.subs(yd,V*sin(th))
In [11]:
factor(M, V)
Out[11]:
In [ ]: