Luftwiderstand: added power and energy

This commit is contained in:
2025-06-19 11:28:39 +02:00
parent 8eaafb6bda
commit 512fe8cdb8
+30 -11
View File
@@ -78,8 +78,8 @@ def main() -> None:
plot.plot(vel_list, y_fd) plot.plot(vel_list, y_fd)
plot.title("Windwiderstand vs Geschwindigkeit") plot.title("Luftwiderstand vs Geschwindigkeit")
plot.ylabel("Windwiderstand [%]") plot.ylabel("Luftwiderstand [%]")
plot.xlabel("Geschwindigkeit [km/h]") plot.xlabel("Geschwindigkeit [km/h]")
plot.legend(temps_list_leg) plot.legend(temps_list_leg)
plot.grid() plot.grid()
@@ -101,25 +101,44 @@ def main() -> None:
plot.plot(vel_list, y_fd) plot.plot(vel_list, y_fd)
plot.ylabel("Windwiderstand ID.3 [%]") plot.ylabel("Luftwiderstand ID.3 [%]")
plot.xlabel("Geschwindigkeit [km/h]") plot.xlabel("Geschwindigkeit [km/h]")
plot.title("Windwiderstand vs Geschwindigkeit") plot.title(f"Windwiderstand vs Geschwindigkeit, Temperature {temp}°C")
plot.legend(car_list_leg) plot.legend(car_list_leg)
plot.grid() plot.grid()
plot.figure()
y_fd = [] y_fd = []
y_pwr = []
y_energy = []
for vel_kmh in vel_list: for vel_kmh in vel_list:
fd_t = fd(rho_t, vel_kmh, c_val_id3, area_id3) fd_t = fd(rho_t, vel_kmh, c_val_id3, area_id3)
y_fd.append(fd_t) y_fd.append(fd_t)
y_pwr.append(fd_t*vel_kmh/1000/3.6)
y_energy.append(fd_t*vel_kmh/1000/3.6*100/vel_kmh)
plot.plot(vel_list, y_fd) fig, ax1 = plot.subplots()
ax1.plot(vel_list, y_fd)
ax1.set_ylabel("Luftwiderstand [N]")
ax1.set_xlabel("Geschwindigkeit [km/h]")
ax1.set_title(f"Luftwiderstand vs Geschwindigkeit, Temperature {temp}°C")
ax1.legend(car_list_leg)
ax2 = ax1.twinx()
ax2.set_ylabel("Antriebsleistung [kw]", color='tab:red')
ax2.plot(vel_list, y_pwr, color='tab:red')
ax2.tick_params(axis='y', labelcolor='tab:red')
ax1.grid()
plot.ylabel("Windwiderstand [N]") fig, ax1 = plot.subplots()
plot.xlabel("Geschwindigkeit [km/h]") ax1.plot(vel_list, y_fd)
plot.title("Windwiderstand vs Geschwindigkeit") ax1.set_ylabel("Luftwiderstand [N]")
plot.legend(car_list_leg) ax1.set_xlabel("Geschwindigkeit [km/h]")
plot.grid() ax1.set_title(f"Luftwiderstand vs Geschwindigkeit, Temperature {temp}°C")
ax1.legend(car_list_leg)
ax2 = ax1.twinx()
ax2.set_ylabel("Antriebsenergie [kwh]", color='tab:red')
ax2.plot(vel_list, y_energy, color='tab:red')
ax2.tick_params(axis='y', labelcolor='tab:red')
ax1.grid()
plot.show() plot.show()
if __name__ == '__main__': if __name__ == '__main__':