diff options
-rw-r--r-- | creator.py | 20 | ||||
-rw-r--r-- | evaluator.py | 26 | ||||
-rw-r--r-- | main.py | 2 |
3 files changed, 30 insertions, 18 deletions
@@ -154,12 +154,12 @@ class Airfoil(Coordinates): """ y_c = float() if 0 <= x < p_c: - y_c = (m / (p**2)) * (2 * p * (x / self.chord) - - (x / self.chord)**2) + y_c = (m / (p ** 2)) * (2 * p * (x / self.chord) + - (x / self.chord) ** 2) elif p_c <= x <= self.chord: - y_c = (m / ((1 - p)**2)) * ((1 - 2 * p) - + 2 * p * (x / self.chord) - - (x / self.chord)**2) + y_c = (m / ((1 - p) ** 2)) * ((1 - 2 * p) + + 2 * p * (x / self.chord) + - (x / self.chord) ** 2) return (y_c * self.chord) def get_thickness(x): @@ -169,17 +169,17 @@ class Airfoil(Coordinates): y_t = 5 * t * self.chord * ( +0.2969 * sqrt(x / self.chord) - 0.1260 * (x / self.chord) - - 0.3516 * (x / self.chord)**2 - + 0.2843 * (x / self.chord)**3 - - 0.1015 * (x / self.chord)**4) + - 0.3516 * (x / self.chord) ** 2 + + 0.2843 * (x / self.chord) ** 3 + - 0.1015 * (x / self.chord) ** 4) return y_t def get_theta(x): dy_c = float() if 0 <= x < p_c: - dy_c = ((2 * m) / p**2) * (p - x / self.chord) + dy_c = ((2 * m) / p ** 2) * (p - x / self.chord) elif p_c <= x <= self.chord: - dy_c = (2 * m) / ((1 - p)**2) * (p - x / self.chord) + dy_c = (2 * m) / ((1 - p) ** 2) * (p - x / self.chord) theta = atan(dy_c) return theta diff --git a/evaluator.py b/evaluator.py index 824b578..f4768e1 100644 --- a/evaluator.py +++ b/evaluator.py @@ -13,7 +13,24 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <https://www.gnu.org/licenses/>. -# F_z = +from math import sin, cos, atan, sqrt + + +def get_total_mass(*component): + total_mass = float() + for _ in component: + total_mass += _.mass + return total_mass + + +def lift_rectangular(lift, semi_span): + L_prime = lift / (semi_span * 2) + return L_prime + + +def lift_elliptical(L_0, y, semi_span): + L_prime = L_0 * sqrt(1 - (y / semi_span) ** 2) + return L_prime def get_centroid(airfoil): @@ -25,10 +42,3 @@ def get_centroid(airfoil): numerator += _ * area # denominator # z_c = - - -def get_total_mass(self, *component): - total_mass = float() - for _ in component: - total_mass += _.mass - return total_mass @@ -76,6 +76,8 @@ def main(): af.stringer.add_mass(STRINGER_MASS) # af.stringer.print_info(2) + print(evaluator.get_total_mass(af, af.spar, af.stringer)) + # Plot components with matplotlib creator.plot(af, af.spar, af.stringer) |