def test_01(self): # Truth values from NASA RP 1046 Value = SA.alt2density(8000) Truth = 0.06011 self.failUnless(RE(Value, Truth) <= 1e-5)
def test_01(self): # Truth values from NASA RP 1046 Value = SA.alt2density(8000) Truth = 0.06011 self.assertTrue(RE(Value, Truth) <= 1e-5)
def calcNeededThrust(self, m, h, u_g, w_g, curveR): if (u_g < c.V_MIN): return 0. rho = SA.alt2density(h, 'm', 'kg/m**3') #Bahnneigungswinkel [deg] gamma = math.atan(float(w_g) / u_g) tas = math.sqrt(u_g**2. + w_g**2.) if (curveR == 0 or math.isnan(curveR)): phi = 0. else: phi = math.atan(tas**2. * math.cos(gamma) / (c.g * curveR)) n = math.cos(gamma) / math.cos(phi) F1 = (math.sin(gamma) * m * c.g) F2 = ((self.w.C_W0 * c.S * rho * tas**2) / 2) F3 = (self.w.k * 2 * (n * m * c.g)**2 / (rho * c.S * tas**2)) F = F1 + F2 + F3 if (F < 0): return 0. return F
def calcTakeOffParameter(self, m, h, s, propulsionType, propulsion): P_increment = 10000. P_to = 60000. rho = SA.alt2density(h, 'm', 'kg/m**3') v_abh = math.sqrt(2. * m * c.g / (rho * c.S * c.C_A_TAKEOFF)) a_req = v_abh**2 / (2 * s) a_mean, F_0 = self.calcMeanAccelor(m, h, P_to, propulsionType, propulsion.ice.getNmax()) while (abs(a_req - a_mean) > 0.000001): if (a_mean > a_req and P_increment > 0): P_increment = P_increment * (-0.1) if (a_mean < a_req and P_increment < 0): P_increment = P_increment * (-0.1) #print("P -> " + str(P_to)) P_to += P_increment a_mean, F_0 = self.calcMeanAccelor(m, h, P_to, propulsionType, propulsion.ice.getNmax()) t_abh = v_abh / a_mean s_abh = (a_mean / 2) * t_abh**2 if (self.verbose): print("[Wing] a_mean = " + str(a_mean)) print("[Wing] t_abh = " + str(t_abh)) print("[Wing] s_abh = " + str(s_abh)) print("[Wing] P_to = " + str(P_to)) return P_to, t_abh, v_abh, F_0
def test_06(self): # truth value calculated from program at: # http://www.sworld.com.au/steven/space/atmosphere/ Value = SA.alt2density(65322, density_units="kg/m**3", alt_units="m") Truth = 1.4296e-4 self.failUnless(RE(Value, Truth) <= 5e-5)
def test_02(self): # test psf # Truth values from NASA RP 1046 Value = SA.alt2density(49000) Truth = 0.012215 self.assertTrue(RE(Value, Truth) <= 2e-5)
def test_03(self): # test pa and m # Truth values from NASA RP 1046 Value = SA.alt2density(25000, alt_units='m', density_units='kg/m**3') Truth = 0.039466 self.assertTrue(RE(Value, Truth) <= 1e-5)
def test_06(self): # truth value calculated from program at: # http://www.sworld.com.au/steven/space/atmosphere/ Value = SA.alt2density(65322, density_units='kg/m**3', alt_units='m') Truth = 1.4296e-4 self.assertTrue(RE(Value, Truth) <= 5e-5)
def test_02(self): # test psf # Truth values from NASA RP 1046 Value = SA.alt2density(49000) Truth = 0.012215 self.failUnless(RE(Value, Truth) <= 2e-5)
def test_03(self): # test pa and m # Truth values from NASA RP 1046 Value = SA.alt2density(25000, alt_units="m", density_units="kg/m**3") Truth = 0.039466 self.failUnless(RE(Value, Truth) <= 1e-5)
def test_05(self): # truth value calculated from program at: # http://www.sworld.com.au/steven/space/atmosphere/ Value = SA.alt2density(49610, density_units='kg/m**3', alt_units='m') Truth = 1.0269e-3 self.failUnless(RE(Value, Truth) <= 5e-5)
def test_07(self): # test units in other order # truth value calculated from program at: # http://www.sworld.com.au/steven/space/atmosphere/ Value = SA.alt2density(80956, density_units="kg/m**3", alt_units="m") Truth = 1.3418e-5 self.failUnless(RE(Value, Truth) <= 3e-5)
def test_07(self): # test units in other order # truth value calculated from program at: # http://www.sworld.com.au/steven/space/atmosphere/ Value = SA.alt2density(80956, density_units='kg/m**3', alt_units='m') Truth = 1.3418e-5 self.assertTrue(RE(Value, Truth) <= 3e-5)
def test_04(self): # test units in other order # truth value calculated from program at: # http://www.sworld.com.au/steven/space/atmosphere/ Value = SA.alt2density(39750, density_units='kg/m**3', alt_units='m') Truth = 3.9957e-3 self.failUnless(RE(Value, Truth) <= 3e-5)
def calcMeanAccelor(self, m, h, Pmax, propulsionType, NiceMax): pr = Propeller() rho = SA.alt2density(h, 'm', 'kg/m**3') v_abh = math.sqrt(2. * m * c.g / (rho * c.S * c.C_A_TAKEOFF)) G = m * c.g #Getribe... P_to = Pmax * c.GEAR_EFF[propulsionType] A_prop = pr.calcA_prop() eta_prop_0 = 0.4 #geschaetzt #aus Standschub.pdf #F_0 = 0.4 * (2 * rho * A_prop * P_to**2)**(1./3.) F_0 = eta_prop_0 * (P_to**(2. / 3.) * (2 * rho * A_prop)**(1. / 3.)) N_pr_to = NiceMax / c.GEAR_RATIO #1/min a_vec = [] dt = 1. t = 0. v = 0. a = 0. s = 0. while (v < v_abh): v = v + a #Thrust eta = 0.5 if (v > 11): eta, N = pr.calcEfficiency(h, v, N_pr_to, P_to) F = min(F_0, eta * (P_to / (v + 0.01))) #accelaration A = c.C_A_TAKEOFF * c.S * (rho / 2) * v**2 W = c.C_W_TAKEOFF * c.S * (rho / 2) * v**2 a = (F - W - (c.WHEEL_MY * (G - A))) / m a_vec.append(a) t += dt if (t > 1200): a_mean = np.inf a_vec.append(np.inf) break a_mean = np.mean(a_vec) return a_mean, F_0
def calcCa(self, m, h, u_g): if (u_g <= 0.): return 0. rho = SA.alt2density(h, 'm', 'kg/m**3') C_A = (math.sqrt(2. * m * c.g / (c.S * rho)) * (1. / u_g))**2. return C_A
def calcV_W_min(self, m, h): rho = SA.alt2density(h, 'm', 'kg/m**3') V_W_min = math.sqrt(2. * m * c.g / (rho * c.S * math.sqrt(self.C_W0 / self.k))) return V_W_min
def calcU_g_dH_min(self, m, h): rho = SA.alt2density(h, 'm', 'kg/m**3') U_g_dH_min = math.sqrt( 2. * m * c.g / (rho * c.S * math.sqrt(3. * self.C_W0 / self.k))) return U_g_dH_min
def calcV(self, m, h, C_A): rho = SA.alt2density(h, 'm', 'kg/m**3') gamma = math.atan(self.calcC_WFromC_A(C_A) / C_A) V = math.sqrt(2 * m * c.g * math.cos(gamma) / (rho * C_A * c.S)) return V
def calcCp(self, h, N, Pshaft): if (N <= 0): return float('nan') rho = SA.alt2density(h, 'm', 'kg/m**3') Cp = 100 * Pshaft / (rho * (N / 60)**3 * c.PROP_D**5) return Cp
def plotTakeOffRun(self, m, h): pr = Propeller() rho = SA.alt2density(h, 'm', 'kg/m**3') v_abh = math.sqrt(2 * m * c.g / (rho * c.S * c.C_A_TAKEOFF)) G = m * c.g #Getribe... P_to = c.GEAR_EFF_COMB * 84500 #kW A_prop = pr.calcA_prop() #aus Standschub.pdf eta_prop_0 = 0.4 #geschaetzt F_0 = eta_prop_0 * (P_to**(2. / 3.) * (2 * rho * A_prop)**(1. / 3.)) #F_0 = 0.4 * (2 * rho * A_prop * P_to**2)**(1./3.) #F_0 = 1800 #MUELL!!!!!!!!!!!!!!! N_pr_to = 5800. / c.GEAR_RATIO #1/min #v_abh = 100 t_vec = [] v_vec = [] F_vec = [] A_vec = [] W_vec = [] a_vec = [] t = 0 v = 0 a = 0 while (v < v_abh): t_vec.append(t) #speed v = v + a v_vec.append(v) #Thrust N = N_pr_to eta = 0.5 if (v > 11): eta, N = pr.calcEfficiency(h, v, N_pr_to, P_to) F = min(F_0, eta * (P_to / (v + 0.01))) print( str(v) + " -> " + str(eta) + " -> " + str(F) + " -> " + str(N)) F_vec.append(F) #accelaration A = c.C_A_TAKEOFF * c.S * (rho / 2) * v**2 A_vec.append(A) W = c.C_W_TAKEOFF * c.S * (rho / 2) * v**2 W_vec.append(W) a = (F - W - (c.WHEEL_MY * (G - A))) / m a_vec.append(a) t += 1 a_mean = np.mean(a_vec) t_abh = v_abh / a_mean s_abh = (a_mean / 2) * t_abh**2 print("t_abh = " + str(t_abh)) print("s_abh = " + str(s_abh)) #plt.plot(t_vec, F_vec, label="A") plt.plot(t_vec, A_vec, label="A") #plt.plot(t_vec, W_vec, label="W") #plt.plot(t_vec, a_vec, "o-", label="a") #plt.plot(t_vec, v_vec, "x-", label="v") plt.xlabel("$Zeit [s]$") plt.legend() plt.show() return s_abh
def calcCw(self, m, h, u_g, w_g): rho = SA.alt2density(h, 'm', 'kg/m**3') c_w = w_g * self.calcCa(m, h, u_g)**(3. / 2.) / math.sqrt( 2. * m * c.g / (c.S * rho)) return c_w
def calcC_W0(self): rho = SA.alt2density(0, 'm', 'kg/m**3') C_W0 = (2 * c.MTOM * c.g / (rho * c.S * c.V_E_MAX**2))**2 * self.k return C_W0