RCAIDE-GUI 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- common_widgets/__init__.py +6 -0
- common_widgets/animated_toggle.py +141 -0
- common_widgets/color.py +17 -0
- common_widgets/data_entry_widget.py +337 -0
- common_widgets/image_widget.py +21 -0
- common_widgets/unit_picker_widget.py +48 -0
- main.py +168 -0
- rcaide_gui-1.0.0.dist-info/METADATA +96 -0
- rcaide_gui-1.0.0.dist-info/RECORD +170 -0
- rcaide_gui-1.0.0.dist-info/WHEEL +5 -0
- rcaide_gui-1.0.0.dist-info/entry_points.txt +2 -0
- rcaide_gui-1.0.0.dist-info/top_level.txt +5 -0
- rcaide_io.py +818 -0
- tabs/__init__.py +10 -0
- tabs/aircraft_configs/__init__.py +3 -0
- tabs/aircraft_configs/aircraft_configs.py +301 -0
- tabs/analysis/__init__.py +4 -0
- tabs/analysis/analysis.py +92 -0
- tabs/analysis/widgets/__init__.py +13 -0
- tabs/analysis/widgets/aeroacoustics_widget.py +158 -0
- tabs/analysis/widgets/aerodynamics_widget.py +108 -0
- tabs/analysis/widgets/analysis_data_widget.py +29 -0
- tabs/analysis/widgets/atmosphere_widget.py +49 -0
- tabs/analysis/widgets/costs_widget.py +35 -0
- tabs/analysis/widgets/energy_widget.py +32 -0
- tabs/analysis/widgets/geometry_widget.py +55 -0
- tabs/analysis/widgets/planets_widget.py +34 -0
- tabs/analysis/widgets/propulsion_widget.py +53 -0
- tabs/analysis/widgets/stability_widget.py +34 -0
- tabs/analysis/widgets/weights_widget.py +94 -0
- tabs/geometry/__init__.py +6 -0
- tabs/geometry/aircraft_configs.py +232 -0
- tabs/geometry/frames/__init__.py +15 -0
- tabs/geometry/frames/booms/__init__.py +5 -0
- tabs/geometry/frames/booms/boom_frame.py +238 -0
- tabs/geometry/frames/cargo_bays/__init__.py +5 -0
- tabs/geometry/frames/cargo_bays/cargo_bay_frame.py +159 -0
- tabs/geometry/frames/default_frame.py +23 -0
- tabs/geometry/frames/energy_network/__init__.py +2 -0
- tabs/geometry/frames/energy_network/turbofan_network/__init__.py +3 -0
- tabs/geometry/frames/energy_network/turbofan_network/frames/__init__.py +1 -0
- tabs/geometry/frames/energy_network/turbofan_network/widgets/__init__.py +1 -0
- tabs/geometry/frames/fuselages/__init__.py +5 -0
- tabs/geometry/frames/fuselages/fuselage_frame.py +294 -0
- tabs/geometry/frames/geometry_frame.py +91 -0
- tabs/geometry/frames/landing_gears/__init__.py +5 -0
- tabs/geometry/frames/landing_gears/landing_gear_frame.py +189 -0
- tabs/geometry/frames/nacelles/__init__.py +1 -0
- tabs/geometry/frames/powertrain/__init__.py +6 -0
- tabs/geometry/frames/powertrain/converters/__init__.py +5 -0
- tabs/geometry/frames/powertrain/converters/converter_frame.py +137 -0
- tabs/geometry/frames/powertrain/distributors/__init__.py +5 -0
- tabs/geometry/frames/powertrain/distributors/distributor_frame.py +143 -0
- tabs/geometry/frames/powertrain/nacelles/__init__.py +5 -0
- tabs/geometry/frames/powertrain/nacelles/nacelle_frame.py +283 -0
- tabs/geometry/frames/powertrain/powertrain_frame.py +259 -0
- tabs/geometry/frames/powertrain/propulsors/__init__.py +5 -0
- tabs/geometry/frames/powertrain/propulsors/propulsor_frame.py +146 -0
- tabs/geometry/frames/powertrain/sources/__init__.py +6 -0
- tabs/geometry/frames/powertrain/sources/energy_source_frame.py +147 -0
- tabs/geometry/frames/vehicle_frame.py +171 -0
- tabs/geometry/frames/wings/__init__.py +5 -0
- tabs/geometry/frames/wings/wings_frame.py +457 -0
- tabs/geometry/geometry.py +513 -0
- tabs/geometry/widgets/__init__.py +12 -0
- tabs/geometry/widgets/booms/__init__.py +6 -0
- tabs/geometry/widgets/booms/boom_section_widget.py +109 -0
- tabs/geometry/widgets/cargo_bays/__init__.py +1 -0
- tabs/geometry/widgets/fuselages/__init__.py +8 -0
- tabs/geometry/widgets/fuselages/cabin_class_widget.py +188 -0
- tabs/geometry/widgets/fuselages/cabin_widget.py +217 -0
- tabs/geometry/widgets/fuselages/fuselage_section_widget.py +190 -0
- tabs/geometry/widgets/geometry_data_widget.py +25 -0
- tabs/geometry/widgets/landing_gears/__init__.py +6 -0
- tabs/geometry/widgets/nacelles/__init__.py +1 -0
- tabs/geometry/widgets/powertrain/__init__.py +9 -0
- tabs/geometry/widgets/powertrain/converters/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/converters/turboelectric_generator_widget.py +74 -0
- tabs/geometry/widgets/powertrain/distributors/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/distributors/fuel_line_widget.py +81 -0
- tabs/geometry/widgets/powertrain/modulators/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/modulators/esc_widget.py +58 -0
- tabs/geometry/widgets/powertrain/nacelles/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/nacelles/nacelle_section_widget.py +115 -0
- tabs/geometry/widgets/powertrain/powertrain_connector_widget.py +136 -0
- tabs/geometry/widgets/powertrain/powertrain_widget.py +206 -0
- tabs/geometry/widgets/powertrain/propulsors/__init__.py +5 -0
- tabs/geometry/widgets/powertrain/propulsors/turbofan_widget.py +462 -0
- tabs/geometry/widgets/powertrain/sources/__init__.py +6 -0
- tabs/geometry/widgets/powertrain/sources/fuel_tank_widget.py +103 -0
- tabs/geometry/widgets/powertrain/sources/source_selector_widget.py +35 -0
- tabs/geometry/widgets/wings/__init__.py +7 -0
- tabs/geometry/widgets/wings/wing_cs_widget.py +198 -0
- tabs/geometry/widgets/wings/wing_section_widget.py +298 -0
- tabs/home/__init__.py +3 -0
- tabs/home/home.py +585 -0
- tabs/mission/__init__.py +4 -0
- tabs/mission/mission.py +1124 -0
- tabs/mission/widgets/__init__.py +3 -0
- tabs/mission/widgets/flight_controls_widget.py +186 -0
- tabs/mission/widgets/mission_analysis_widget.py +166 -0
- tabs/mission/widgets/mission_segment_helper.py +358 -0
- tabs/mission/widgets/mission_segment_widget.py +358 -0
- tabs/solve/__init__.py +4 -0
- tabs/solve/plots/__init__.py +12 -0
- tabs/solve/plots/aeroacoustics/__init__.py +6 -0
- tabs/solve/plots/aeroacoustics/plot_2D_noise_contour.py +184 -0
- tabs/solve/plots/aeroacoustics/plot_3D_noise_contour.py +219 -0
- tabs/solve/plots/aeroacoustics/plot_noise_certification_contour.py +115 -0
- tabs/solve/plots/aeroacoustics/plot_noise_level.py +118 -0
- tabs/solve/plots/aerodynamics/__init__.py +10 -0
- tabs/solve/plots/aerodynamics/plot_aerodynamic_coefficients.py +156 -0
- tabs/solve/plots/aerodynamics/plot_aerodynamic_forces.py +155 -0
- tabs/solve/plots/aerodynamics/plot_aircraft_aerodynamics.py +136 -0
- tabs/solve/plots/aerodynamics/plot_drag_components.py +157 -0
- tabs/solve/plots/aerodynamics/plot_lift_distribution.py +107 -0
- tabs/solve/plots/aerodynamics/plot_rotor_conditions.py +255 -0
- tabs/solve/plots/aerodynamics/plot_rotor_disc_performance.py +144 -0
- tabs/solve/plots/aerodynamics/plot_rotor_performance.py +124 -0
- tabs/solve/plots/common/__init__.py +4 -0
- tabs/solve/plots/common/plot_style.py +71 -0
- tabs/solve/plots/common/set_axes.py +55 -0
- tabs/solve/plots/create_plot_widgets.py +34 -0
- tabs/solve/plots/emissions/__init__.py +3 -0
- tabs/solve/plots/emissions/plot_emissions.py +167 -0
- tabs/solve/plots/energy/__init__.py +12 -0
- tabs/solve/plots/energy/plot_altitude_sfc_weight.py +134 -0
- tabs/solve/plots/energy/plot_battery_cell_conditions.py +154 -0
- tabs/solve/plots/energy/plot_battery_degradation.py +157 -0
- tabs/solve/plots/energy/plot_battery_module_C_rates.py +139 -0
- tabs/solve/plots/energy/plot_battery_module_conditions.py +157 -0
- tabs/solve/plots/energy/plot_battery_pack_conditions.py +164 -0
- tabs/solve/plots/energy/plot_battery_ragone_diagram.py +97 -0
- tabs/solve/plots/energy/plot_battery_temperature.py +136 -0
- tabs/solve/plots/energy/plot_electric_propulsor_efficiencies.py +136 -0
- tabs/solve/plots/energy/plot_propulsor_throttles.py +119 -0
- tabs/solve/plots/mission/__init__.py +5 -0
- tabs/solve/plots/mission/plot_aircraft_velocities.py +145 -0
- tabs/solve/plots/mission/plot_flight_conditions.py +236 -0
- tabs/solve/plots/mission/plot_flight_trajectory.py +172 -0
- tabs/solve/plots/stability/__init__.py +5 -0
- tabs/solve/plots/stability/plot_flight_forces_and_moments.py +163 -0
- tabs/solve/plots/stability/plot_lateral_stability.py +151 -0
- tabs/solve/plots/stability/plot_longitudinal_stability.py +173 -0
- tabs/solve/plots/thermal_management/__init__.py +7 -0
- tabs/solve/plots/thermal_management/plot_air_cooled_conditions.py +152 -0
- tabs/solve/plots/thermal_management/plot_cross_flow_heat_exchanger_conditions.py +185 -0
- tabs/solve/plots/thermal_management/plot_reservoir_conditions.py +141 -0
- tabs/solve/plots/thermal_management/plot_thermal_management_performance.py +105 -0
- tabs/solve/plots/thermal_management/plot_wavy_channel_conditions.py +161 -0
- tabs/solve/plots/weights/__init__.py +4 -0
- tabs/solve/plots/weights/plot_load_diagram.py +163 -0
- tabs/solve/plots/weights/plot_weight_breakdown.py +164 -0
- tabs/solve/solve.py +1498 -0
- tabs/style_sheet.py +114 -0
- tabs/tab_widget.py +14 -0
- tabs/visualize_geometry/__init__.py +4 -0
- tabs/visualize_geometry/core_3d_viewer.py +253 -0
- tabs/visualize_geometry/features/__init__.py +10 -0
- tabs/visualize_geometry/features/axes_gizmo.py +173 -0
- tabs/visualize_geometry/features/background.py +161 -0
- tabs/visualize_geometry/features/blueprint.py +685 -0
- tabs/visualize_geometry/features/camera.py +364 -0
- tabs/visualize_geometry/features/drag_aircraft.py +219 -0
- tabs/visualize_geometry/features/grid.py +194 -0
- tabs/visualize_geometry/features/measurement.py +367 -0
- tabs/visualize_geometry/features/screenshot.py +91 -0
- tabs/visualize_geometry/geometry_helper_functions.py +3 -0
- tabs/visualize_geometry/visualize_geometry.py +731 -0
- utilities.py +257 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# RCAIDE_GUI/tabs/solve/plots/aerodynamics/plot_rotor_conditions.py
|
|
2
|
+
|
|
3
|
+
# RCAIDE imports
|
|
4
|
+
from RCAIDE.Framework.Core import Units
|
|
5
|
+
from RCAIDE.Library.Plots.Common import set_axes, plot_style
|
|
6
|
+
|
|
7
|
+
# Python imports
|
|
8
|
+
import matplotlib.pyplot as plt
|
|
9
|
+
import matplotlib.cm as cm
|
|
10
|
+
import numpy as np
|
|
11
|
+
|
|
12
|
+
# ------------------------------------------------------------------------------
|
|
13
|
+
# Plot Rotor Conditions
|
|
14
|
+
# ------------------------------------------------------------------------------
|
|
15
|
+
def plot_rotor_conditions(results,
|
|
16
|
+
save_figure = False,
|
|
17
|
+
show_legend=True,
|
|
18
|
+
save_filename = "Rotor_Conditions",
|
|
19
|
+
file_type = ".png",
|
|
20
|
+
width = 11, height = 7):
|
|
21
|
+
"""
|
|
22
|
+
Generate plots of key rotor operating conditions over time.
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
results : Data
|
|
27
|
+
Mission results data structure containing:
|
|
28
|
+
- results.segments[0].analyses.vehicle.networks
|
|
29
|
+
|
|
30
|
+
save_figure : bool, optional
|
|
31
|
+
Save figure to file if True, default False
|
|
32
|
+
|
|
33
|
+
show_legend : bool, optional
|
|
34
|
+
Display segment legend if True, default True
|
|
35
|
+
|
|
36
|
+
save_filename : str, optional
|
|
37
|
+
Name for saved figure file, default "Rotor_Conditions"
|
|
38
|
+
|
|
39
|
+
file_type : str, optional
|
|
40
|
+
File extension for saved figure, default ".png"
|
|
41
|
+
|
|
42
|
+
width : float, optional
|
|
43
|
+
Figure width in inches, default 11
|
|
44
|
+
|
|
45
|
+
height : float, optional
|
|
46
|
+
Figure height in inches, default 7
|
|
47
|
+
|
|
48
|
+
Returns
|
|
49
|
+
-------
|
|
50
|
+
fig : matplotlib.figure.Figure
|
|
51
|
+
|
|
52
|
+
Notes
|
|
53
|
+
-----
|
|
54
|
+
Creates a 2x2 subplot figure showing:
|
|
55
|
+
- Top left: RPM vs time (minutes)
|
|
56
|
+
- Top right: Rotor tilt angle (degrees) vs time
|
|
57
|
+
- Bottom left: Thrust (N) vs time
|
|
58
|
+
- Bottom right: Torque (N-m) vs time
|
|
59
|
+
|
|
60
|
+
Each mission segment uses a different color from the inferno colormap.
|
|
61
|
+
Multiple rotors are distinguished by different markers.
|
|
62
|
+
|
|
63
|
+
**Definitions**
|
|
64
|
+
|
|
65
|
+
'RPM'
|
|
66
|
+
Rotor rotational speed in revolutions per minute
|
|
67
|
+
|
|
68
|
+
'Thrust Vector Angle'
|
|
69
|
+
Angle between rotor thrust vector and vertical
|
|
70
|
+
|
|
71
|
+
See Also
|
|
72
|
+
--------
|
|
73
|
+
RCAIDE.Library.Plots.Common.set_axes : Standardized axis formatting
|
|
74
|
+
RCAIDE.Library.Plots.Common.plot_style : RCAIDE plot styling
|
|
75
|
+
RCAIDE.Library.Analysis.Performance.propulsion : Analysis modules
|
|
76
|
+
"""
|
|
77
|
+
save_filename_1 = save_filename + '_1'
|
|
78
|
+
save_filename_2 = save_filename + '_2'
|
|
79
|
+
|
|
80
|
+
# get plotting style
|
|
81
|
+
ps = plot_style()
|
|
82
|
+
|
|
83
|
+
parameters = {'axes.labelsize': ps.axis_font_size,
|
|
84
|
+
'xtick.labelsize': ps.axis_font_size,
|
|
85
|
+
'ytick.labelsize': ps.axis_font_size,
|
|
86
|
+
'axes.titlesize': ps.title_font_size}
|
|
87
|
+
plt.rcParams.update(parameters)
|
|
88
|
+
|
|
89
|
+
# get line colors for plots
|
|
90
|
+
line_colors = cm.inferno(np.linspace(0,0.9,len(results.segments)))
|
|
91
|
+
|
|
92
|
+
fig_1 = plt.figure(save_filename_1)
|
|
93
|
+
fig_1.set_size_inches(width,height)
|
|
94
|
+
axis_1_1 = fig_1.add_subplot(2,2,1)
|
|
95
|
+
axis_1_2 = fig_1.add_subplot(2,2,2)
|
|
96
|
+
axis_1_3 = fig_1.add_subplot(2,2,3)
|
|
97
|
+
axis_1_4 = fig_1.add_subplot(2,2,4)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
fig_2 = plt.figure(save_filename_2)
|
|
101
|
+
fig_2.set_size_inches(width,height)
|
|
102
|
+
axis_2_1 = fig_2.add_subplot(2,2,1)
|
|
103
|
+
axis_2_2 = fig_2.add_subplot(2,2,2)
|
|
104
|
+
axis_2_3 = fig_2.add_subplot(2,2,3)
|
|
105
|
+
axis_2_4 = fig_2.add_subplot(2,2,4)
|
|
106
|
+
|
|
107
|
+
for network in results.segments[0].analyses.vehicle.networks:
|
|
108
|
+
for p_i, propulsor in enumerate(network.propulsors):
|
|
109
|
+
if (p_i == 0) or (network.identical_propulsors == False):
|
|
110
|
+
plot_propulsor_data(results,propulsor, axis_1_1, axis_1_2, axis_1_3, axis_1_4, axis_2_1, axis_2_2, axis_2_3, axis_2_4,line_colors,ps,p_i)
|
|
111
|
+
|
|
112
|
+
if show_legend:
|
|
113
|
+
leg = fig_1.legend(bbox_to_anchor=(0.5, 0.95), loc='upper center', ncol = 4)
|
|
114
|
+
leg.set_title('Flight Segment', prop={'size': ps.legend_font_size, 'weight': 'heavy'})
|
|
115
|
+
leg = fig_2.legend(bbox_to_anchor=(0.5, 0.95), loc='upper center', ncol = 4)
|
|
116
|
+
leg.set_title('Flight Segment', prop={'size': ps.legend_font_size, 'weight': 'heavy'})
|
|
117
|
+
|
|
118
|
+
# Adjusting the sub-plots for legend
|
|
119
|
+
fig_1.tight_layout()
|
|
120
|
+
fig_1.subplots_adjust(top=0.8)
|
|
121
|
+
fig_2.tight_layout()
|
|
122
|
+
fig_2.subplots_adjust(top=0.8)
|
|
123
|
+
|
|
124
|
+
# set title of plot
|
|
125
|
+
title_text = 'Rotor Performance'
|
|
126
|
+
fig_1.suptitle(title_text)
|
|
127
|
+
fig_2.suptitle(title_text)
|
|
128
|
+
if save_figure:
|
|
129
|
+
plt.savefig(save_filename_1 + file_type)
|
|
130
|
+
plt.savefig(save_filename_2 + file_type)
|
|
131
|
+
|
|
132
|
+
return (fig_1, fig_2)
|
|
133
|
+
|
|
134
|
+
def plot_propulsor_data(results, propulsor, axis_1_1, axis_1_2, axis_1_3, axis_1_4, axis_2_1, axis_2_2, axis_2_3, axis_2_4, line_colors, ps, p_i):
|
|
135
|
+
"""
|
|
136
|
+
Plot operating conditions data for a single propulsor across mission segments.
|
|
137
|
+
|
|
138
|
+
Parameters
|
|
139
|
+
----------
|
|
140
|
+
results : Data
|
|
141
|
+
Mission results data structure containing:
|
|
142
|
+
- results.segments[i].conditions with fields:
|
|
143
|
+
- energy[propulsor_tag][thrustor_tag].rpm
|
|
144
|
+
- energy[propulsor_tag][thrustor_tag].thrust
|
|
145
|
+
- energy[propulsor_tag][thrustor_tag].torque
|
|
146
|
+
- energy[propulsor_tag].commanded_thrust_vector_angle
|
|
147
|
+
- frames.inertial.time
|
|
148
|
+
|
|
149
|
+
propulsor : Data
|
|
150
|
+
Propulsor data structure containing:
|
|
151
|
+
- tag : str
|
|
152
|
+
Identifier for the propulsor
|
|
153
|
+
- rotor/propeller : Data
|
|
154
|
+
Thrustor component data
|
|
155
|
+
|
|
156
|
+
axis_1 : matplotlib.axes.Axes
|
|
157
|
+
Axis for RPM plot
|
|
158
|
+
|
|
159
|
+
axis_2 : matplotlib.axes.Axes
|
|
160
|
+
Axis for rotor angle plot
|
|
161
|
+
|
|
162
|
+
axis_3 : matplotlib.axes.Axes
|
|
163
|
+
Axis for thrust plot
|
|
164
|
+
|
|
165
|
+
axis_4 : matplotlib.axes.Axes
|
|
166
|
+
Axis for torque plot
|
|
167
|
+
|
|
168
|
+
line_colors : array
|
|
169
|
+
Array of RGB colors for different segments
|
|
170
|
+
|
|
171
|
+
ps : Data
|
|
172
|
+
Plot style data structure with fields:
|
|
173
|
+
- markers : list
|
|
174
|
+
Marker styles for different propulsors
|
|
175
|
+
- line_width : float
|
|
176
|
+
Width for plot lines
|
|
177
|
+
|
|
178
|
+
p_i : int
|
|
179
|
+
Index of current propulsor for marker selection
|
|
180
|
+
|
|
181
|
+
Returns
|
|
182
|
+
-------
|
|
183
|
+
None
|
|
184
|
+
|
|
185
|
+
Notes
|
|
186
|
+
-----
|
|
187
|
+
Helper function for plot_rotor_conditions that handles plotting
|
|
188
|
+
data for a single propulsor (rotor or propeller) across all mission
|
|
189
|
+
segments.
|
|
190
|
+
|
|
191
|
+
The function:
|
|
192
|
+
- Identifies thrustor type (rotor vs propeller)
|
|
193
|
+
- Extracts time histories for each segment
|
|
194
|
+
- Plots RPM, angle, thrust, and torque vs time
|
|
195
|
+
- Applies consistent styling
|
|
196
|
+
- Adds legend for first segment only
|
|
197
|
+
- Converts units as needed (time to minutes, angles to degrees)
|
|
198
|
+
|
|
199
|
+
See Also
|
|
200
|
+
--------
|
|
201
|
+
RCAIDE.Library.Plots.Aerodynamics.plot_rotor_conditions : Main plotting function
|
|
202
|
+
"""
|
|
203
|
+
if 'rotor' in propulsor:
|
|
204
|
+
thrustor = propulsor.rotor
|
|
205
|
+
elif 'propeller' in propulsor:
|
|
206
|
+
thrustor = propulsor.propeller
|
|
207
|
+
|
|
208
|
+
for i in range(len(results.segments)):
|
|
209
|
+
time = results.segments[i].conditions.frames.inertial.time[:,0] / Units.min
|
|
210
|
+
rpm = results.segments[i].conditions.energy.converters[thrustor.tag].rpm[:,0]
|
|
211
|
+
eta = results.segments[i].conditions.energy.converters[thrustor.tag].efficiency[:,0]
|
|
212
|
+
angle = results.segments[i].conditions.energy.converters[thrustor.tag].commanded_thrust_vector_angle[:,0]
|
|
213
|
+
beta = results.segments[i].conditions.energy.converters[thrustor.tag].blade_pitch_command[:,0]
|
|
214
|
+
DL = results.segments[i].conditions.energy.converters[thrustor.tag].disc_loading[:,0]
|
|
215
|
+
PL = results.segments[i].conditions.energy.converters[thrustor.tag].power_loading[:,0]
|
|
216
|
+
thrust = np.linalg.norm(results.segments[i].conditions.energy.converters[thrustor.tag].thrust , axis =1)
|
|
217
|
+
torque = results.segments[i].conditions.energy.converters[thrustor.tag].torque[:,0]
|
|
218
|
+
if p_i == 0 and i ==0:
|
|
219
|
+
axis_1_1.plot(time,DL, color = line_colors[i], marker = ps.markers[p_i], linewidth = ps.line_width, label = thrustor.tag)
|
|
220
|
+
axis_2_1.plot(time,rpm, color = line_colors[i], marker = ps.markers[p_i] , linewidth = ps.line_width, label = thrustor.tag)
|
|
221
|
+
else:
|
|
222
|
+
axis_1_1.plot(time,DL, color = line_colors[i], marker = ps.markers[p_i], linewidth = ps.line_width)
|
|
223
|
+
axis_2_1.plot(time,rpm, color = line_colors[i], marker = ps.markers[p_i] , linewidth = ps.line_width)
|
|
224
|
+
|
|
225
|
+
axis_1_1.set_ylabel(r'Disc Loading (N/m^2)')
|
|
226
|
+
set_axes(axis_1_1)
|
|
227
|
+
axis_2_1.set_ylabel(r'RPM')
|
|
228
|
+
set_axes(axis_2_1)
|
|
229
|
+
|
|
230
|
+
axis_1_2.plot(time,PL, color = line_colors[i], marker = ps.markers[p_i], linewidth = ps.line_width)
|
|
231
|
+
axis_1_2.set_xlabel('Time (mins)')
|
|
232
|
+
axis_1_2.set_ylabel(r'Power Loading (N/W)')
|
|
233
|
+
set_axes(axis_1_2)
|
|
234
|
+
|
|
235
|
+
axis_1_3.plot(time,thrust, color = line_colors[i], marker = ps.markers[p_i] , linewidth = ps.line_width)
|
|
236
|
+
axis_1_3.set_ylabel(r'Thrust (N)')
|
|
237
|
+
set_axes(axis_1_3)
|
|
238
|
+
|
|
239
|
+
axis_1_4.plot(time,torque, color = line_colors[i], marker = ps.markers[p_i] , linewidth = ps.line_width)
|
|
240
|
+
axis_1_4.set_ylabel(r'Torque (N-m)')
|
|
241
|
+
set_axes(axis_1_4)
|
|
242
|
+
|
|
243
|
+
axis_2_2.plot(time, angle/Units.degrees, color = line_colors[i], marker = ps.markers[p_i] , linewidth = ps.line_width)
|
|
244
|
+
axis_2_2.set_ylabel(r'Thrust Vector (deg)')
|
|
245
|
+
set_axes(axis_2_2)
|
|
246
|
+
|
|
247
|
+
axis_2_3.plot(time,beta, color = line_colors[i], marker = ps.markers[p_i] , linewidth = ps.line_width)
|
|
248
|
+
axis_2_3.set_ylabel(r'Pitch Command (deg)')
|
|
249
|
+
set_axes(axis_2_3)
|
|
250
|
+
|
|
251
|
+
axis_2_4.plot(time,eta, color = line_colors[i], marker = ps.markers[p_i] , linewidth = ps.line_width)
|
|
252
|
+
axis_2_4.set_ylabel(r'Efficiency')
|
|
253
|
+
set_axes(axis_2_4)
|
|
254
|
+
|
|
255
|
+
return
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# RCAIDE_GUI/tabs/solve/plots/aerodynamics/plot_rotor_disc_performance.py
|
|
2
|
+
|
|
3
|
+
# RCAIDE imports
|
|
4
|
+
from RCAIDE.Framework.Core import Units
|
|
5
|
+
|
|
6
|
+
# Python imports
|
|
7
|
+
import matplotlib.pyplot as plt
|
|
8
|
+
import numpy as np
|
|
9
|
+
|
|
10
|
+
# ------------------------------------------------------------------------------
|
|
11
|
+
# Plot Rotor Disc Performance
|
|
12
|
+
# ------------------------------------------------------------------------------
|
|
13
|
+
def plot_rotor_disc_performance(prop, outputs, i=0, title=None, save_figure=False):
|
|
14
|
+
"""
|
|
15
|
+
Generate plots of rotor disc aerodynamic performance distributions.
|
|
16
|
+
|
|
17
|
+
Parameters
|
|
18
|
+
----------
|
|
19
|
+
prop : Data
|
|
20
|
+
Rotor properties data structure
|
|
21
|
+
|
|
22
|
+
outputs : Data
|
|
23
|
+
Rotor analysis outputs containing:
|
|
24
|
+
|
|
25
|
+
- disc_azimuthal_distribution : array
|
|
26
|
+
Azimuthal angles around disc [rad]
|
|
27
|
+
- disc_radial_distribution : array
|
|
28
|
+
Radial positions on disc [m]
|
|
29
|
+
- disc_thrust_distribution : array
|
|
30
|
+
Local thrust distribution
|
|
31
|
+
- disc_torque_distribution : array
|
|
32
|
+
Local torque distribution
|
|
33
|
+
- disc_effective_angle_of_attack : array
|
|
34
|
+
Local effective angle of attack [rad]
|
|
35
|
+
- disc_axial_induced_velocity : array
|
|
36
|
+
Local axial induced velocity [m/s]
|
|
37
|
+
- disc_tangential_induced_velocity : array
|
|
38
|
+
Local tangential induced velocity [m/s]
|
|
39
|
+
|
|
40
|
+
i : int, optional
|
|
41
|
+
Time index for plotting, default 0
|
|
42
|
+
|
|
43
|
+
title : str, optional
|
|
44
|
+
Custom plot title, default None
|
|
45
|
+
|
|
46
|
+
save_figure : bool, optional
|
|
47
|
+
Save figure to file if True, default False
|
|
48
|
+
|
|
49
|
+
Returns
|
|
50
|
+
-------
|
|
51
|
+
fig : matplotlib.figure.Figure
|
|
52
|
+
Figure containing five polar subplots:
|
|
53
|
+
|
|
54
|
+
- Thrust distribution
|
|
55
|
+
- Torque distribution
|
|
56
|
+
- Local blade angle
|
|
57
|
+
- Axial velocity
|
|
58
|
+
- Tangential velocity
|
|
59
|
+
|
|
60
|
+
Notes
|
|
61
|
+
-----
|
|
62
|
+
All plots use:
|
|
63
|
+
|
|
64
|
+
- Polar coordinates (azimuth, radius)
|
|
65
|
+
- Jet colormap for contours
|
|
66
|
+
- Consistent number of contour levels
|
|
67
|
+
- Colorbar showing scale
|
|
68
|
+
|
|
69
|
+
**Definitions**
|
|
70
|
+
|
|
71
|
+
'Thrust Distribution'
|
|
72
|
+
Local thrust force per unit area
|
|
73
|
+
|
|
74
|
+
'Torque Distribution'
|
|
75
|
+
Local torque per unit area
|
|
76
|
+
|
|
77
|
+
'Effective Angle'
|
|
78
|
+
Local blade angle relative to inflow
|
|
79
|
+
|
|
80
|
+
'Induced Velocity'
|
|
81
|
+
Flow velocity induced by rotor
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
# Now plotting:
|
|
85
|
+
psi = outputs.disc_azimuthal_distribution[i,:,:]
|
|
86
|
+
r = outputs.disc_radial_distribution[i,:,:]
|
|
87
|
+
psi = np.append(psi,np.atleast_2d(np.ones_like(psi[:,0])).T*2*np.pi,axis=1)
|
|
88
|
+
r = np.append(r,np.atleast_2d(r[:,0]).T,axis=1)
|
|
89
|
+
|
|
90
|
+
T = outputs.disc_thrust_distribution[i]
|
|
91
|
+
Q = outputs.disc_torque_distribution[i]
|
|
92
|
+
alf = (outputs.disc_effective_angle_of_attack[i])/Units.deg
|
|
93
|
+
va = outputs.disc_axial_induced_velocity[i]
|
|
94
|
+
vt = outputs.disc_tangential_induced_velocity[i]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
T = np.append(T,np.atleast_2d(T[:,0]).T,axis=1)
|
|
98
|
+
Q = np.append(Q,np.atleast_2d(Q[:,0]).T,axis=1)
|
|
99
|
+
alf = np.append(alf,np.atleast_2d(alf[:,0]).T,axis=1)
|
|
100
|
+
|
|
101
|
+
va = np.append(va, np.atleast_2d(va[:,0]).T, axis=1)
|
|
102
|
+
vt = np.append(vt, np.atleast_2d(vt[:,0]).T, axis=1)
|
|
103
|
+
|
|
104
|
+
lev = 101
|
|
105
|
+
cm = 'jet'
|
|
106
|
+
|
|
107
|
+
# plot the grid point velocities
|
|
108
|
+
fig = plt.figure(figsize=(12,8))
|
|
109
|
+
ax0 = fig.add_subplot(231, polar=True)
|
|
110
|
+
p0 = ax0.contourf(psi, r, T,lev,cmap=cm)
|
|
111
|
+
ax0.set_title('Thrust Distribution',pad=15)
|
|
112
|
+
ax0.set_rorigin(0)
|
|
113
|
+
ax0.set_yticklabels([])
|
|
114
|
+
plt.colorbar(p0, ax=ax0)
|
|
115
|
+
|
|
116
|
+
ax1 = fig.add_subplot(232, polar=True)
|
|
117
|
+
p1 = ax1.contourf(psi, r, Q,lev,cmap=cm)
|
|
118
|
+
ax1.set_title('Torque Distribution',pad=15)
|
|
119
|
+
ax1.set_rorigin(0)
|
|
120
|
+
ax1.set_yticklabels([])
|
|
121
|
+
plt.colorbar(p1, ax=ax1)
|
|
122
|
+
|
|
123
|
+
ax2 = fig.add_subplot(233, polar=True)
|
|
124
|
+
p2 = ax2.contourf(psi, r, alf,lev,cmap=cm)
|
|
125
|
+
ax2.set_title('Local Blade Angle (deg)',pad=15)
|
|
126
|
+
ax2.set_rorigin(0)
|
|
127
|
+
ax2.set_yticklabels([])
|
|
128
|
+
plt.colorbar(p2, ax=ax2)
|
|
129
|
+
|
|
130
|
+
ax3 = fig.add_subplot(234, polar=True)
|
|
131
|
+
p3 = ax3.contourf(psi, r, va,lev,cmap=cm)
|
|
132
|
+
ax3.set_title('Axial Velocity',pad=15)
|
|
133
|
+
ax3.set_rorigin(0)
|
|
134
|
+
ax3.set_yticklabels([])
|
|
135
|
+
plt.colorbar(p3, ax=ax3)
|
|
136
|
+
|
|
137
|
+
ax4 = fig.add_subplot(235, polar=True)
|
|
138
|
+
p4 = ax4.contourf(psi, r, vt,lev,cmap=cm)
|
|
139
|
+
ax4.set_title('Tangential Velocity',pad=15)
|
|
140
|
+
ax4.set_rorigin(0)
|
|
141
|
+
ax4.set_yticklabels([])
|
|
142
|
+
plt.colorbar(p4, ax=ax4)
|
|
143
|
+
|
|
144
|
+
return fig
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# RCAIDE_GUI/tabs/solve/plots/aerodynamics/plot_rotor_performance.py
|
|
2
|
+
|
|
3
|
+
# Python imports
|
|
4
|
+
import pandas as pd
|
|
5
|
+
import plotly.graph_objects as go
|
|
6
|
+
from plotly.subplots import make_subplots
|
|
7
|
+
|
|
8
|
+
# ------------------------------------------------------------------------------
|
|
9
|
+
# Plot Rotor Performance
|
|
10
|
+
# ------------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
def plot_rotor_performance(rotor, outputs,title=None, show_figure = True, save_figure=False, save_filename='Rotor_Performance', file_type=".png"):
|
|
13
|
+
"""
|
|
14
|
+
Generate plots summarizing rotor aerodynamic performance distributions.
|
|
15
|
+
|
|
16
|
+
Parameters
|
|
17
|
+
----------
|
|
18
|
+
rotor : Data
|
|
19
|
+
Rotor data structure containing outputs with fields:
|
|
20
|
+
|
|
21
|
+
- disc_radial_distribution : array
|
|
22
|
+
Radial positions on disc [m]
|
|
23
|
+
- disc_axial_velocity : array
|
|
24
|
+
Total axial velocity [m/s]
|
|
25
|
+
- disc_tangential_velocity : array
|
|
26
|
+
Total tangential velocity [m/s]
|
|
27
|
+
- disc_axial_induced_velocity : array
|
|
28
|
+
Induced axial velocity [m/s]
|
|
29
|
+
- disc_tangential_induced_velocity : array
|
|
30
|
+
Induced tangential velocity [m/s]
|
|
31
|
+
- disc_thrust_distribution : array
|
|
32
|
+
Local thrust distribution [N]
|
|
33
|
+
- disc_torque_distribution : array
|
|
34
|
+
Local torque distribution [N-m]
|
|
35
|
+
|
|
36
|
+
title : str, optional
|
|
37
|
+
Custom plot title, default None
|
|
38
|
+
|
|
39
|
+
show_figure : bool, optional
|
|
40
|
+
Display figure if True, default True
|
|
41
|
+
|
|
42
|
+
save_figure : bool, optional
|
|
43
|
+
Save figure to file if True, default False
|
|
44
|
+
|
|
45
|
+
save_filename : str, optional
|
|
46
|
+
Name for saved figure file, default 'Rotor_Performance'
|
|
47
|
+
|
|
48
|
+
file_type : str, optional
|
|
49
|
+
File extension for saved figure, default ".png"
|
|
50
|
+
|
|
51
|
+
Returns
|
|
52
|
+
-------
|
|
53
|
+
fig : matplotlib.figure.Figure
|
|
54
|
+
Figure containing four subplots:
|
|
55
|
+
|
|
56
|
+
- Velocity distributions
|
|
57
|
+
- Induced velocity distributions
|
|
58
|
+
- Thrust distribution
|
|
59
|
+
- Torque distribution
|
|
60
|
+
|
|
61
|
+
Notes
|
|
62
|
+
-----
|
|
63
|
+
Each subplot includes:
|
|
64
|
+
|
|
65
|
+
- Appropriate axis labels
|
|
66
|
+
- Legend identifying components
|
|
67
|
+
- Consistent line styling
|
|
68
|
+
|
|
69
|
+
**Definitions**
|
|
70
|
+
|
|
71
|
+
'Total Velocity'
|
|
72
|
+
Sum of freestream and induced velocities
|
|
73
|
+
|
|
74
|
+
'Induced Velocity'
|
|
75
|
+
Additional velocity induced by rotor
|
|
76
|
+
|
|
77
|
+
'Thrust Distribution'
|
|
78
|
+
Local thrust force per unit radius
|
|
79
|
+
|
|
80
|
+
'Torque Distribution'
|
|
81
|
+
Local torque per unit radius
|
|
82
|
+
|
|
83
|
+
See Also
|
|
84
|
+
--------
|
|
85
|
+
plot_rotor_disc_performance : Detailed disc visualization
|
|
86
|
+
"""
|
|
87
|
+
# unpack
|
|
88
|
+
r_distribution = outputs.disc_radial_distribution[0, :, 0]
|
|
89
|
+
|
|
90
|
+
# 2d plots
|
|
91
|
+
fig = make_subplots(rows=2, cols=2)
|
|
92
|
+
|
|
93
|
+
df1a = pd.DataFrame(dict(x=r_distribution, y=outputs.disc_axial_velocity[0, :, 0])) # label='Axial'
|
|
94
|
+
df1b = pd.DataFrame(dict(x=r_distribution, y=outputs.disc_tangential_velocity[0, :, 0])) # label='Tangential'
|
|
95
|
+
df2a = pd.DataFrame(dict(x=r_distribution, y=outputs.disc_axial_induced_velocity[0, :, 0])) # label='Axial'
|
|
96
|
+
df2b = pd.DataFrame(dict(x=r_distribution, y=outputs.disc_tangential_induced_velocity[0, :, 0])) # label='Tangential'
|
|
97
|
+
df3 = pd.DataFrame(dict(x=r_distribution, y=outputs.disc_thrust_distribution[0, :, 0]))
|
|
98
|
+
df4 = pd.DataFrame(dict(x=r_distribution, y=outputs.disc_torque_distribution[0, :, 0]))
|
|
99
|
+
|
|
100
|
+
fig.append_trace(go.Line(df1a, name='Axial', legendgroup='1',showlegend=True), row=1, col=1)
|
|
101
|
+
fig.append_trace(go.Line(df1b, name='Tangential', legendgroup='1',showlegend=True), row=1, col=1)
|
|
102
|
+
fig.append_trace(go.Line(df2a, name='Axial', legendgroup='2',showlegend=True), row=1, col=2)
|
|
103
|
+
fig.append_trace(go.Line(df2b, name='Tangential', legendgroup='2',showlegend=True), row=1, col=2)
|
|
104
|
+
fig.append_trace(go.Line(df3, name='Thrust', legendgroup='3',showlegend=False), row=2, col=1)
|
|
105
|
+
fig.append_trace(go.Line(df4, name='Torque', legendgroup='4',showlegend=False), row=2, col=2)
|
|
106
|
+
|
|
107
|
+
fig.update_xaxes(title_text="Radial Station", row=1, col=1)
|
|
108
|
+
fig.update_yaxes(title_text="Velocity", row=1, col=1)
|
|
109
|
+
fig.update_xaxes(title_text="Radial Station", row=1, col=2)
|
|
110
|
+
fig.update_yaxes(title_text="Induced Velocity", row=1, col=2)
|
|
111
|
+
fig.update_xaxes(title_text="Radial Station", row=2, col=1)
|
|
112
|
+
fig.update_yaxes(title_text="Thrust, N", row=2, col=1)
|
|
113
|
+
fig.update_xaxes(title_text="Radial Station", row=2, col=2)
|
|
114
|
+
fig.update_yaxes(title_text="Torque, N-m", row=2, col=2)
|
|
115
|
+
|
|
116
|
+
fig.update_layout(title_text="Rotor Performance", height=700)
|
|
117
|
+
|
|
118
|
+
if save_figure:
|
|
119
|
+
fig.write_image(save_filename + '_2D' + file_type)
|
|
120
|
+
|
|
121
|
+
if show_figure:
|
|
122
|
+
fig.write_html( save_filename + '.html', auto_open=True)
|
|
123
|
+
return fig
|
|
124
|
+
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# RCAIDE_GUI/tabs/solve/plots/common/plot_style.py
|
|
2
|
+
|
|
3
|
+
# RCAIDE imports
|
|
4
|
+
from RCAIDE.Framework.Core import Data
|
|
5
|
+
|
|
6
|
+
# ------------------------------------------------------------------------------
|
|
7
|
+
# Plot Style
|
|
8
|
+
# ------------------------------------------------------------------------------
|
|
9
|
+
def plot_style():
|
|
10
|
+
"""
|
|
11
|
+
Create standardized plotting style parameters for visualizations using RCAIDE's standard conventions.
|
|
12
|
+
|
|
13
|
+
Returns
|
|
14
|
+
-------
|
|
15
|
+
plot_parameters : Data
|
|
16
|
+
Style parameters with fields:
|
|
17
|
+
- line_width : int
|
|
18
|
+
Width of plot lines, default 2
|
|
19
|
+
- line_style : str
|
|
20
|
+
Style of plot lines, default '-'
|
|
21
|
+
- marker_size : int
|
|
22
|
+
Size of plot markers, default 8
|
|
23
|
+
- legend_font_size : int
|
|
24
|
+
Font size for legends, default 12
|
|
25
|
+
- axis_font_size : int
|
|
26
|
+
Font size for axis labels, default 14
|
|
27
|
+
- title_font_size : int
|
|
28
|
+
Font size for plot titles, default 18
|
|
29
|
+
- markers : list
|
|
30
|
+
Collection of marker styles for distinguishing data series
|
|
31
|
+
- color : str
|
|
32
|
+
Default line color, default 'black'
|
|
33
|
+
|
|
34
|
+
Notes
|
|
35
|
+
-----
|
|
36
|
+
Provides consistent styling across all RCAIDE plots including:
|
|
37
|
+
- Line properties (width, style)
|
|
38
|
+
- Marker properties (size, styles)
|
|
39
|
+
- Text properties (font sizes)
|
|
40
|
+
- Color schemes
|
|
41
|
+
|
|
42
|
+
The marker list includes a comprehensive set of matplotlib markers
|
|
43
|
+
for distinguishing multiple data series on the same plot.
|
|
44
|
+
|
|
45
|
+
**Definitions**
|
|
46
|
+
|
|
47
|
+
'Marker'
|
|
48
|
+
Symbol used to highlight individual data points
|
|
49
|
+
|
|
50
|
+
'Line Style'
|
|
51
|
+
Pattern used for connecting data points
|
|
52
|
+
|
|
53
|
+
See Also
|
|
54
|
+
--------
|
|
55
|
+
RCAIDE.Library.Plots.Common.set_axes : Complementary axis styling
|
|
56
|
+
"""
|
|
57
|
+
|
|
58
|
+
# Universal Plot Settings
|
|
59
|
+
plot_parameters = Data()
|
|
60
|
+
plot_parameters.line_width = 2
|
|
61
|
+
plot_parameters.line_style = '-'
|
|
62
|
+
plot_parameters.marker_size = 8
|
|
63
|
+
plot_parameters.legend_font_size = 12
|
|
64
|
+
plot_parameters.axis_font_size = 14
|
|
65
|
+
plot_parameters.title_font_size = 18
|
|
66
|
+
plot_parameters.markers = ['o', 's', '^', 'X', 'd', 'v', 'P', '>','.', ',', 'o', 'v', '^', '<',\
|
|
67
|
+
'>', '1', '2', '3', '4', '8', 's', 'p', '*', 'h'\
|
|
68
|
+
, 'H', '+', 'x', 'D', 'd', '|', '_']
|
|
69
|
+
plot_parameters.color = 'black'
|
|
70
|
+
|
|
71
|
+
return plot_parameters
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# RCAIDE_GUI/tabs/solve/plots/common/set_axes.py
|
|
2
|
+
|
|
3
|
+
# ------------------------------------------------------------------------------
|
|
4
|
+
# Set Axes
|
|
5
|
+
# ------------------------------------------------------------------------------
|
|
6
|
+
def set_axes(axes):
|
|
7
|
+
"""
|
|
8
|
+
Apply a standardized RCAIDE formatting style to matplotlib plot axes.
|
|
9
|
+
|
|
10
|
+
Parameters
|
|
11
|
+
----------
|
|
12
|
+
axes : matplotlib.axes.Axes
|
|
13
|
+
Axes object to be formatted with RCAIDE standard style
|
|
14
|
+
|
|
15
|
+
Returns
|
|
16
|
+
-------
|
|
17
|
+
None
|
|
18
|
+
|
|
19
|
+
Notes
|
|
20
|
+
-----
|
|
21
|
+
Applies the following formatting:
|
|
22
|
+
- Minor tick marks enabled
|
|
23
|
+
- Major grid lines: solid grey, width 0.5
|
|
24
|
+
- Minor grid lines: dotted grey, width 0.5
|
|
25
|
+
- Grid lines enabled
|
|
26
|
+
- Scientific notation disabled for y-axis
|
|
27
|
+
- Axis offset disabled for y-axis
|
|
28
|
+
|
|
29
|
+
This function ensures consistent axis appearance across all RCAIDE plots
|
|
30
|
+
and should be called after plotting data but before displaying the figure.
|
|
31
|
+
|
|
32
|
+
**Definitions**
|
|
33
|
+
|
|
34
|
+
'Major Grid'
|
|
35
|
+
Primary grid lines at major tick marks
|
|
36
|
+
|
|
37
|
+
'Minor Grid'
|
|
38
|
+
Secondary grid lines at minor tick marks
|
|
39
|
+
|
|
40
|
+
'Tick Marks'
|
|
41
|
+
Small lines indicating axis scale divisions
|
|
42
|
+
|
|
43
|
+
See Also
|
|
44
|
+
--------
|
|
45
|
+
RCAIDE.Library.Plots.Common.plot_style : Complementary plot styling
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
axes.minorticks_on()
|
|
49
|
+
axes.grid(which='major', linestyle='-', linewidth=0.5, color='grey')
|
|
50
|
+
axes.grid(which='minor', linestyle=':', linewidth=0.5, color='grey')
|
|
51
|
+
axes.grid(True)
|
|
52
|
+
axes.get_yaxis().get_major_formatter().set_scientific(False)
|
|
53
|
+
axes.get_yaxis().get_major_formatter().set_useOffset(False)
|
|
54
|
+
|
|
55
|
+
return
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# RCAIDE_GUI/tabs/solve/plots/create_plot_widgets.py
|
|
2
|
+
|
|
3
|
+
# Python imports
|
|
4
|
+
import pyqtgraph as pg
|
|
5
|
+
|
|
6
|
+
# ------------------------------------------------------------------------------
|
|
7
|
+
# Create Plot Widgets
|
|
8
|
+
# ------------------------------------------------------------------------------
|
|
9
|
+
def create_plot_widgets(self,plot_layout, plot_size,show_legend):
|
|
10
|
+
|
|
11
|
+
# Create two PlotWidgets from PyQtGraph
|
|
12
|
+
self.aircraft_TAS_plot = pg.PlotWidget()
|
|
13
|
+
self.aircraft_EAS_plot = pg.PlotWidget()
|
|
14
|
+
self.aircraft_Mach_plot = pg.PlotWidget()
|
|
15
|
+
self.aircraft_CAS_plot = pg.PlotWidget()
|
|
16
|
+
|
|
17
|
+
# Set a fixed size for each plot widget
|
|
18
|
+
self.aircraft_TAS_plot.setFixedSize(plot_size)
|
|
19
|
+
self.aircraft_EAS_plot.setFixedSize(plot_size)
|
|
20
|
+
self.aircraft_Mach_plot.setFixedSize(plot_size)
|
|
21
|
+
self.aircraft_CAS_plot.setFixedSize(plot_size)
|
|
22
|
+
|
|
23
|
+
if show_legend:
|
|
24
|
+
self.aircraft_TAS_plot.addLegend()
|
|
25
|
+
self.aircraft_EAS_plot.addLegend()
|
|
26
|
+
self.aircraft_Mach_plot.addLegend()
|
|
27
|
+
self.aircraft_CAS_plot.addLegend()
|
|
28
|
+
|
|
29
|
+
plot_layout.addWidget(self.aircraft_TAS_plot)
|
|
30
|
+
plot_layout.addWidget(self.aircraft_EAS_plot)
|
|
31
|
+
plot_layout.addWidget(self.aircraft_Mach_plot)
|
|
32
|
+
plot_layout.addWidget(self.aircraft_CAS_plot)
|
|
33
|
+
|
|
34
|
+
return
|