-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.py
More file actions
42 lines (35 loc) · 1.41 KB
/
Copy pathdebug.py
File metadata and controls
42 lines (35 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import numpy as np
import scipy as sc
import matplotlib.pyplot as plt
from scipy import optimize
from TMSimple import TMSimple
from vehicle_model import vehicle_model, state
from joblib import Parallel, delayed
import pandas as pd
vehicle = vehicle_model("parameters/test_model.ini")
vx = 65/3.6
max_d = 10
max_b = 3
SR = 0
fig, ax = plt.subplots()
states = []
for beta in np.linspace(-3,3,11):
states = []
for delta_ in np.linspace(-max_d,max_d, 31):
current_state = state(vehicle, vx = vx, beta=beta, SR=SR, delta=delta_)
current_state.solve()
current_state = current_state.vehicle.get_residual_forces(current_state.result[0], current_state.result[1], current_state, get_state=True)
states.append(current_state)
ax.plot(*zip(*([(state_n.ay, state_n.yaw_moment) for state_n in states])), label=f"beta: {beta}", color="blue")
for delta_ in np.linspace(-max_d,max_d,11):
states = []
for beta in np.linspace(-3,3,31):
current_state = state(vehicle, vx = vx, beta=beta, SR=SR, delta=delta_)
current_state.solve()
current_state = current_state.vehicle.get_residual_forces(current_state.result[0], current_state.result[1], current_state, get_state=True)
states.append(current_state)
ax.plot(*zip(*([(state_n.ay, state_n.yaw_moment) for state_n in states])), label=f"delta: {delta_}", color="red")
#ax.legend()
ax.axhline(y=0)
ax.axhline(x=0)
plt.show()