summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--creator.py1
-rw-r--r--evaluator.py17
-rw-r--r--main.py14
3 files changed, 21 insertions, 11 deletions
diff --git a/creator.py b/creator.py
index 9eda3c9..07720e8 100644
--- a/creator.py
+++ b/creator.py
@@ -360,7 +360,6 @@ class Stringer(Coordinates):
def plot(airfoil, spar, stringer):
"""This function plots the elements passed as arguments."""
- print('Plotting airfoil.')
# Plot chord
x_chord = [0, airfoil.chord]
y_chord = [0, 0]
diff --git a/evaluator.py b/evaluator.py
index a734c78..2b61348 100644
--- a/evaluator.py
+++ b/evaluator.py
@@ -15,8 +15,6 @@
from math import sin, cos, atan, sqrt
-# All of these functions take integer arguments and return lists.
-
def get_total_mass(*component):
total_mass = float()
@@ -25,18 +23,23 @@ def get_total_mass(*component):
return total_mass
-def get_lift_rectangular(lift, semi_span):
- L_prime = lift / (semi_span * 2)
+# All these functions take integer arguments and return lists.
+
+def get_lift_rectangular(airfoil, lift):
+ L_prime = [lift / (airfoil.semi_span * 2)
+ for x in range(airfoil.semi_span)]
return L_prime
-def get_lift_elliptical(L_0, y, semi_span):
- L_prime = L_0 * sqrt(1 - (y / semi_span) ** 2)
+def get_lift_elliptical(airfoil, L_0):
+ L_prime = [L_0 * sqrt(1 - (y / airfoil.semi_span) ** 2)
+ for y in range(airfoil.semi_span)]
return L_prime
def get_lift(rectangular, elliptical):
- F_z = (rectangular + elliptical) / 2
+ F_z = [(rectangular[_] + elliptical[_]) / 2
+ for _ in range(len(rectangular))]
return F_z
diff --git a/main.py b/main.py
index 61e5363..a23c3f0 100644
--- a/main.py
+++ b/main.py
@@ -78,13 +78,21 @@ def main():
# print(evaluator.get_total_mass(af, af.spar, af.stringer))
drag = evaluator.get_drag(af, 10)
+
+ lift_rectangular = evaluator.get_lift_rectangular(af, 10)
+ lift_elliptical = evaluator.get_lift_elliptical(af, 15)
+ lift = evaluator.get_lift(lift_rectangular, lift_elliptical)
+
total_mass = evaluator.get_total_mass(af, af.spar, af.stringer)
dist_mass = evaluator.get_mass_distribution(af, total_mass)
- print(total_mass)
- print(dist_mass)
+ print('rect', len(lift_rectangular))
+ print('ellipse', len(lift_elliptical))
+ print('lift', len(lift))
+ print(len(drag))
+ print(len(dist_mass))
# Plot components with matplotlib
- creator.plot(af, af.spar, af.stringer)
+ # creator.plot(af, af.spar, af.stringer)
# Save component info
# af.save_info(SAVE_PATH, _)
Copyright 2019--2024 Marius PETER