gipps + pipes

This commit is contained in:
√(noham)²
2023-07-19 17:18:32 +02:00
parent edbd2c138b
commit 27527819fa
8 changed files with 219 additions and 34 deletions

29
pipes/dist sécurité.py Normal file
View File

@@ -0,0 +1,29 @@
import numpy as np
import matplotlib.pyplot as plt
vt = 1.25 # 4,5 km/h
Umin = 1 # vitesse m/s
Umax = 36 # environ 130 km/h
Wm = 4.23 # longueur du véhicule en m (moyenne française)
t = np.linspace(0, 15, 400)
def vitesse(t):
a = np.where(t <= 10, (Umax - Umin) / 10, - (Umax - Umin) / 10)
vt = np.where(t <= 10, Umin + a * t, Umax + 2 * a * (t - 10))
return vt
def security(t):
vt = vitesse(t)
dist = Wm * (1 + (vt/(16.1/3.6)))
# print(dist)
return dist
plt.figure(figsize=[16, 9])
plt.xlim([-1,16])
plt.xlabel('temps (s)')
plt.ylabel('distance de sécurité (m)')
plt.plot(t, security(t))
plt.savefig('pipes/dist sécurités.png')
plt.draw()
plt.pause(5)

BIN
pipes/dist sécurités.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB