def fct_mass(x_in, aircraft): ac = aircraft ac.weights.mlw = x_in[0] # Coupling variable ac.weights.mzfw = x_in[1] # Coupling variable # Mass #------------------------------------------------------------------------------------------------------ airframe.eval_cabin_mass(ac) airframe.eval_fuselage_mass(ac) airframe.eval_vtp_mass(ac) airframe.eval_wing_mass(ac) airframe.eval_htp_mass(ac) airframe.eval_landing_gear_mass(ac) propulsion.eval_propulsion_mass(ac) propulsion.eval_battery_mass(ac) propulsion.eval_tank_data(ac) airplane.eval_system_mass(ac) airplane.eval_payload_mass(ac) airplane.eval_aircraft_weights(ac) y_out = np.array([x_in[0] - ac.weights.mlw, \ x_in[1] - ac.weights.mzfw]) return y_out
def fct_mass_mission(x_in, aircraft): ac = aircraft ac.weights.mtow = x_in[0] # Coupling variable ac.weights.mlw = x_in[1] # Coupling variable ac.weights.mzfw = x_in[2] # Coupling variable # Mass #------------------------------------------------------------------------------------------------------ airframe.eval_cabin_mass(ac) airframe.eval_fuselage_mass(ac) airframe.eval_vtp_mass(ac) airframe.eval_wing_mass(ac) airframe.eval_htp_mass(ac) airframe.eval_landing_gear_mass(ac) propulsion.eval_propulsion_mass(ac) propulsion.eval_battery_mass(ac) propulsion.eval_tank_data(ac) airplane.eval_system_mass(ac) airplane.eval_payload_mass(ac) airplane.eval_aircraft_weights(ac) # Mission #------------------------------------------------------------------------------------------------------ disa = 0 altp = ac.design_driver.ref_cruise_altp mach = ac.design_driver.cruise_mach ac.nominal_mission.payload = ac.payload.nominal ac.nominal_mission.range = ac.design_driver.design_range ac.nominal_mission.tow = ac.weights.mtow payload = ac.nominal_mission.payload range = ac.nominal_mission.range tow = ac.nominal_mission.tow block_fuel, block_time, total_fuel = perfo.mission( ac, range, tow, altp, mach, disa) ac.nominal_mission.block_fuel = block_fuel ac.nominal_mission.block_time = block_time ac.nominal_mission.total_fuel = total_fuel required_mtow = ac.weights.owe + payload + total_fuel y_out = np.array([x_in[0] - required_mtow, \ x_in[1] - ac.weights.mlw, \ x_in[2] - ac.weights.mzfw]) return y_out
print("Pre design : done") # airplane mass & CG estimation #------------------------------------------------------------------------------------------------------ airframe.eval_cabin_mass(ac) airframe.eval_fuselage_mass(ac) airframe.eval_vtp_mass(ac) airframe.eval_wing_mass(ac) airframe.eval_htp_mass(ac) airframe.eval_landing_gear_mass(ac) propulsion.eval_propulsion_mass(ac) propulsion.eval_battery_mass(ac) propulsion.eval_tank_data(ac) airplane.eval_system_mass(ac) airplane.eval_payload_mass(ac) airplane.eval_aircraft_weights(ac) airplane.eval_aircraft_cg(ac) delta_mzfw = mzfw_i - ac.weights.mzfw # Should be positive or zero delta_mlw = mlw_i - ac.weights.mlw # Should be positive or zero print('Coupling : delta_mzfw = ', "%.2f" % delta_mzfw, ' kg, (= 0 ?)') print('Coupling : delta_mlw = ', "%.2f" % delta_mlw, 'kg, (= 0 ?)') print("-------------------------------------------") print("Mass and CG estimation : done") # Nominal mission #------------------------------------------------------------------------------------------------------
def mass_mission_adaptation(aircraft): """ Perform mass - mission adaptation and update mass and CGs """ #=========================================================================================================== def fct_mass_mission(x_in, aircraft): ac = aircraft ac.weights.mtow = x_in[0] # Coupling variable ac.weights.mlw = x_in[1] # Coupling variable ac.weights.mzfw = x_in[2] # Coupling variable # Mass #------------------------------------------------------------------------------------------------------ airframe.eval_cabin_mass(ac) airframe.eval_fuselage_mass(ac) airframe.eval_vtp_mass(ac) airframe.eval_wing_mass(ac) airframe.eval_htp_mass(ac) airframe.eval_landing_gear_mass(ac) propulsion.eval_propulsion_mass(ac) propulsion.eval_battery_mass(ac) propulsion.eval_tank_data(ac) airplane.eval_system_mass(ac) airplane.eval_payload_mass(ac) airplane.eval_aircraft_weights(ac) # Mission #------------------------------------------------------------------------------------------------------ disa = 0 altp = ac.design_driver.ref_cruise_altp mach = ac.design_driver.cruise_mach ac.nominal_mission.payload = ac.payload.nominal ac.nominal_mission.range = ac.design_driver.design_range ac.nominal_mission.tow = ac.weights.mtow payload = ac.nominal_mission.payload range = ac.nominal_mission.range tow = ac.nominal_mission.tow block_fuel, block_time, total_fuel = perfo.mission( ac, range, tow, altp, mach, disa) ac.nominal_mission.block_fuel = block_fuel ac.nominal_mission.block_time = block_time ac.nominal_mission.total_fuel = total_fuel required_mtow = ac.weights.owe + payload + total_fuel y_out = np.array([x_in[0] - required_mtow, \ x_in[1] - ac.weights.mlw, \ x_in[2] - ac.weights.mzfw]) return y_out #----------------------------------------------------------------------------------------------------------- n_pax_ref = aircraft.cabin.n_pax_ref design_range = aircraft.design_driver.design_range mtow_i = init.mtow(n_pax_ref, design_range) mzfw_i = init.mzfw(n_pax_ref, design_range) mlw_i = init.mlw(mtow_i, mzfw_i) x_ini = np.array([mtow_i, mlw_i, mzfw_i]) fct_arg = aircraft output_dict = fsolve(fct_mass_mission, x0=x_ini, args=fct_arg, full_output=True) aircraft.weights.mtow = output_dict[0][0] # Coupling variable aircraft.weights.mlw = output_dict[0][1] # Coupling variable aircraft.weights.mzfw = output_dict[0][2] # Coupling variable # Update mass #------------------------------------------------------------------------------------------------------ airframe.eval_cabin_mass(aircraft) airframe.eval_fuselage_mass(aircraft) airframe.eval_vtp_mass(aircraft) airframe.eval_wing_mass(aircraft) airframe.eval_htp_mass(aircraft) airframe.eval_landing_gear_mass(aircraft) propulsion.eval_propulsion_mass(aircraft) propulsion.eval_battery_mass(aircraft) propulsion.eval_tank_data(aircraft) airplane.eval_system_mass(aircraft) airplane.eval_payload_mass(aircraft) airplane.eval_aircraft_weights(aircraft) airplane.eval_aircraft_cg(aircraft) return
def mass_estimation(aircraft): """ Estimate mass and CGs of the airplane Takes MTOW as input but solves the coupling carried by MZFW and MLW """ #=========================================================================================================== def fct_mass(x_in, aircraft): ac = aircraft ac.weights.mlw = x_in[0] # Coupling variable ac.weights.mzfw = x_in[1] # Coupling variable # Mass #------------------------------------------------------------------------------------------------------ airframe.eval_cabin_mass(ac) airframe.eval_fuselage_mass(ac) airframe.eval_vtp_mass(ac) airframe.eval_wing_mass(ac) airframe.eval_htp_mass(ac) airframe.eval_landing_gear_mass(ac) propulsion.eval_propulsion_mass(ac) propulsion.eval_battery_mass(ac) propulsion.eval_tank_data(ac) airplane.eval_system_mass(ac) airplane.eval_payload_mass(ac) airplane.eval_aircraft_weights(ac) y_out = np.array([x_in[0] - ac.weights.mlw, \ x_in[1] - ac.weights.mzfw]) return y_out #----------------------------------------------------------------------------------------------------------- n_pax_ref = aircraft.cabin.n_pax_ref design_range = aircraft.design_driver.design_range mtow_i = aircraft.weights.mtow mzfw_i = aircraft.weights.mzfw mlw_i = aircraft.weights.mlw x_ini = np.array([mlw_i, mzfw_i]) fct_arg = aircraft output_dict = fsolve(fct_mass, x0=x_ini, args=fct_arg, full_output=True) aircraft.weights.mlw = output_dict[0][0] # Coupling variable aircraft.weights.mzfw = output_dict[0][1] # Coupling variable # Update mass #------------------------------------------------------------------------------------------------------ airframe.eval_cabin_mass(aircraft) airframe.eval_fuselage_mass(aircraft) airframe.eval_vtp_mass(aircraft) airframe.eval_wing_mass(aircraft) airframe.eval_htp_mass(aircraft) airframe.eval_landing_gear_mass(aircraft) propulsion.eval_propulsion_mass(aircraft) propulsion.eval_battery_mass(aircraft) propulsion.eval_tank_data(aircraft) airplane.eval_system_mass(aircraft) airplane.eval_payload_mass(aircraft) airplane.eval_aircraft_weights(aircraft) airplane.eval_aircraft_cg(aircraft) return