In [1]:
import sympy as sm
In [2]:
sm.init_printing()
In [18]:
mb, mc, Ib, Ic, r, l, d = sm.symbols('m_b, m_c, I_b, I_c, r, l, d')
In [6]:
mb
Out[6]:
$\displaystyle m_{b}$
In [8]:
Ib
Out[8]:
$\displaystyle I_{b}$
In [9]:
r+Ib**2
Out[9]:
$\displaystyle I_{b}^{2} + r$
In [10]:
sm.sin(r) + sm.sqrt(mb)
Out[10]:
$\displaystyle \sqrt{m_{b}} + \sin{\left(r \right)}$
In [11]:
t = sm.symbols('t')
In [12]:
theta = sm.Function('theta')(t)
theta
Out[12]:
$\displaystyle \theta{\left(t \right)}$
In [14]:
omega = sm.Function('omega')(t)
omega
Out[14]:
$\displaystyle \omega{\left(t \right)}$
In [15]:
sm.diff(theta, t)
Out[15]:
$\displaystyle \frac{d}{d t} \theta{\left(t \right)}$
In [16]:
sm.diff(theta**2+sm.sin(theta**2/2), t)
Out[16]:
$\displaystyle \theta{\left(t \right)} \cos{\left(\frac{\theta^{2}{\left(t \right)}}{2} \right)} \frac{d}{d t} \theta{\left(t \right)} + 2 \theta{\left(t \right)} \frac{d}{d t} \theta{\left(t \right)}$
In [19]:
h = l - sm.sqrt(l**2 - d**2)
h
Out[19]:
$\displaystyle l - \sqrt{- d^{2} + l^{2}}$
In [ ]: