Skip to content

Commit f9649e4

Browse files
committed
Merge branch 'master' of https://github.com/suavecode/Tutorials
2 parents e29fe87 + 9089066 commit f9649e4

File tree

16 files changed

+3486
-1036
lines changed

16 files changed

+3486
-1036
lines changed
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
# Analyses.py
2+
#
3+
# Created: Mar. 2016, M. Vegh
4+
# Modified:
5+
6+
# ----------------------------------------------------------------------
7+
# Imports
8+
# ----------------------------------------------------------------------
9+
10+
import SUAVE
11+
12+
# ----------------------------------------------------------------------
13+
# Setup Analyses
14+
# ----------------------------------------------------------------------
15+
16+
def setup(configs):
17+
18+
analyses = SUAVE.Analyses.Analysis.Container()
19+
20+
# build a base analysis for each config
21+
for tag,config in configs.items():
22+
analysis = base(config)
23+
analyses[tag] = analysis
24+
25+
# adjust analyses for configs
26+
27+
# takeoff_analysis
28+
analyses.takeoff.aerodynamics.settings.drag_coefficient_increment = 0.0000
29+
30+
# landing analysis
31+
aerodynamics = analyses.landing.aerodynamics
32+
33+
return analyses
34+
35+
# ----------------------------------------------------------------------
36+
# Define Base Analysis
37+
# ----------------------------------------------------------------------
38+
39+
def base(vehicle):
40+
41+
# ------------------------------------------------------------------
42+
# Initialize the Analyses
43+
# ------------------------------------------------------------------
44+
analyses = SUAVE.Analyses.Vehicle()
45+
46+
# ------------------------------------------------------------------
47+
# Basic Geometry Relations
48+
sizing = SUAVE.Analyses.Sizing.Sizing()
49+
sizing.features.vehicle = vehicle
50+
analyses.append(sizing)
51+
52+
# ------------------------------------------------------------------
53+
# Weights
54+
weights = SUAVE.Analyses.Weights.Weights()
55+
weights.vehicle = vehicle
56+
analyses.append(weights)
57+
58+
# ------------------------------------------------------------------
59+
# Aerodynamics Analysis
60+
aerodynamics = SUAVE.Analyses.Aerodynamics.Fidelity_Zero()
61+
aerodynamics.geometry = vehicle
62+
63+
aerodynamics.settings.drag_coefficient_increment = 0.0000
64+
analyses.append(aerodynamics)
65+
66+
# ------------------------------------------------------------------
67+
# Stability Analysis
68+
stability = SUAVE.Analyses.Stability.Fidelity_Zero()
69+
stability.geometry = vehicle
70+
analyses.append(stability)
71+
72+
# ------------------------------------------------------------------
73+
# Energy
74+
energy= SUAVE.Analyses.Energy.Energy()
75+
energy.network = vehicle.propulsors #what is called throughout the mission (at every time step))
76+
analyses.append(energy)
77+
78+
# ------------------------------------------------------------------
79+
# Planet Analysis
80+
planet = SUAVE.Analyses.Planets.Planet()
81+
analyses.append(planet)
82+
83+
# ------------------------------------------------------------------
84+
# Atmosphere Analysis
85+
atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
86+
atmosphere.features.planet = planet.features
87+
analyses.append(atmosphere)
88+
89+
# done!
90+
return analyses

0 commit comments

Comments
 (0)