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.
Files changed (170) hide show
  1. common_widgets/__init__.py +6 -0
  2. common_widgets/animated_toggle.py +141 -0
  3. common_widgets/color.py +17 -0
  4. common_widgets/data_entry_widget.py +337 -0
  5. common_widgets/image_widget.py +21 -0
  6. common_widgets/unit_picker_widget.py +48 -0
  7. main.py +168 -0
  8. rcaide_gui-1.0.0.dist-info/METADATA +96 -0
  9. rcaide_gui-1.0.0.dist-info/RECORD +170 -0
  10. rcaide_gui-1.0.0.dist-info/WHEEL +5 -0
  11. rcaide_gui-1.0.0.dist-info/entry_points.txt +2 -0
  12. rcaide_gui-1.0.0.dist-info/top_level.txt +5 -0
  13. rcaide_io.py +818 -0
  14. tabs/__init__.py +10 -0
  15. tabs/aircraft_configs/__init__.py +3 -0
  16. tabs/aircraft_configs/aircraft_configs.py +301 -0
  17. tabs/analysis/__init__.py +4 -0
  18. tabs/analysis/analysis.py +92 -0
  19. tabs/analysis/widgets/__init__.py +13 -0
  20. tabs/analysis/widgets/aeroacoustics_widget.py +158 -0
  21. tabs/analysis/widgets/aerodynamics_widget.py +108 -0
  22. tabs/analysis/widgets/analysis_data_widget.py +29 -0
  23. tabs/analysis/widgets/atmosphere_widget.py +49 -0
  24. tabs/analysis/widgets/costs_widget.py +35 -0
  25. tabs/analysis/widgets/energy_widget.py +32 -0
  26. tabs/analysis/widgets/geometry_widget.py +55 -0
  27. tabs/analysis/widgets/planets_widget.py +34 -0
  28. tabs/analysis/widgets/propulsion_widget.py +53 -0
  29. tabs/analysis/widgets/stability_widget.py +34 -0
  30. tabs/analysis/widgets/weights_widget.py +94 -0
  31. tabs/geometry/__init__.py +6 -0
  32. tabs/geometry/aircraft_configs.py +232 -0
  33. tabs/geometry/frames/__init__.py +15 -0
  34. tabs/geometry/frames/booms/__init__.py +5 -0
  35. tabs/geometry/frames/booms/boom_frame.py +238 -0
  36. tabs/geometry/frames/cargo_bays/__init__.py +5 -0
  37. tabs/geometry/frames/cargo_bays/cargo_bay_frame.py +159 -0
  38. tabs/geometry/frames/default_frame.py +23 -0
  39. tabs/geometry/frames/energy_network/__init__.py +2 -0
  40. tabs/geometry/frames/energy_network/turbofan_network/__init__.py +3 -0
  41. tabs/geometry/frames/energy_network/turbofan_network/frames/__init__.py +1 -0
  42. tabs/geometry/frames/energy_network/turbofan_network/widgets/__init__.py +1 -0
  43. tabs/geometry/frames/fuselages/__init__.py +5 -0
  44. tabs/geometry/frames/fuselages/fuselage_frame.py +294 -0
  45. tabs/geometry/frames/geometry_frame.py +91 -0
  46. tabs/geometry/frames/landing_gears/__init__.py +5 -0
  47. tabs/geometry/frames/landing_gears/landing_gear_frame.py +189 -0
  48. tabs/geometry/frames/nacelles/__init__.py +1 -0
  49. tabs/geometry/frames/powertrain/__init__.py +6 -0
  50. tabs/geometry/frames/powertrain/converters/__init__.py +5 -0
  51. tabs/geometry/frames/powertrain/converters/converter_frame.py +137 -0
  52. tabs/geometry/frames/powertrain/distributors/__init__.py +5 -0
  53. tabs/geometry/frames/powertrain/distributors/distributor_frame.py +143 -0
  54. tabs/geometry/frames/powertrain/nacelles/__init__.py +5 -0
  55. tabs/geometry/frames/powertrain/nacelles/nacelle_frame.py +283 -0
  56. tabs/geometry/frames/powertrain/powertrain_frame.py +259 -0
  57. tabs/geometry/frames/powertrain/propulsors/__init__.py +5 -0
  58. tabs/geometry/frames/powertrain/propulsors/propulsor_frame.py +146 -0
  59. tabs/geometry/frames/powertrain/sources/__init__.py +6 -0
  60. tabs/geometry/frames/powertrain/sources/energy_source_frame.py +147 -0
  61. tabs/geometry/frames/vehicle_frame.py +171 -0
  62. tabs/geometry/frames/wings/__init__.py +5 -0
  63. tabs/geometry/frames/wings/wings_frame.py +457 -0
  64. tabs/geometry/geometry.py +513 -0
  65. tabs/geometry/widgets/__init__.py +12 -0
  66. tabs/geometry/widgets/booms/__init__.py +6 -0
  67. tabs/geometry/widgets/booms/boom_section_widget.py +109 -0
  68. tabs/geometry/widgets/cargo_bays/__init__.py +1 -0
  69. tabs/geometry/widgets/fuselages/__init__.py +8 -0
  70. tabs/geometry/widgets/fuselages/cabin_class_widget.py +188 -0
  71. tabs/geometry/widgets/fuselages/cabin_widget.py +217 -0
  72. tabs/geometry/widgets/fuselages/fuselage_section_widget.py +190 -0
  73. tabs/geometry/widgets/geometry_data_widget.py +25 -0
  74. tabs/geometry/widgets/landing_gears/__init__.py +6 -0
  75. tabs/geometry/widgets/nacelles/__init__.py +1 -0
  76. tabs/geometry/widgets/powertrain/__init__.py +9 -0
  77. tabs/geometry/widgets/powertrain/converters/__init__.py +5 -0
  78. tabs/geometry/widgets/powertrain/converters/turboelectric_generator_widget.py +74 -0
  79. tabs/geometry/widgets/powertrain/distributors/__init__.py +5 -0
  80. tabs/geometry/widgets/powertrain/distributors/fuel_line_widget.py +81 -0
  81. tabs/geometry/widgets/powertrain/modulators/__init__.py +5 -0
  82. tabs/geometry/widgets/powertrain/modulators/esc_widget.py +58 -0
  83. tabs/geometry/widgets/powertrain/nacelles/__init__.py +5 -0
  84. tabs/geometry/widgets/powertrain/nacelles/nacelle_section_widget.py +115 -0
  85. tabs/geometry/widgets/powertrain/powertrain_connector_widget.py +136 -0
  86. tabs/geometry/widgets/powertrain/powertrain_widget.py +206 -0
  87. tabs/geometry/widgets/powertrain/propulsors/__init__.py +5 -0
  88. tabs/geometry/widgets/powertrain/propulsors/turbofan_widget.py +462 -0
  89. tabs/geometry/widgets/powertrain/sources/__init__.py +6 -0
  90. tabs/geometry/widgets/powertrain/sources/fuel_tank_widget.py +103 -0
  91. tabs/geometry/widgets/powertrain/sources/source_selector_widget.py +35 -0
  92. tabs/geometry/widgets/wings/__init__.py +7 -0
  93. tabs/geometry/widgets/wings/wing_cs_widget.py +198 -0
  94. tabs/geometry/widgets/wings/wing_section_widget.py +298 -0
  95. tabs/home/__init__.py +3 -0
  96. tabs/home/home.py +585 -0
  97. tabs/mission/__init__.py +4 -0
  98. tabs/mission/mission.py +1124 -0
  99. tabs/mission/widgets/__init__.py +3 -0
  100. tabs/mission/widgets/flight_controls_widget.py +186 -0
  101. tabs/mission/widgets/mission_analysis_widget.py +166 -0
  102. tabs/mission/widgets/mission_segment_helper.py +358 -0
  103. tabs/mission/widgets/mission_segment_widget.py +358 -0
  104. tabs/solve/__init__.py +4 -0
  105. tabs/solve/plots/__init__.py +12 -0
  106. tabs/solve/plots/aeroacoustics/__init__.py +6 -0
  107. tabs/solve/plots/aeroacoustics/plot_2D_noise_contour.py +184 -0
  108. tabs/solve/plots/aeroacoustics/plot_3D_noise_contour.py +219 -0
  109. tabs/solve/plots/aeroacoustics/plot_noise_certification_contour.py +115 -0
  110. tabs/solve/plots/aeroacoustics/plot_noise_level.py +118 -0
  111. tabs/solve/plots/aerodynamics/__init__.py +10 -0
  112. tabs/solve/plots/aerodynamics/plot_aerodynamic_coefficients.py +156 -0
  113. tabs/solve/plots/aerodynamics/plot_aerodynamic_forces.py +155 -0
  114. tabs/solve/plots/aerodynamics/plot_aircraft_aerodynamics.py +136 -0
  115. tabs/solve/plots/aerodynamics/plot_drag_components.py +157 -0
  116. tabs/solve/plots/aerodynamics/plot_lift_distribution.py +107 -0
  117. tabs/solve/plots/aerodynamics/plot_rotor_conditions.py +255 -0
  118. tabs/solve/plots/aerodynamics/plot_rotor_disc_performance.py +144 -0
  119. tabs/solve/plots/aerodynamics/plot_rotor_performance.py +124 -0
  120. tabs/solve/plots/common/__init__.py +4 -0
  121. tabs/solve/plots/common/plot_style.py +71 -0
  122. tabs/solve/plots/common/set_axes.py +55 -0
  123. tabs/solve/plots/create_plot_widgets.py +34 -0
  124. tabs/solve/plots/emissions/__init__.py +3 -0
  125. tabs/solve/plots/emissions/plot_emissions.py +167 -0
  126. tabs/solve/plots/energy/__init__.py +12 -0
  127. tabs/solve/plots/energy/plot_altitude_sfc_weight.py +134 -0
  128. tabs/solve/plots/energy/plot_battery_cell_conditions.py +154 -0
  129. tabs/solve/plots/energy/plot_battery_degradation.py +157 -0
  130. tabs/solve/plots/energy/plot_battery_module_C_rates.py +139 -0
  131. tabs/solve/plots/energy/plot_battery_module_conditions.py +157 -0
  132. tabs/solve/plots/energy/plot_battery_pack_conditions.py +164 -0
  133. tabs/solve/plots/energy/plot_battery_ragone_diagram.py +97 -0
  134. tabs/solve/plots/energy/plot_battery_temperature.py +136 -0
  135. tabs/solve/plots/energy/plot_electric_propulsor_efficiencies.py +136 -0
  136. tabs/solve/plots/energy/plot_propulsor_throttles.py +119 -0
  137. tabs/solve/plots/mission/__init__.py +5 -0
  138. tabs/solve/plots/mission/plot_aircraft_velocities.py +145 -0
  139. tabs/solve/plots/mission/plot_flight_conditions.py +236 -0
  140. tabs/solve/plots/mission/plot_flight_trajectory.py +172 -0
  141. tabs/solve/plots/stability/__init__.py +5 -0
  142. tabs/solve/plots/stability/plot_flight_forces_and_moments.py +163 -0
  143. tabs/solve/plots/stability/plot_lateral_stability.py +151 -0
  144. tabs/solve/plots/stability/plot_longitudinal_stability.py +173 -0
  145. tabs/solve/plots/thermal_management/__init__.py +7 -0
  146. tabs/solve/plots/thermal_management/plot_air_cooled_conditions.py +152 -0
  147. tabs/solve/plots/thermal_management/plot_cross_flow_heat_exchanger_conditions.py +185 -0
  148. tabs/solve/plots/thermal_management/plot_reservoir_conditions.py +141 -0
  149. tabs/solve/plots/thermal_management/plot_thermal_management_performance.py +105 -0
  150. tabs/solve/plots/thermal_management/plot_wavy_channel_conditions.py +161 -0
  151. tabs/solve/plots/weights/__init__.py +4 -0
  152. tabs/solve/plots/weights/plot_load_diagram.py +163 -0
  153. tabs/solve/plots/weights/plot_weight_breakdown.py +164 -0
  154. tabs/solve/solve.py +1498 -0
  155. tabs/style_sheet.py +114 -0
  156. tabs/tab_widget.py +14 -0
  157. tabs/visualize_geometry/__init__.py +4 -0
  158. tabs/visualize_geometry/core_3d_viewer.py +253 -0
  159. tabs/visualize_geometry/features/__init__.py +10 -0
  160. tabs/visualize_geometry/features/axes_gizmo.py +173 -0
  161. tabs/visualize_geometry/features/background.py +161 -0
  162. tabs/visualize_geometry/features/blueprint.py +685 -0
  163. tabs/visualize_geometry/features/camera.py +364 -0
  164. tabs/visualize_geometry/features/drag_aircraft.py +219 -0
  165. tabs/visualize_geometry/features/grid.py +194 -0
  166. tabs/visualize_geometry/features/measurement.py +367 -0
  167. tabs/visualize_geometry/features/screenshot.py +91 -0
  168. tabs/visualize_geometry/geometry_helper_functions.py +3 -0
  169. tabs/visualize_geometry/visualize_geometry.py +731 -0
  170. utilities.py +257 -0
@@ -0,0 +1,219 @@
1
+ # RCAIDE_GUI/tabs/solve/plots/aeroacoustics/plot_3D_noise_contour.py
2
+
3
+ # RCAIDE imports
4
+ from RCAIDE.Framework.Core import Units
5
+ from RCAIDE.Library.Plots import *
6
+
7
+ # Python imports
8
+ import numpy as np
9
+ import plotly.graph_objects as go
10
+
11
+ # ------------------------------------------------------------------------------
12
+ # Plot 3D Noise Contour
13
+ # ------------------------------------------------------------------------------
14
+ def plot_3D_noise_contour(noise_data,
15
+ noise_level = None,
16
+ min_noise_level = 35,
17
+ max_noise_level = 90,
18
+ noise_scale_label = None,
19
+ save_figure = False,
20
+ show_figure = True,
21
+ save_filename = "Noise_Contour",
22
+ use_lat_long_coordinates = True,
23
+ show_trajectory = False,
24
+ show_microphones = False,
25
+ colormap = 'jet',
26
+ file_type = ".png",
27
+ background_color = 'rgb(17,54,71)',
28
+ grid_color = 'gray',
29
+ width = 1400,
30
+ height = 800):
31
+ """
32
+ Creates an interactive 3D visualization of noise contours with optional aircraft trajectory.
33
+
34
+ Parameters
35
+ ----------
36
+ noise_data : NoiseData
37
+ RCAIDE noise data structure containing:
38
+ - microphone_locations[:,:,0:3]
39
+ 3D array of microphone positions in (nmi, nmi, ft)
40
+ - aircraft_position[:,0:3]
41
+ Aircraft trajectory points in (nmi, nmi, ft)
42
+
43
+ noise_level : ndarray
44
+ 2D array of noise levels at measurement points
45
+
46
+ min_noise_level : float, optional
47
+ Minimum noise level for contour scale (default: 35 dB)
48
+
49
+ max_noise_level : float, optional
50
+ Maximum noise level for contour scale (default: 90 dB)
51
+
52
+ noise_scale_label : str, optional
53
+ Label for noise metric (e.g., "dBA", "EPNL", etc.)
54
+
55
+ save_figure : bool, optional
56
+ Flag for saving the figure (default: False)
57
+
58
+ show_figure : bool, optional
59
+ Flag to display the figure (default: True)
60
+
61
+ save_filename : str, optional
62
+ Name of file for saved figure (default: "Noise_Contour")
63
+
64
+ use_lat_long_coordinates : bool, optional
65
+ Flag to use geographic coordinates (default: True)
66
+
67
+ show_trajectory : bool, optional
68
+ Flag to display aircraft trajectory (default: False)
69
+
70
+ show_microphones : bool, optional
71
+ Flag to display microphone locations (default: False)
72
+
73
+ colormap : str, optional
74
+ Colormap specification for noise contours (default: 'jet')
75
+
76
+ file_type : str, optional
77
+ File extension for saved figure (default: ".png")
78
+
79
+ background_color : str, optional
80
+ Color specification for plot background (default: 'rgb(17,54,71)')
81
+
82
+ grid_color : str, optional
83
+ Color specification for grid lines (default: 'gray')
84
+
85
+ width : int, optional
86
+ Figure width in pixels (default: 1400)
87
+
88
+ height : int, optional
89
+ Figure height in pixels (default: 800)
90
+
91
+ Returns
92
+ -------
93
+ fig_3d : plotly.graph_objects.Figure
94
+ Handle to the generated interactive 3D figure
95
+
96
+ Notes
97
+ -----
98
+ Creates visualization showing:
99
+ * 3D noise contour surface
100
+ * Optional aircraft trajectory
101
+ * Optional microphone locations
102
+ * Interactive viewing controls
103
+ * Customizable appearance
104
+
105
+ **Major Assumptions**
106
+ * Noise levels are in decibels
107
+ * Coordinates are in nautical miles and feet
108
+ * Measurement grid is regularly spaced
109
+ * Z-axis represents elevation
110
+
111
+ **Definitions**
112
+
113
+ 'Noise Contour'
114
+ Surface of constant noise level
115
+ 'Aircraft Trajectory'
116
+ Time history of aircraft position
117
+ 'Microphone Location'
118
+ Measurement point coordinates
119
+
120
+ See Also
121
+ --------
122
+ RCAIDE.Library.Plots.Noise.plot_2D_noise_contour : 2D visualization of noise field
123
+ RCAIDE.Library.Plots.Noise.contour_surface_slice : Surface generation utility
124
+ """
125
+ Aircraft_pos = noise_data.aircraft_position
126
+ X = noise_data.microphone_locations[:,:,0]/Units.nmi
127
+ Y = noise_data.microphone_locations[:,:,1]/Units.nmi
128
+ Z = noise_data.microphone_locations[:,:,2]/Units.feet
129
+ plot_data = []
130
+
131
+ # ---------------------------------------------------------------------------
132
+ # TRHEE DIMENSIONAL NOISE CONTOUR
133
+ # ---------------------------------------------------------------------------
134
+ # TERRAIN CONTOUR
135
+ ground_contour = contour_surface_slice(Y,X,Z,noise_level,color_scale=colormap)
136
+ plot_data.append(ground_contour)
137
+
138
+ # GROUND MICROPHONES
139
+ if show_microphones:
140
+ microphones = go.Scatter3d(x = Y.flatten(),
141
+ y = X.flatten(),
142
+ z = Z.flatten(),
143
+ mode = 'markers',
144
+ marker = dict(size=6,color='white',opacity=0.8),
145
+ line = dict(color='white',width=2))
146
+ plot_data.append(microphones)
147
+
148
+ # AIRCRAFT TRAJECTORY
149
+ if show_trajectory:
150
+ aircraft_trajectory = go.Scatter3d(x = Aircraft_pos[:,1]/Units.nmi,
151
+ y = Aircraft_pos[:,0]/Units.nmi,
152
+ z = Aircraft_pos[:,2]/Units.feet,
153
+ mode= 'markers',
154
+ marker=dict(size=6,
155
+ color='black',
156
+ opacity=0.8),
157
+ line=dict(color='black',width=2))
158
+ plot_data.append(aircraft_trajectory)
159
+
160
+ # Define Colorbar Bounds
161
+ min_alt = np.minimum(np.min(Z),0)
162
+ max_alt = np.maximum(np.max(Z), np.max(Aircraft_pos[:,2]/Units.feet))
163
+
164
+ fig_3d = go.Figure(data=plot_data)
165
+
166
+ if show_microphones or show_trajectory:
167
+ pass
168
+ else:
169
+ fig_3d.update_traces(colorbar_orientation = 'v',
170
+ colorbar_thickness = 50,
171
+ colorbar_nticks = 10,
172
+ colorbar_title_text = noise_scale_label,
173
+ colorbar_tickfont_size = 16,
174
+ colorbar_title_side = "right",
175
+ colorbar_ypad = 50,
176
+ colorbar_len = 0.75)
177
+
178
+
179
+ fig_3d.update_layout(
180
+ title_text = save_filename,
181
+ title_x = 0.5,
182
+ width = width,
183
+ height = height,
184
+ font_size = 12,
185
+ scene_aspectmode = "manual",
186
+ scene_aspectratio = dict(x=1, y=1, z=0.5),
187
+ scene_zaxis_range = [min_alt,max_alt*3],
188
+ scene = dict(xaxis_title='Latitude [nmi]',
189
+ yaxis_title='Longitude [nmi]',
190
+ zaxis_title='Elevation [ft]',
191
+ xaxis = dict(
192
+ backgroundcolor=background_color,
193
+ gridcolor="white",
194
+ showbackground=True,
195
+ zerolinecolor=grid_color,),
196
+ yaxis = dict(
197
+ backgroundcolor=background_color,
198
+ gridcolor=grid_color,
199
+ showbackground=True,
200
+ zerolinecolor="white"),
201
+ zaxis = dict(
202
+ backgroundcolor=background_color,
203
+ gridcolor=grid_color,
204
+ showbackground=True,
205
+ zerolinecolor="white",),),
206
+ scene_camera=dict(up = dict(x=0, y=0, z=1),
207
+ center= dict(x=-0.05, y=0, z=-0.20),
208
+ eye = dict(x=-1.0, y=-1.0, z=.4))
209
+ )
210
+ if show_figure:
211
+ fig_3d.show()
212
+ if save_figure:
213
+ fig_3d.write_image(save_filename, file_type)
214
+
215
+ return fig_3d
216
+
217
+ def colorax(vmin, vmax):
218
+ return dict(cmin=vmin, cmax=vmax)
219
+
@@ -0,0 +1,115 @@
1
+ # RCAIDE_GUI/tabs/solve/plots/aeroacoustics/plot_noise_certification_contour.py
2
+
3
+ # RCAIDE imports
4
+ import matplotlib.colors
5
+ import matplotlib.colors as colors
6
+ from RCAIDE.Library.Plots import *
7
+
8
+ # Python imports
9
+ import numpy as np
10
+ from matplotlib import pyplot as plt
11
+
12
+ # ------------------------------------------------------------------------------
13
+ # Plot Noise Certification Contour
14
+ # ------------------------------------------------------------------------------
15
+ def plot_noise_certification_contour( noise_data,
16
+ noise_level = None,
17
+ min_noise_level = 45,
18
+ max_noise_level = 105,
19
+ noise_scale_label = "Max. SPL [dbA]",
20
+ save_figure = False,
21
+ show_figure = True,
22
+ save_filename = "Certification_Noise",
23
+ colormap = 'jet',
24
+ file_type = ".png",
25
+ width = 12,
26
+ height = 6):
27
+
28
+
29
+ fig = plt.figure(save_filename)
30
+ fig.set_size_inches(width,height)
31
+
32
+ noise_levels = np.linspace(min_noise_level,max_noise_level,7)
33
+ noise_cmap = plt.get_cmap('turbo')
34
+ noise_new_cmap = truncate_colormap(noise_cmap,0.0, 1.0)
35
+
36
+ noise_level = noise_data.certification_SPL_dBA_max
37
+ X = noise_data.certification_microphone_locations[:,:,0]
38
+ Y = noise_data.certification_microphone_locations[:,:,1]
39
+
40
+ ap_noise_level = noise_data.approach_SPL_dBA_max
41
+ ap_X = noise_data.approach_microphone_locations[:,:,0]
42
+ ap_Y = noise_data.approach_microphone_locations[:,:,1]
43
+ ap_POS = noise_data.approach_trajectory
44
+
45
+ to_noise_level = noise_data.takeoff_SPL_dBA_max
46
+ to_X = noise_data.takeoff_microphone_locations[:,:,0]
47
+ to_Y = noise_data.takeoff_microphone_locations[:,:,1]
48
+ to_POS = noise_data.takeoff_trajectory
49
+
50
+ axis_0 = fig.add_subplot(2,2,1)
51
+ axis_0.set_xlabel('x [m]')
52
+ axis_0.set_ylabel('altitude [m]')
53
+ axis_1 = fig.add_subplot(2,2,3)
54
+ axis_1.set_xlabel('x [m]')
55
+ axis_1.set_ylabel('y [m]')
56
+ axis_2 = fig.add_subplot(2,2,2)
57
+ axis_2.set_xlabel('x [m]')
58
+ axis_2.set_ylabel('y [m]')
59
+ axis_3 = fig.add_subplot(2,2,4)
60
+ axis_3.set_xlabel('x [m]')
61
+ axis_3.set_ylabel('y [m]')
62
+
63
+ # plot aircraft position
64
+ axis_0.plot(ap_POS[:,0],-ap_POS[:,2], color = 'black', linestyle = '-' , marker = 'o', linewidth = 2, label= "Approach")
65
+ axis_0.plot(to_POS[:,0],-to_POS[:,2], color = 'blue', linestyle = '-' , marker = 's', linewidth = 2, label= "Takeoff")
66
+ axis_0.legend(loc='upper center')
67
+
68
+ # plot aircraft noise levels
69
+ CS_11 = axis_1.contourf(X,Y,noise_level ,noise_levels,cmap = noise_new_cmap,extend='both')
70
+ CS_12 = axis_1.contourf(X,-Y,noise_level ,noise_levels,cmap = noise_new_cmap,extend='both')
71
+ CS_21 = axis_2.contourf(ap_X,ap_Y,ap_noise_level ,noise_levels,cmap = noise_new_cmap,extend='both')
72
+ CS_22 = axis_2.contourf(ap_X,-ap_Y,ap_noise_level ,noise_levels,cmap = noise_new_cmap,extend='both')
73
+ CS_31 = axis_3.contourf(to_X,to_Y,to_noise_level ,noise_levels,cmap = noise_new_cmap,extend='both')
74
+ CS_32 = axis_3.contourf(to_X,-to_Y,to_noise_level ,noise_levels,cmap = noise_new_cmap,extend='both')
75
+
76
+ cbar = fig.colorbar(CS_11, ax=axis_1)
77
+ cbar.ax.set_ylabel(noise_scale_label, rotation = 90)
78
+
79
+ cbar = fig.colorbar(CS_11, ax=axis_2)
80
+ cbar.ax.set_ylabel(noise_scale_label, rotation = 90)
81
+
82
+ cbar = fig.colorbar(CS_11, ax=axis_3)
83
+ cbar.ax.set_ylabel(noise_scale_label, rotation = 90)
84
+
85
+ run_way_x_pts = np.linspace(0, 3000, 20)
86
+ run_way_y_pts = run_way_x_pts * 0
87
+
88
+ axis_1.plot(run_way_x_pts,run_way_y_pts, color = 'grey', linestyle = '-' , linewidth = 5 , alpha=0.5)
89
+ axis_2.plot(run_way_x_pts,run_way_y_pts, color = 'grey', linestyle = '-' , linewidth = 5 , alpha=0.5)
90
+ axis_3.plot(run_way_x_pts,run_way_y_pts, color = 'grey', linestyle = '-' , linewidth = 5 , alpha=0.5)
91
+
92
+ set_axes(axis_1)
93
+ set_axes(axis_2)
94
+ set_axes(axis_3)
95
+
96
+ axis_0.set_title('Flight Trajectory')
97
+ axis_1.set_title('Approach and Takeoff Noise')
98
+ axis_2.set_title('Approach Noise')
99
+ axis_3.set_title('Takeoff Noise')
100
+
101
+ fig.tight_layout()
102
+ if save_figure:
103
+ figure_title = save_filename
104
+ plt.savefig(figure_title + file_type )
105
+
106
+
107
+ # ------------------------------------------------------------------
108
+ # Truncate colormaps
109
+ # ------------------------------------------------------------------
110
+ def truncate_colormap(cmap, minval=0.0, maxval=1.0, n=100):
111
+ new_cmap = colors.LinearSegmentedColormap.from_list(
112
+ 'trunc({n},{a:.2f},{b:.2f})'.format(n=cmap.name, a=minval, b=maxval),
113
+ cmap(np.linspace(minval, maxval, n)))
114
+ return new_cmap
115
+
@@ -0,0 +1,118 @@
1
+ # RCAIDE_GUI/tabs/solve/plots/aeroacoustics/plot_noise_level.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 Noise Level
14
+ # ------------------------------------------------------------------------------
15
+ def plot_noise_level(noise_data,
16
+ noise_level = False,
17
+ save_figure = False,
18
+ save_filename = "Sideline_Noise_Levels",
19
+ file_type = ".png",
20
+ width = 11, height = 7):
21
+ """
22
+ Creates a visualization of A-weighted Sound Pressure Levels at various sideline distances.
23
+
24
+ Parameters
25
+ ----------
26
+ noise_data : NoiseData
27
+ RCAIDE noise data structure containing:
28
+ - microphone_y_resolution : int
29
+ Number of sideline measurement positions
30
+ - microphone_locations : ndarray
31
+ 3D array of microphone positions where:
32
+ - [:,:,0] : x-positions (longitudinal)
33
+ - [:,:,1] : y-positions (sideline)
34
+ - [:,:,2] : z-positions (vertical)
35
+
36
+ noise_level : ndarray, optional
37
+ 2D array of noise levels at measurement points (default: False)
38
+
39
+ save_figure : bool, optional
40
+ Flag for saving the figure (default: False)
41
+
42
+ save_filename : str, optional
43
+ Name of file for saved figure (default: "Sideline_Noise_Levels")
44
+
45
+ file_type : str, optional
46
+ File extension for saved figure (default: ".png")
47
+
48
+ width : float, optional
49
+ Figure width in inches (default: 11)
50
+
51
+ height : float, optional
52
+ Figure height in inches (default: 7)
53
+
54
+ Returns
55
+ -------
56
+ fig : matplotlib.figure.Figure
57
+ Handle to the generated figure showing noise levels vs range
58
+
59
+ Notes
60
+ -----
61
+ Creates visualization showing:
62
+ * Noise level variation with distance
63
+ * Multiple sideline measurement positions
64
+ * Color-coded sideline distances
65
+ * Customizable appearance
66
+
67
+ **Major Assumptions**
68
+ * Noise levels are A-weighted SPL in dBA
69
+ * Microphones are in a regular grid
70
+ * Range is in nautical miles
71
+ * Sideline distances are in meters
72
+
73
+ **Definitions**
74
+
75
+ 'Sound Pressure Level'
76
+ A-weighted acoustic pressure level in dBA
77
+ 'Sideline Distance'
78
+ Perpendicular distance from flight path
79
+ 'Range'
80
+ Distance along flight path
81
+
82
+ See Also
83
+ --------
84
+ RCAIDE.Library.Plots.Noise.plot_2D_noise_contour : 2D contour visualization
85
+ RCAIDE.Library.Plots.Noise.plot_3D_noise_contour : 3D noise field visualization
86
+ """
87
+ N_gm_y = noise_data.microphone_y_resolution
88
+ gm = noise_data.microphone_locations
89
+ gm_x = gm[:,:,0]
90
+ gm_y = gm[:,:,1]
91
+
92
+
93
+ # get plotting style
94
+ ps = plot_style()
95
+
96
+ parameters = {'axes.labelsize': ps.axis_font_size,
97
+ 'xtick.labelsize': ps.axis_font_size,
98
+ 'ytick.labelsize': ps.axis_font_size,
99
+ 'axes.titlesize': ps.title_font_size}
100
+ plt.rcParams.update(parameters)
101
+
102
+ fig = plt.figure(save_filename)
103
+ fig.set_size_inches(width,height)
104
+ axes = fig.add_subplot(1,1,1)
105
+
106
+ # get line colors for plots
107
+ line_colors = cm.inferno(np.linspace(0,0.9,N_gm_y))
108
+
109
+ for k in range(N_gm_y):
110
+ axes.plot(gm_x[:,0]/Units.nmi, noise_level[:,k], marker = 'o', color = line_colors[k], label= r'mic at y = ' + str(round(gm_y[0,k],1)) + r' m' )
111
+ axes.set_ylabel('SPL [dBA]')
112
+ axes.set_xlabel('Range [nmi]')
113
+ set_axes(axes)
114
+ axes.legend(loc='upper right')
115
+ if save_figure:
116
+ plt.savefig(save_filename + ".png")
117
+
118
+ return fig
@@ -0,0 +1,10 @@
1
+ # RCAIDE_GUI/tabs/solve/plots/aerodynamics/__init__.py
2
+
3
+ from .plot_aircraft_aerodynamics import plot_aircraft_aerodynamics
4
+ from .plot_aerodynamic_coefficients import plot_aerodynamic_coefficients
5
+ from .plot_aerodynamic_forces import plot_aerodynamic_forces
6
+ from .plot_drag_components import plot_drag_components
7
+ from .plot_lift_distribution import plot_lift_distribution
8
+ from .plot_rotor_disc_performance import plot_rotor_disc_performance
9
+ from .plot_rotor_performance import plot_rotor_performance
10
+ from .plot_rotor_conditions import plot_rotor_conditions
@@ -0,0 +1,156 @@
1
+ # RCAIDE_GUI/tabs/solve/plots/aerodynamics/plot_aerodynamic_coefficients.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 Aerodynamic Coefficients
14
+ # ------------------------------------------------------------------------------
15
+ def plot_aerodynamic_coefficients(results,
16
+ save_figure = False,
17
+ show_legend = True,
18
+ save_filename = "Aerodynamic_Coefficients",
19
+ file_type = ".png",
20
+ width = 11, height = 7):
21
+ """
22
+ Creates a multi-panel visualization of aerodynamic coefficients throughout flight.
23
+
24
+ Parameters
25
+ ----------
26
+ results : Results
27
+ RCAIDE results data structure containing:
28
+ - segments[i].conditions.aerodynamics.coefficients
29
+ Coefficient data containing:
30
+ - lift.total[:,0,None]
31
+ Total lift coefficient
32
+ - drag.total[:,0,None]
33
+ Total drag coefficient
34
+ - segments[i].conditions.aerodynamics.angles
35
+ Angle data containing:
36
+ - alpha[:,0]
37
+ Angle of attack in radians
38
+ - segments[i].conditions.frames.inertial.time[:,0]
39
+ Time history for each segment
40
+ - segments[i].tag
41
+ Segment identifier string
42
+
43
+ save_figure : bool, optional
44
+ Flag for saving the figure (default: False)
45
+
46
+ show_legend : bool, optional
47
+ Flag to display segment legend (default: True)
48
+
49
+ save_filename : str, optional
50
+ Name of file for saved figure (default: "Aerodynamic_Coefficients")
51
+
52
+ file_type : str, optional
53
+ File extension for saved figure (default: ".png")
54
+
55
+ width : float, optional
56
+ Figure width in inches (default: 11)
57
+
58
+ height : float, optional
59
+ Figure height in inches (default: 7)
60
+
61
+ Returns
62
+ -------
63
+ fig : matplotlib.figure.Figure
64
+
65
+
66
+ Notes
67
+ -----
68
+ Creates visualization showing:
69
+ - Aerodynamic performance metrics
70
+ - Flight attitude history
71
+ - Efficiency characteristics
72
+ - Time evolution of coefficients
73
+
74
+ **Major Assumptions**
75
+ * Quasi-steady aerodynamics
76
+ * Small angle approximations
77
+ * Incompressible flow
78
+ * Linear lift curve slope
79
+ * Negligible sideslip
80
+
81
+ **Definitions**
82
+
83
+ 'Lift Coefficient'
84
+ Non-dimensional lift force
85
+ 'Drag Coefficient'
86
+ Non-dimensional drag force
87
+ 'Angle of Attack'
88
+ Angle between airflow and reference line
89
+ 'L/D Ratio'
90
+ Measure of aerodynamic efficiency
91
+
92
+ See Also
93
+ --------
94
+ RCAIDE.Library.Plots.Aerodynamics.plot_aerodynamic_forces : Dimensional force plots
95
+ RCAIDE.Library.Plots.Aerodynamics.plot_drag_components : Drag breakdown analysis
96
+ """
97
+
98
+ # get plotting style
99
+ ps = plot_style()
100
+
101
+ parameters = {'axes.labelsize': ps.axis_font_size,
102
+ 'xtick.labelsize': ps.axis_font_size,
103
+ 'ytick.labelsize': ps.axis_font_size,
104
+ 'axes.titlesize': ps.title_font_size}
105
+ plt.rcParams.update(parameters)
106
+
107
+ # get line colors for plots
108
+ line_colors = cm.inferno(np.linspace(0,0.9,len(results.segments)))
109
+
110
+ fig = plt.figure(save_filename)
111
+ fig.set_size_inches(width,height)
112
+
113
+ for i in range(len(results.segments)):
114
+ time = results.segments[i].conditions.frames.inertial.time[:,0] / Units.min
115
+ cl = results.segments[i].conditions.aerodynamics.coefficients.lift.total[:,0,None]
116
+ cd = results.segments[i].conditions.aerodynamics.coefficients.drag.total[:,0,None]
117
+ aoa = results.segments[i].conditions.aerodynamics.angles.alpha[:,0] / Units.deg
118
+ l_d = cl/cd
119
+
120
+ segment_tag = results.segments[i].tag
121
+ segment_name = segment_tag.replace('_', ' ')
122
+ axis_1 = plt.subplot(2,2,1)
123
+ axis_1.plot(time, aoa, color = line_colors[i], marker = ps.markers[0],markersize = ps.marker_size, linewidth = ps.line_width, label = segment_name)
124
+ axis_1.set_ylabel(r'AoA (deg)')
125
+ axis_1.set_xlabel('Time (mins)')
126
+ axis_1.set_ylim([-5,15])
127
+ set_axes(axis_1)
128
+
129
+ axis_2 = plt.subplot(2,2,2)
130
+ axis_2.plot(time, l_d, color = line_colors[i], marker = ps.markers[0],markersize = ps.marker_size, linewidth = ps.line_width)
131
+ axis_2.set_ylabel(r'L/D')
132
+ axis_2.set_xlabel('Time (mins)')
133
+ set_axes(axis_2)
134
+
135
+ axis_3 = plt.subplot(2,2,3)
136
+ axis_3.plot(time, cl, color = line_colors[i], marker = ps.markers[0],markersize = ps.marker_size, linewidth = ps.line_width)
137
+ axis_3.set_xlabel('Time (mins)')
138
+ axis_3.set_ylabel(r'$C_L$')
139
+ set_axes(axis_3)
140
+
141
+ axis_4 = plt.subplot(2,2,4)
142
+ axis_4.plot(time, cd, color = line_colors[i], marker = ps.markers[0],markersize = ps.marker_size, linewidth = ps.line_width)
143
+ axis_4.set_xlabel('Time (mins)')
144
+ axis_4.set_ylabel(r'$C_D$')
145
+ set_axes(axis_4)
146
+
147
+ if show_legend:
148
+ leg = fig.legend(bbox_to_anchor=(0.5, 0.95), loc='upper center', ncol = 4)
149
+
150
+ # Adjusting the sub-plots for legend
151
+ fig.tight_layout()
152
+ fig.subplots_adjust(top=0.8)
153
+
154
+ if save_figure:
155
+ fig.savefig(save_filename + file_type)
156
+ return fig