From db478991e1aa74213fdf4c94ef4df798a61895b6 Mon Sep 17 00:00:00 2001 From: William Johnstone Date: Wed, 27 Nov 2024 21:42:29 +0000 Subject: [PATCH] Final changes to code, sorry it's messy lol --- .gitignore | 4 +- README.md | 4 +- Raymers Code/raymers.py | 82 +++++++++++++++++++++++++++++++++++++++++ output.txt | 50 +++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 output.txt diff --git a/.gitignore b/.gitignore index 6650ac4..f30e457 100644 --- a/.gitignore +++ b/.gitignore @@ -163,4 +163,6 @@ cython_debug/ .DS_Store -Aircraft\ Design\ and\ Performance\ \-\ Assignment\ 1\ \-\ William\ Johnstone.docx \ No newline at end of file +Aircraft\ Design\ and\ Performance\ \-\ Assignment\ 1\ \-\ William\ Johnstone.docx + +CAD/ \ No newline at end of file diff --git a/README.md b/README.md index 25673bf..43e9832 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # uni-raymers -Code for estimating aircraft characteristics for the aircraft design module. \ No newline at end of file +Code for estimating aircraft characteristics for the aircraft design module. + +Output of calculations can be found in output.txt \ No newline at end of file diff --git a/Raymers Code/raymers.py b/Raymers Code/raymers.py index b300507..b60cdf0 100644 --- a/Raymers Code/raymers.py +++ b/Raymers Code/raymers.py @@ -1,3 +1,6 @@ +# William Johnstone +# Apologies to anyone reading this, it became a mess. I wanted to tidy it but we don't always get what we want. + import matplotlib.pyplot as plt import math @@ -146,4 +149,83 @@ print(f"Second moment of inertia for new test: {area_moment_inertia} m^4") max_stress = bending_moment_wing * ((D/2) / area_moment_inertia) print(f"Max Stress for new test spar: {max_stress:.4f} Pa or {max_stress/1000000:.4f} MPa") +# Aerofoil Spars +B = 18 * 0.001 # Width in m +D = 3.5 * 0.001 # Height or depth in m + +# 6mm Spars +area_moment_inertia = ((B) * (D**3))/12 +print(f"Second moment of inertia for 6x3mm: {area_moment_inertia} m^4") + +max_stress = bending_moment_wing * ((D/2) / area_moment_inertia) +print(f"Max Stress for 6x3mm: {max_stress:.4f} Pa or {max_stress/1000000:.4f} MPa") + +B = 6 * 0.001 # Width in m +D = 0.5 * 0.001 # Height or depth in m + +# 6mm Spars +area_moment_inertia = ((B) * (D**3))/12 +print(f"Second moment of inertia for 6x3.5mm: {area_moment_inertia} m^4") + +max_stress = bending_moment_wing * ((D/2) / area_moment_inertia) +print(f"Max Stress for 6x3.5mm: {max_stress:.4f} Pa or {max_stress/1000000:.4f} MPa") + + +# Bending Moment for tail (Rohan's numbers ) +bending_moment_wing = (lift_force_total / number_of_wings) * (wing_span_metric / 4) +print(f"Bending Moment at of 1 Wing from root: {bending_moment_wing:.4f} Nm\n") + + + +###################################################################### +# 27/11/24 +# Updated stress calcs with new weight (from detailed CAD model, including payload mass) + +print("#############################################################") +print("Everything after this is based on numbers from final CAD model. Thus more relevant") + +print("Weight (Final, from CAD Model) (mass): %0.4f kg" % (262*(10**-3))) + +# Total Lift Force +lift_force_total = (262*(10**-3)) * 9.81 +#lift_force_per_ft = lift_force_total / wing_span +#lift_force_per_wing_per_ft = lift_force_per_ft / 2 +print("Total Lift Force: {:.4f} N\n".format(lift_force_total)) + +# Bending Moments + +number_of_wings = 2 + +print("BENDING MOMENTS (LATEST, THESE ARE THE ONLY ONES RELEVANT)\n") +wing_span_metric = wing_span * 0.3048 +print("Wing Span: {:.4f} m".format(wing_span_metric)) + +# Bending Moment at Wing Root +bending_moment_wing = (lift_force_total / number_of_wings) * (wing_span_metric / 4) +print(f"Bending Moment at of 1 Wing from root: {bending_moment_wing:.4f} Nm\n") + +# Max bending stress for Balsa (https://woodworkly.com/is-balsa-wood-strong/) +bending_strength_psi_lower = 2550 +bending_strength_psi_upper = 3170 +bending_strength_megapascal_lower = bending_strength_psi_lower * 0.006894757 # (1 psi = 0.006894757 MPa) +bending_strength_megapascal_upper = bending_strength_psi_upper * 0.006894757 # (1 psi = 0.006894757 MPa) + +# Max Stress Calcs + +B = 18 * 0.001 # Width in m +D = 2.5 * 0.001 # Height or depth in m + +# 4mm Spars +area_moment_inertia = ((B) * (D**3))/12 +print(f"Second moment of inertia for final model: {area_moment_inertia} m^4") + +max_stress = bending_moment_wing * ((D/2) / area_moment_inertia) + +max_stress_megapascal = max_stress/1000000 + +print(f"Max Stress for final model spar: {max_stress:.4f} Pa or {max_stress_megapascal:.4f} MPa") + +print(f"Balsa Wood Bending Stress Upper Limit: {bending_strength_megapascal_upper:.4f}MPa, Lower Limit: {bending_strength_megapascal_lower:.4f} MPa") + +print(f"Safety Factor: {bending_strength_megapascal_lower/max_stress_megapascal:.1f} - {bending_strength_megapascal_upper/max_stress_megapascal:.1f}") \ No newline at end of file diff --git a/output.txt b/output.txt new file mode 100644 index 0000000..cea1d8d --- /dev/null +++ b/output.txt @@ -0,0 +1,50 @@ +Raymer's Aircraft Calculations (IMPERIAL UNITS) + +Weight Estimation (mass): 1.6966 lbs +Typical Weight Area Ratio: 6.0000 lbs/ft² +Main Wing Area: 0.2828 ft² +Lift to Drag Ratio: 5.0000 +Aspect Ratio: 13.5523 +Main Wing Span 1.9576 ft +Main Wing Chord Length 0.1444 ft +Fuselage Length 1.1084 ft +Tail Positioning (Moment arm location) 0.7205 ft +Vertical Tail Area: 0.0154 ft² +Horizontal Tail Area: 0.0283 ft² + +End of imperial numbers (THANK THE LORD!) + +Weight Estimation (mass): 0.7696 kg +Total Lift Force: 7.5493 N + +BENDING MOMENTS + +Wing Span: 0.5967 m +Bending Moment at of 1 Wing from root: 0.5631 Nm + +Second moment of inertia for 4mm: 2.1333333333333337e-11 m^4 +Max Stress for 4mm spar: 52786068.9659 Pa or 52.7861 MPa +Second moment of inertia for 6mm: 1.08e-10 m^4 +Max Stress for 6mm spar: 15640316.7306 Pa or 15.6403 MPa +Second moment of inertia for new test: 8e-12 m^4 +Max Stress for new test spar: 70381425.2878 Pa or 70.3814 MPa +Second moment of inertia for 6x3mm: 6.431250000000002e-11 m^4 +Max Stress for 6x3mm: 15321126.5933 Pa or 15.3211 MPa +Second moment of inertia for 6x3.5mm: 6.25e-14 m^4 +Max Stress for 6x3.5mm: 2252205609.2100 Pa or 2252.2056 MPa +Bending Moment at of 1 Wing from root: 0.5631 Nm + +############################################################# +Everything after this is based on numbers from final CAD model. Thus more relevant +Weight (Final, from CAD Model) (mass): 0.2620 kg +Total Lift Force: 2.5702 N + +BENDING MOMENTS (LATEST, THESE ARE THE ONLY ONES RELEVANT) + +Wing Span: 0.5967 m +Bending Moment at of 1 Wing from root: 0.1917 Nm + +Second moment of inertia for final model: 2.3437500000000006e-11 m^4 +Max Stress for final model spar: 10223765.5151 Pa or 10.2238 MPa +Balsa Wood Bending Stress Upper Limit: 21.8564MPa, Lower Limit: 17.5816 MPa +Safety Factor: 1.7 - 2.1 \ No newline at end of file