Skip to content

Commit ae67c6d

Browse files
committed
Updated sim_steer_torque misc study
1 parent a13e21b commit ae67c6d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/_2_misc_studies/sim_steer_torque/sim_steer_torque.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,22 @@
1111

1212
cg_heights = [5*0.0254, 7.5*0.0254, 10*0.0254, 12.5*0.0254]
1313

14+
ax.set_title("CG Height vs Normalized Pinion Torque")
15+
ax.set_xlabel("Time (s)")
16+
ax.set_ylabel("Normalized Pinion Torque")
17+
plot_entries = []
1418
for cg_height in cg_heights:
1519
start_values = {'CG_height': cg_height}
1620
sim_result = fmu_sim.simulate(start_time=0,
1721
stop_time=2,
1822
start_values=start_values)
1923

20-
ax.plot(sim_result['time'], sim_result['pinion_torque'])
24+
plot_entries.append((sim_result['time'], sim_result['pinion_torque'], f'z = {round(cg_height, 2)} m'))
2125

26+
normalizing_torque = max([max([abs(z) for z in y]) for y in [x[1] for x in plot_entries]]) # Don't try to understand it. Just trust it.
27+
28+
for time, sim_result, label in plot_entries:
29+
ax.plot(time, [x / normalizing_torque for x in sim_result], label=label)
30+
31+
ax.legend()
2232
plt.show()

0 commit comments

Comments
 (0)