Rowan-Classes/8th-Semester-Spring-2025/weapon-systems/homework/axial_drag.py
Aidan Sharpe 82b435b6a2 Week 3
2025-02-14 22:27:10 -05:00

21 lines
395 B
Python

import numpy as np
import matplotlib.pyplot as plt
def CA(Mach):
return np.where(Mach > 1.0, 0.02 + 0.03/Mach,
np.where(Mach > 0.5, 0.02*(Mach-0.5) + 0.04, 0.04))
def main():
Mach = np.linspace(0,5,100)
plt.plot(Mach, CA(Mach))
plt.xlabel("Mach number")
plt.ylabel("CA")
plt.savefig("axial_drag.png")
plt.show()
if __name__ == "__main__":
main()