diff --git a/trunk/SUAVE/Methods/Performance/V_h_diagram.py b/trunk/SUAVE/Methods/Performance/V_h_diagram.py deleted file mode 100644 index be370d46e1..0000000000 --- a/trunk/SUAVE/Methods/Performance/V_h_diagram.py +++ /dev/null @@ -1,117 +0,0 @@ -## @ingroup Methods-Performance -# V_n_diagram.py -# -# Created: Dec 2020, J. Smart -# Modified: - -#------------------------------------------------------------------------------ -# Imports -#------------------------------------------------------------------------------ - -from SUAVE.Core import Units, Data -from SUAVE.Analyses.Mission.Segments.Conditions import Aerodynamics, Numerics -from SUAVE.Methods.Aerodynamics.Fidelity_Zero.Lift import compute_max_lift_coeff - -import numpy as np -import matplotlib.pyplot as plt - -#------------------------------------------------------------------------------ -# Compute V-h Diagram -#------------------------------------------------------------------------------ - -def V_h_diagram(vehicle, - analyses, - load_factor = 1., - grid_points = 50., - altitude_ceiling = 5e4 * Units.ft, - max_speed = 500 * Units['m/s'] - ): - - """ - - Computes excess power contour for a given aircraft load factor (L/W) - and excess power, plotted over speed and altitude. - - - Source: - - Raymer, D. "Aircraft Design: A Conceptual Approach", 6th Edition - - Inputs: - - vehicle - .propulsors.battery_propeller - .design_thrust - .number_of_engines - - analyses - .atmosphere - - load_factor - - excess_power - - grid_points - - altitude_ceiling - - supersonic - - display_plot - - Outputs: - - excess_power - - Properties Used: - - - """ - - # Unpack Inputs - - atmo = analyses.atmosphere - T = (vehicle.propulsors.battery_propeller.propeller.design_thrust - * vehicle.propulsors.battery_propeller.number_of_engines) - W = vehicle.mass_properties.max_takeoff - S = vehicle.reference_area - - # Specify Altitude Range - - alt_range = np.linspace(0., altitude_ceiling, num=grid_points, endpoint=True) - - # Specify Airspeed Range - - speed_range = np.linspace(0., max_speed, num = grid_points, endpoint=False) - - # Initialize Excess Power and Climb Rate - - excess_power = np.zeros((grid_points, grid_points)) - climb_rate = np.zeros((grid_points, grid_points)) - - - for alt_idx in range(grid_points): - - atmo_data = atmo.compute_values(alt_range[alt_idx]) - - for speed_idx in range(grid_points): - - V = speed_range[speed_idx] - - excess_power[speed_idx, alt_idx] = V[T / W - V * 0.02 / (W / S) - load_factor ** 2 * (K / V) * (W / S)] - climb_rate[speed_idx, alt_idx] = (P-D*V)/w - - mach_space, alt_space = np.meshgrid(speed_range, alt_range) - - if display_plot: - - plt.contour(mach_space, alt_space, excess_power, levels = excess_power_contours) - plt.xlabel('Mach No.') - plt.ylabel('Altitude (ft.)') - plt.title('Excess Power') - plt.show() - - return excess_power, climb_rate - - - diff --git a/trunk/SUAVE/Methods/Performance/__init__.py b/trunk/SUAVE/Methods/Performance/__init__.py index 80f07e42a0..5ea93f9cf3 100644 --- a/trunk/SUAVE/Methods/Performance/__init__.py +++ b/trunk/SUAVE/Methods/Performance/__init__.py @@ -9,6 +9,4 @@ from .find_take_off_weight_given_tofl import find_take_off_weight_given_tofl from .V_n_diagram import V_n_diagram from .propeller_range_endurance_speeds import propeller_range_endurance_speeds, stall_speed -from .V_h_diagram import V_h_diagram -from .electric_payload_range import electric_payload_range diff --git a/trunk/SUAVE/Methods/Performance/electric_payload_range.py b/trunk/SUAVE/Methods/Performance/electric_payload_range.py deleted file mode 100644 index 2b370074a6..0000000000 --- a/trunk/SUAVE/Methods/Performance/electric_payload_range.py +++ /dev/null @@ -1,128 +0,0 @@ -## @ingroup Methods-Performance -# electric_payload_range.py -# -# Created: Dec 2020, J. Smart -# Modified: - -#------------------------------------------------------------------------------ -# Imports -#------------------------------------------------------------------------------ - -from SUAVE.Core import Units, Data - -import numpy as np -import matplotlib.pyplot as plt - -#------------------------------------------------------------------------------ -# Determine Max Payload Range and Ferry Range -#------------------------------------------------------------------------------ - -def electric_payload_range(vehicle, - mission, - cruise_segment_tag, - display_plot=True): - - """Calculates and plots a payload range diagram for an electric vehicle. - - Assumptions: - - Vehicle is defined with some combination of weight characteristics that - allow determination of maximum payload and zero-payload weight (Empty - weight, max takeoff, and max payload weight). Mission specified includes - an electric variable distance cruise segment. - - Source: - - N/A - - Inputs: - - vehicle.mass_properties. - operating_empty [kg] - max_payload [kg] - max_takeoff [kg] - - mission.segments. - cruise.variable_cruise_distance [Converge SOC] - .tag [String] - analyses.weights.vehicle.mass_properties.takeoff [kg] - - cruise_segment_tag: [String Match to Above] - - reserve_soc: [0-1, Percentage] - - display_plot [True/False] - - Outputs: - - payload_range. - range [m] - payload [m] - takeoff_weight [kg] - - Properties Used: - - N/A - """ - - # Unpack Weights - - masses = vehicle.mass_properties - - if not masses.operating_empty: - print("Error calculating Payload Range Diagram: vehicle Operating Empty Weight is undefined.") - return True - else: - OEW = masses.operating_empty - - if not masses.max_payload: - print("Error calculating Payload Range Diagram: vehicle Maximum Payload Weight is undefined.") - return True - else: - MaxPLD = masses.max_payload - - if not masses.max_takeoff: - print("Error calculating Payload Range Diagram: vehicle Maximum Payload Weight is undefined.") - return True - else: - MTOW = masses.max_takeoff - - # Define Diagram Points - # Point = [Value at Maximum Payload Range, Value at Ferry Range] - - TOW = [MTOW, OEW] # Takeoff Weights - PLD = [MaxPLD, 0.] # Payload Weights - - # Initialize Range Array - - R = np.zeros(2) - - for i in range(2): - mission.segments[0].analyses.weights.vehicle.mass_properties.takeoff = TOW[i] - results = mission.evaluate() - segment = results.segments[cruise_segment_tag] - R[i] = results.segments[-1].conditions.frames.inertial.position_vector[-1,0] - - # Insert Starting Point for Diagram Construction - - R.insert(0, 0) - PLD.insert(0, MaxPLD) - TOW.insert(0, 0) - - # Pack Results - - payload_range = Data() - payload_range.range = R - payload_range.payload = PLD - payload_range.takeoff_weight = TOW - - if display_plot: - - plt.plot(R, PLD, 'r') - plt.xlabel('Range (m)') - plt.ylabel('Payload (kg)') - plt.title('Payload Range Diagram') - plt.grid(True) - plt.show() - - return payload_range \ No newline at end of file