summaryrefslogtreecommitdiff
path: root/wing_scripts/get_z.m
diff options
context:
space:
mode:
authorblendoit <blendoit@gmail.com>2019-09-30 18:42:34 -0700
committerblendoit <blendoit@gmail.com>2019-09-30 18:42:34 -0700
commit588c34a3d595fcad5e93b8d4893f1098ce64d046 (patch)
tree0afc8ab9588845080b46c31ce62b725d9de3f0a8 /wing_scripts/get_z.m
First commit!
Changed coordinate lists into numpy arrays.
Diffstat (limited to 'wing_scripts/get_z.m')
-rw-r--r--wing_scripts/get_z.m34
1 files changed, 34 insertions, 0 deletions
diff --git a/wing_scripts/get_z.m b/wing_scripts/get_z.m
new file mode 100644
index 0000000..5387b52
--- /dev/null
+++ b/wing_scripts/get_z.m
@@ -0,0 +1,34 @@
+function z = get_z(x,u)
+
+
+
+if (x < 0 )
+ disp('invalid X')
+end
+
+M = 0.02;
+P = 0.4;
+T = 0.12;
+a0 = 0.2969;
+a1 = -0.126;
+a2 = -0.3516;
+a3 = 0.2843;
+a4 = -0.1015;
+
+if x <P
+ z_camber = M/P^2*(2*P*x - x^2);
+else
+ z_camber = (M/(1-P)^2)*(1 - 2*P +2*P*x - x^2);
+end
+
+%z_camber = M/P^2*(2*P*x - x^2);
+z_thickness = (T/0.2)*(a0*x^.5+a1*x+a2*x^2+a3*x^3+a4*x^4);
+
+if u==1
+ z = z_camber + z_thickness;
+else
+ z = z_camber - z_thickness;
+end
+
+
+
Copyright 2019--2026 Marius PETER