예제 #1
0
def flight_point(aircraft, rating, nei, state, var, input, dat, cmd, dof, cst):

    #===========================================================================================================
    def fct_flight_point(var, state, input, dat, cmd, dof, cst, nei, rating,
                         aircraft):

        for i in range(n_dat):
            param[dat[i][0]] = eval(dat[i][1])

        for i in range(n_cmd):
            param[cmd[i]] = var[i]

        xin = numpy.array([param["cz"], param["fn"]])

        for i in range(n_dof):
            state[state_dict[dof[i]]] = var[n_cmd + i]

        xout, state_d = state_dot(xin, state, rating, nei, aircraft)

        res = [None] * n_cst
        for i in range(n_cst):
            res[i] = xout[xout_dict[cst[i][0]]] - eval(cst[i][1])

        return res

    #-----------------------------------------------------------------------------------------------------------

    # Initialize level flight
    #-----------------------------------------------------------------------------------------------------------
    n_dat = numpy.shape(dat)[0]
    n_cmd = numpy.shape(cmd)[0]
    n_dof = numpy.shape(dof)[0]
    n_cst = numpy.shape(cst)[0]

    param = {"cz": 0., "fn": 0.}

    fct_args = (state, input, dat, cmd, dof, cst, nei, rating, aircraft)

    out_dict = fsolve(fct_flight_point,
                      x0=var,
                      args=fct_args,
                      full_output=True)

    rei = out_dict[2]
    if (rei != 1):
        raise Exception("Impossible to converge flight point",
                        unit.NM_m(state[state_dict["xg"]]))

    for i in range(n_dat):
        param[dat[i][0]] = eval(dat[i][1])

    for i in range(n_cmd):
        param[cmd[i]] = out_dict[0][i]

    xin = numpy.array([param["cz"], param["fn"]])

    for i in range(n_dof):
        state[state_dict[dof[i]]] = out_dict[0][n_cmd + i]

    xout, state_d = state_dot(xin, state, rating, nei, aircraft)

    return xout, state, state_d
예제 #2
0
    print("Electric fan length = ", "%.2f" % aircraft.electric_nacelle.length,
          " m")
    print("Electric fan diameter = ",
          "%.2f" % aircraft.electric_nacelle.fan_width, " m")
    print("Electric nozzle diameter = ",
          "%.2f" % aircraft.electric_nacelle.nozzle_width, " m")
    print("relative decrease of e-fan inlet velocity in cruise = ",
          "%.3f" % kVbli, " no_dim")
    print("Factor on e-fan thrust due to BLI in cruise = ",
          "%.3f" % aircraft.propulsion.bli_e_thrust_factor, " no_dim")
    print("Global factor on SFC in cruise = ", "%.4f" % sfc_factor, " no_dim")

print("-------------------------------------------")
print("Number of passengers = ", "%.0f" % aircraft.cabin.n_pax_ref, " int")
print("Design range = ",
      "%.0f" % unit.NM_m(aircraft.design_driver.design_range), " NM")
print("Cruise Mach number = ", "%.2f" % aircraft.design_driver.cruise_mach,
      " Mach")
print("-------------------------------------------")
print("Reference thrust turbofan = ",
      "%.0f" % aircraft.turbofan_engine.reference_thrust, " N")
print("Reference thrust effective = ",
      "%.0f" % aircraft.propulsion.reference_thrust_effective, " N")
print("Turbofan mass = ", "%.0f" % aircraft.turbofan_nacelle.mass, " kg")
print("Cruise SFC = ", "%.4f" % (aircraft.propulsion.sfc_cruise_ref * 36000),
      " kg/daN/h")
print("Cruise LoD = ", "%.4f" % (aircraft.aerodynamics.cruise_lod_max),
      " no_dim")
print("-------------------------------------------")
print("Wing area = ", "%.2f" % aircraft.wing.area, " m2")
print("Wing span = ", "%.2f" % aircraft.wing.span, " m")
예제 #3
0
# Perform MDF optimization
#------------------------------------------------------------------------------------------------------
criterion = "MTOW"

run.mdf_process(aircraft,search_domain,criterion)

print("-------------------------------------------")
print("Optimization : done")

#======================================================================================================
# Print some results
#======================================================================================================
print("-------------------------------------------")
print("Number of passengers = ","%.0f"%aircraft.cabin.n_pax_ref," int")
print("Design range = ","%.0f"%unit.NM_m(aircraft.design_driver.design_range)," NM")
print("Cruise Mach number = ","%.2f"%aircraft.design_driver.cruise_mach," Mach")
print("-------------------------------------------")
print("Reference thrust = ","%.0f"%aircraft.turbofan_engine.reference_thrust," N")
print("Bypass ratio = ","%.1f"%aircraft.turbofan_engine.bpr," no_dim")
print("-------------------------------------------")
print("Wing area = ","%.2f"%aircraft.wing.area," m2")
print("Wing span = ","%.2f"%aircraft.wing.span," m")
print("-------------------------------------------")
print("Fuselage length = ","%.2f"%aircraft.fuselage.length," m")
print("Fuselage width = ","%.2f"%aircraft.fuselage.width," m")
print("-------------------------------------------")
print("MTOW = ","%.2f"%aircraft.weights.mtow," kg")
print("MLW = ","%.2f"%aircraft.weights.mlw," kg")
print("OWE = ","%.2f"%aircraft.weights.owe," kg")
print("MWE = ","%.2f"%aircraft.weights.mwe," kg")