# Initialize MD-11 plane object plane = Plane(Cd_0=0.018, Em=None, e=0.85, chord=339 / 51.8, span=51.8, Cl_max=1.4, Lam=35.0, tc_max=0.12, W_0=2710000, W_fuel=None, cj=None, T_a_sl=800000, atmosphere=std_atm_earth()) """QUESTION 1 PLOT""" plane.set_altitude(0) # meters T_a = plane.jet_thrust_available() # N V_limits = plane.speed_min_max(T_a) # m/s V_range = np.arange(V_limits[0, 0], V_limits[1, 0] + 5, 5) Cd_inc = plane.Cd(plane.Cd_i(plane.Cl(V_range))) Cd_com = Cd_inc + plane.Cd_c(plane.Cl(V_range), V_range) D_inc = plane.drag(Cd_inc, V_range) / 1000 D_com = plane.drag(Cd_com, V_range) / 1000 plt.plot(V_range, D_inc, '-r', label='Drag (incompressible)') plt.plot(V_range, D_com, '--r', label='Drag (compressible)') plt.plot(V_range, [T_a / 1000 for i in range(V_range.shape[0])], '-b', label='Thrust Available') plt.xlim(V_range.min() - 10, V_range.max() + 10)
if __name__ == '__main__': from haydens_code.atmosphere import std_atm_earth from haydens_code.plane import Plane # Initialize The Global Flyer plane object plane = Plane( Cd_0=0.016, Em=None, e=0.94, chord=37.2 / 34.8,# MAC span=34.8, Cl_max=1.2, Lam=None, tc_max=None, W_0=98000, W_1=14900, cj=0.42, T_a_sl=10200, atmosphere=std_atm_earth() ) plane.set_altitude_range(500, 10000, 100) drag = plane.drag(plane.Cd(plane.Cd_i(plane.Cl(80))), 80) t_a = plane.jet_thrust_available() R_C = 80*(t_a - drag)/98000 print(R_C) plane.set_altitude(10000) print(plane.jet_thrust_available()) print(plane.speed_min_max(plane.jet_thrust_available()))
from haydens_code.plane import Plane # Initialize atmosphere object atm = std_atm_earth() # Initialize B-2 Spirit plane object plane = Plane(1420000, 52.4, 9.1, 0.0090, 0.92, 1.22) # Generate data at requested altitudes altitudes = [] speed_const_Cl = [] speed_stall = [] drag_const_Cl = [] drag_210 = [] for i in range(0, 20001, 500): plane.set_altitude(i) altitudes.append(i) density = atm.density_at(i) speed_stall.append(plane.speed_stall()) speed = plane.speed(plane.Cl_min_drag) speed_const_Cl.append(speed) Cd_min = plane.Cd(plane.Cd_i(plane.Cl_min_drag)) drag_const_Cl.append(plane.drag(Cd_min, speed)) speed = 210 # m/s Cd = plane.Cd(plane.Cd_i(plane.Cl(speed))) drag_210.append(plane.drag(Cd, speed)) # Reformat as Strings
Em=None, e=0.93, chord=423 / 61, # MAC span=61, Cl_max=2.3, Lam=31.6, tc_max=0.13, W_0=2380000, W_1=None, cj=None, T_a_sl=342000 * 2, atmosphere=std_atm_earth()) """QUESTION 1 and 2 PLOTS ---------------------------------------------------------------------------------------""" # FOR 0m -------------------------------------------------------------------------------------------------------- # compute velocity range plane.set_altitude(0) # meters T_a = plane.jet_thrust_available() # N V_limits = plane.speed_min_max(T_a) # m/s V_range = np.arange(V_limits[0, 0], V_limits[1, 0] + 5, 5) # compute drag Cd_inc = plane.Cd(plane.Cd_i(plane.Cl(V_range))) Cd_com = Cd_inc + plane.Cd_c(plane.Cl(V_range), V_range) D_inc = plane.drag(Cd_inc, V_range) D_com = plane.drag(Cd_com, V_range) # compute R/C RC_inc = plane.rate_of_climb(D_inc, V_range) RC_com = plane.rate_of_climb(D_com, V_range) print('% Difference (R/C max @ 0km), Incompressible and Compressible: {}'. format(100 * (RC_inc.max() - RC_com.max()) / RC_inc.max())) # plot plt.plot(V_range / plane.sound_speed,
Em=None, e=0.8, chord=20 / (200.0**0.5), # MAC span=200.0**0.5, Cl_max=1.5, Lam=None, tc_max=None, W_0=10000, W_1=None, cj=None, T_a_sl=3000, n_struct=3.0, atmosphere=std_atm_earth(), ) q4.set_altitude(0) print(q4.S) print(q4.W_0) print(q4.n_struct) print(q4.Cl_max) print(q4.T_a_sl) print(q4.Cd_0) print(q4.AR) print(q4.e_w) print('') n = Plane.n_for_bank(60) print(n) print(q4.turning_rate(100, n)) print('') print('r_struct: {}'.format(q4.turning_radius(60, q4.n_struct)))
import sys sys.path.append('..') if __name__ == '__main__': from haydens_code.atmosphere import std_atm_earth from haydens_code.plane import Plane # Initialize atmosphere object atm = std_atm_earth() # Initialize A-10 Warthog plane object plane = Plane(145000, 17.6, 2.676, 0.032, 0.87, 1.2, 80000) """QUESTION 1 - PART A""" altitude = 11500 # m plane.set_altitude(altitude) density = atm.density_at(altitude) thrust_avail = plane.jet_thrust_available() # Generate data at requested velocities speeds = [] lift_coeffs = [] drag_coeffs = [] drags = [] for speed in range(20, 301, 5): Cl = plane.Cl(speed) Cd = plane.Cd(plane.Cd_i(plane.Cl(speed))) drag = plane.drag(Cd, speed) speeds.append(speed) lift_coeffs.append(Cl) drag_coeffs.append(Cd)