import sympy as sp
sp.init_printing()
t0, t1, theta0, omega0, epsilon, R = sp.symbols('t_0 t_1 vartheta_0 omega_0 epsilon R')
adat=[(t0, 0),(t1,7),(theta0,sp.rad(30)),(omega0,10),(epsilon,-2), (R, 0.5)]
adat
t, c1, c2 = sp.symbols('t c_1 c_2')
fEpsilon = epsilon
fOmega=sp.integrate(fEpsilon,t)+c1
fOmega
fTheta=sp.integrate(fOmega,t)+c2
fTheta
megoc1c2=sp.solve([fOmega.subs(t,t0)-omega0,fTheta.subs(t,t0)-theta0],[c1,c2])
megoc1c2
c1.subs(megoc1c2).subs(adat)
c2.subs(megoc1c2).subs(adat)
fTheta.subs(megoc1c2).subs(t,t1).subs(adat)
sp.N(fTheta.subs(megoc1c2).subs(t,t1).subs(adat))
sp.N(fTheta.subs(megoc1c2).subs(t,t1).subs(adat)/(2*sp.pi))
fOmega.subs(megoc1c2).subs(t,t1).subs(adat)
negatÃv $\rightarrow$ óramutató járásával megegyezÅ‘
tcs=sp.Symbol('tcs')
megotcs=sp.solve([fOmega],[t])
megotcs
t.subs(megotcs).subs(megoc1c2).subs(adat)
sp.N(fTheta.subs(megotcs).subs(megoc1c2).subs(adat))
sp.N(fTheta.subs(megotcs).subs(megoc1c2).subs(adat)/(2*sp.pi))
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
tList = np.linspace(float(t0.subs(adat)),float(t1.subs(adat)),50)
at = sp.lambdify(t, (R*fEpsilon).subs(adat))
plt.plot(tList, [at(t) for t in tList])
plt.fill_between(tList, [at(t) for t in tList], alpha = 0.1)
plt.xlim(left = tList[0],right = tList[-1])
plt.xlabel(r'$t [s]$')
plt.ylabel(r'$a_\mathrm{t} \, \left[\mathrm{m/s^2}\right]$')
plt.ylim(top = 0, bottom = -2)
plt.grid()
plt.show()
v = sp.lambdify(t, (R*fOmega).subs(megoc1c2).subs(adat))
plt.plot(tList, [v(t) for t in tList])
plt.fill_between(tList, [v(t) for t in tList], alpha = 0.1)
plt.xlim(left = tList[0],right = tList[-1])
plt.xlabel('t [s]')
plt.ylabel('v [m/s]')
plt.ylim(top = 5, bottom = -2)
plt.grid()
plt.show()
s = sp.lambdify(t, (R*fTheta).subs(megoc1c2).subs(adat))
plt.plot(tList, [s(t) for t in tList])
plt.fill_between(tList, [s(t) for t in tList], alpha = 0.1)
plt.xlim(left = tList[0],right = tList[-1])
plt.xlabel(r'$t \, \left[\mathrm{s}\right]$')
plt.ylabel(r'$s \, \left[\mathrm{m}\right]$')
plt.ylim(top = 14, bottom = 0)
plt.grid()
plt.show()
an = sp.lambdify(t, (R*fOmega**2).subs(megoc1c2).subs(adat))
plt.plot(tList, [an(t) for t in tList])
plt.fill_between(tList, [an(t) for t in tList], alpha = 0.1)
plt.xlim(left = tList[0],right = tList[-1])
plt.xlabel(r'$t \, \left[\mathrm{s}\right]$')
plt.ylabel(r'$a_\mathrm{n} \, \left[\mathrm{m/s^2}\right]$')
plt.ylim(top = 50, bottom = 0)
plt.grid()
plt.show()