```python
import numpy as np
import matplotlib.pyplot as plt
import sympy as sp
```


```python
# fuggveny ami helyere be lehet helyettesiteni barmilyen masik fuggvenyt
def r(t):
    fr=3.0+0.5*np.sin(t)
    return(5*np.sin(fr*t))
```


```python
# legeneralja a hely-ido-t
# n a mintavetelek szama, h az intervallum a mintavetelek kozott
def generate_rt(n, h):
    i = 0.0
    timeStamps = np.empty((0))
    x = np.empty((0))
    while i <= n:
        timeStamps = np.append(timeStamps, i)
        x = np.append(x, r(i))
        i += h
    return x, timeStamps
```


```python
# derivalas kozelitessel, r argumentum a generate_rt() fuggveny elso visszateresi erteke
# t pedig a mintavetelezes idopontjai
def diff(r, t):
    if len(r) < 2: return False
    x = np.zeros_like(t)
    for i in range(len(r)):
        if i == 0: # elso elem
            x[i] = (r[i+1]-r[i])/(t[i+1]-t[i])
        elif i == len(r)-1: # utolso elem
            x[i] = (r[i]-r[i-1])/(t[i]-t[i-1])
        else: # minden mas esetben
            x[i] = (r[i+1]-r[i-1])/(t[i+1]-t[i-1])
    return x
```


```python
# Itt hozzuk letre a sebesseg, gyorsulas -ido grafikonokat a diff(r,t) segitsegevel
rt, tVec = generate_rt(10, 0.001) # rt: hely-ido, tVec: mintavetel idopontok
vt = diff(rt, tVec) # sebesseg-ido
at = diff(vt, tVec) # gyorsulas-ido
fig, axs = plt.subplots(3,1, figsize=(17,17)) # 3 diagram keszitese egymas ala, x es y tengely megnevezesevel
axs[0].set_xlabel('time')
axs[0].set_ylabel('position')
axs[1].set_xlabel('time')
axs[1].set_ylabel('velocity')
axs[2].set_xlabel('time')
axs[2].set_ylabel('accelaration')
axs[0].plot(tVec, rt, color='blue')
axs[1].plot(tVec, vt, color='red')
axs[2].plot(tVec, at, color='green')
axs[0].grid()
axs[1].grid()
axs[2].grid()
```


```python
fig2 = plt.figure(figsize=(17,17))
ax1 = fig2.add_subplot()
ax1.plot(tVec, rt, color='blue', label='r(t)')
ax1.plot(tVec, vt, color='red', label='v(t)')
ax1.plot(tVec, at, color='green', label='a(t)')
ax1.set_xlabel('t')
ax1.legend()
```

b46b7de1e7f0c0fc0adaf7818f8b6603ee5821be
ipynb
Jupyter Notebook
jupyter_python/kinematika_dinamika/Fiziak_Kinematika.ipynb
Pecneb/Physics
5a3fcdf01b2d9b734ed3f5cb3ce313bf936bf6bd
MIT
jupyter_python/kinematika_dinamika/Fiziak_Kinematika.ipynb
Pecneb/Physics
5a3fcdf01b2d9b734ed3f5cb3ce313bf936bf6bd
MIT
jupyter_python/kinematika_dinamika/Fiziak_Kinematika.ipynb
Pecneb/Physics
5a3fcdf01b2d9b734ed3f5cb3ce313bf936bf6bd
MIT
Qwen/Qwen-72B
1. YES
2. YES