consistent 'get' inputs and outputs in evaluator

Commit
7fdc7e586e1c2125eef533af77dcb5ee8930b702
Author
Marius Peter <blendoit@gmail.com>
Author date
Committer
Marius Peter <blendoit@gmail.com>
Committer date
Changed files
creator.py
index 9eda3c9f..07720e8f 100644..100644
@@ -360,7 +360,6 @@
360 360 def plot(airfoil, spar, stringer):
361 361 """This function plots the elements passed as arguments."""
362 362
363 Removed: print('Plotting airfoil.')
364 363 # Plot chord
365 364 x_chord = [0, airfoil.chord]
366 365 y_chord = [0, 0]
evaluator.py
index a734c784..2b61348c 100644..100644
@@ -15,9 +15,7 @@
15 15
16 16 from math import sin, cos, atan, sqrt
17 17
18 Removed: # All of these functions take integer arguments and return lists.
19 18
20 Removed:
21 19 def get_total_mass(*component):
22 20 total_mass = float()
23 21 for _ in component:
@@ -25,18 +23,23 @@
25 23 return total_mass
26 24
27 25
28 Removed: def get_lift_rectangular(lift, semi_span):
29 Removed: L_prime = lift / (semi_span * 2)
26 Added: # All these functions take integer arguments and return lists.
27 Added:
28 Added: def get_lift_rectangular(airfoil, lift):
29 Added: L_prime = [lift / (airfoil.semi_span * 2)
30 Added: for x in range(airfoil.semi_span)]
30 31 return L_prime
31 32
32 33
33 Removed: def get_lift_elliptical(L_0, y, semi_span):
34 Removed: L_prime = L_0 * sqrt(1 - (y / semi_span) ** 2)
34 Added: def get_lift_elliptical(airfoil, L_0):
35 Added: L_prime = [L_0 * sqrt(1 - (y / airfoil.semi_span) ** 2)
36 Added: for y in range(airfoil.semi_span)]
35 37 return L_prime
36 38
37 39
38 40 def get_lift(rectangular, elliptical):
39 Removed: F_z = (rectangular + elliptical) / 2
41 Added: F_z = [(rectangular[_] + elliptical[_]) / 2
42 Added: for _ in range(len(rectangular))]
40 43 return F_z
41 44
42 45
main.py
index 61e53635..a23c3f00 100644..100644
@@ -78,13 +78,21 @@
78 78
79 79 # print(evaluator.get_total_mass(af, af.spar, af.stringer))
80 80 drag = evaluator.get_drag(af, 10)
81 Added:
82 Added: lift_rectangular = evaluator.get_lift_rectangular(af, 10)
83 Added: lift_elliptical = evaluator.get_lift_elliptical(af, 15)
84 Added: lift = evaluator.get_lift(lift_rectangular, lift_elliptical)
85 Added:
81 86 total_mass = evaluator.get_total_mass(af, af.spar, af.stringer)
82 87 dist_mass = evaluator.get_mass_distribution(af, total_mass)
83 Removed: print(total_mass)
84 Removed: print(dist_mass)
88 Added: print('rect', len(lift_rectangular))
89 Added: print('ellipse', len(lift_elliptical))
90 Added: print('lift', len(lift))
91 Added: print(len(drag))
92 Added: print(len(dist_mass))
85 93
86 94 # Plot components with matplotlib
87 Removed: creator.plot(af, af.spar, af.stringer)
95 Added: # creator.plot(af, af.spar, af.stringer)
88 96
89 97 # Save component info
90 98 # af.save_info(SAVE_PATH, _)