In [1]:
import sympy as sp
sp.init_printing()
In [2]:
R, vS, phi1 = sp.symbols('R v_S phi_1', constant = True, positive = True)
adat=[(R, 3/10), (vS, 5), (phi1, sp.rad(75))]
adat
Out[2]:
$$\left [ \left ( R, \quad 0.3\right ), \quad \left ( v_{S}, \quad 5\right ), \quad \left ( \phi_{1}, \quad \frac{5 \pi}{12}\right )\right ]$$
In [3]:
t = sp.symbols('t')
phi = sp.Function('phi')(t)

a) $\mathbf{v}_\mathrm{P}\left(\varphi\right)$

In [4]:
xS = R*phi
xS
Out[4]:
$$R \phi{\left (t \right )}$$
In [5]:
megophid = sp.solve([vS-sp.diff(xS,t)],[sp.diff(phi,t)])
megophid
Out[5]:
$$\left \{ \frac{d}{d t} \phi{\left (t \right )} : \frac{v_{S}}{R}\right \}$$
In [6]:
rP = sp.simplify(sp.Matrix([xS - R*sp.sin(phi),R*(1-sp.cos(phi)),0]))
rP
Out[6]:
$$\left[\begin{matrix}R \left(\phi{\left (t \right )} - \sin{\left (\phi{\left (t \right )} \right )}\right)\\R \left(- \cos{\left (\phi{\left (t \right )} \right )} + 1\right)\\0\end{matrix}\right]$$
In [7]:
vP = sp.simplify(sp.diff(rP,t)).subs(megophid)
vP
Out[7]:
$$\left[\begin{matrix}v_{S} \left(- \cos{\left (\phi{\left (t \right )} \right )} + 1\right)\\v_{S} \sin{\left (\phi{\left (t \right )} \right )}\\0\end{matrix}\right]$$

b) $\mathbf{a}_\mathrm{P}\left(\varphi\right)$

In [8]:
aP = sp.simplify(sp.diff(vP,t)).subs(megophid)
aP
Out[8]:
$$\left[\begin{matrix}\frac{v_{S}^{2}}{R} \sin{\left (\phi{\left (t \right )} \right )}\\\frac{v_{S}^{2}}{R} \cos{\left (\phi{\left (t \right )} \right )}\\0\end{matrix}\right]$$
In [9]:
aPnagy=sp.simplify(sp.sqrt(aP.dot(aP)))
aPnagy
Out[9]:
$$\frac{v_{S}^{2}}{R}$$
In [10]:
sp.N(aPnagy.subs(phi,phi1).subs(adat))
Out[10]:
$$83.3333333333333$$

c) $\mathbf{v}_\mathrm{P}\left(\varphi_1\right)$, $\mathbf{a}_\mathrm{P}\left(\varphi_1\right)$

In [11]:
vP1 = sp.N(vP.subs(phi,phi1).subs(adat))
vP1
Out[11]:
$$\left[\begin{matrix}3.7059047744874\\4.82962913144534\\0\end{matrix}\right]$$
In [12]:
aP1 = sp.N(aP.subs(phi,phi1).subs(adat))
aP1
Out[12]:
$$\left[\begin{matrix}80.4938188574224\\21.5682537585434\\0\end{matrix}\right]$$

d) $\mathbf{a}_\mathrm{P}\left(\varphi_1\right) = \mathbf{a}_\mathrm{Pn}\left(\varphi_1\right) + \mathbf{a}_\mathrm{Pt}\left(\varphi_1\right)$

In [13]:
et = sp.N(vP.subs(phi,phi1).subs(adat)).normalized()
et
Out[13]:
$$\left[\begin{matrix}0.608761429008721\\0.793353340291235\\0\end{matrix}\right]$$
In [14]:
a1tnagy=aP1.dot(et)
a1tnagy
Out[14]:
$$66.1127783576029$$
In [15]:
a1t = a1tnagy*et
a1t
Out[15]:
$$\left[\begin{matrix}40.2469094287112\\52.4507935459384\\0\end{matrix}\right]$$
In [16]:
a1n = aP1 - a1t
a1n
Out[16]:
$$\left[\begin{matrix}40.2469094287112\\-30.882539787395\\0\end{matrix}\right]$$
In [17]:
en = a1n.normalized()
en
Out[17]:
$$\left[\begin{matrix}0.793353340291235\\-0.60876142900872\\0\end{matrix}\right]$$
In [18]:
import matplotlib as mpl
import matplotlib.pyplot as plt
In [19]:
plt.figure(figsize = (18/2.54,20/2.54))
ax = plt.gca()
plt.plot([0,100],[-40,60], alpha = 0) # belerajzolunk egy áttetsző vonalat, hogy a nyilak helyesen jelenjenek meg
plt.arrow(0,0,float(a1t[0,0]),float(a1t[1,0]),linestyle = ':',color = '#FF0000', head_width = 3)
plt.arrow(0,0,float(a1n[0,0]),float(a1n[1,0]),linestyle = ':',color = '#FF0000', head_width = 3)
plt.arrow(0,0,float(aP1[0,0]),float(aP1[1,0]),color = '#FF0000', head_width = 3)
plt.plot([float(a1n[0,0]),float(aP1[0,0])],[float(a1n[1,0]),float(aP1[1,0])],linestyle = ':',color = '#FF0000')
plt.plot([float(a1t[0,0]),float(aP1[0,0])],[float(a1t[1,0]),float(aP1[1,0])],linestyle = ':',color = '#FF0000')

plt.arrow(0,0,8*float(vP1[0,0]),8*float(vP1[1,0]),color = '#0000FF', head_width = 3)

plt.arrow(0,0,10*float(et[0,0]),10*float(et[1,0]),color = '#FFA500', head_width = 3)
plt.arrow(0,0,10*float(en[0,0]),10*float(en[1,0]),color = '#FFA500', head_width = 3)

# plt.xlim(left = 0, right = 50)
# plt.ylim(bottom = -30, top = 60)
ax.set_xticklabels([])
ax.set_yticklabels([])
plt.axis('scaled')
plt.grid()
plt.show()

e) $\rho\left(\varphi_1\right)$

In [20]:
rho1 = vP1.dot(vP1)/a1n.norm()
rho1
Out[20]:
$$0.730513714810465$$