mirror of
https://github.com/NohamR/Stage-2023.git
synced 2025-05-24 14:21:58 +00:00
18 lines
435 B
Python
18 lines
435 B
Python
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
|
|
U = 1.25 # vitesse m.s-¹
|
|
Wm = 0.3 # distance minimale entre la voiture et celle qui la précède m
|
|
Ws = 0.9 # m
|
|
ww = np.linspace(0, 10, 200)
|
|
|
|
def phi(ww):
|
|
PHI = (U*(1 - np.exp(- (ww-Wm)/Ws)))
|
|
return (ww >= Wm)* PHI
|
|
|
|
plt.figure(figsize=[16,9])
|
|
plt.xlabel('distance w en m')
|
|
plt.ylabel('vitesse en m.s-¹')
|
|
plt.plot(ww, phi(ww))
|
|
plt.savefig('phi(ww).png', dpi=300)
|
|
plt.show() |