-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexperiment.m
More file actions
70 lines (57 loc) · 1.58 KB
/
Copy pathexperiment.m
File metadata and controls
70 lines (57 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
%% MA342 Project 1
%% Experiment 1 - Increasing the number of panels
clear variables;
close all;
clc;
v = 76; % m/s
naca2418 = importdata('naca2418.dat.txt');
naca64209 = importdata('naca64209.dat.txt');
fx84w097 = importdata('fx84w097.dat.txt');
mh112 = importdata('mh112.dat.txt');
data = {};
data{1} = naca2418;
data{2} = naca64209;
data{3} = fx84w097;
data{4} = mh112;
num_panels = transpose(5:2:35);
figure;
hold on;
for d = 1:length(data)
C_L1 = zeros(length(num_panels), 1);
for i = 1:length(C_L1)
X = points_based_on_input(data{d},num_panels(i));
X = [X; X(1, :)];
X = [X; [1.1, -0.05]];
C_L1(i) = airfoil_wing(X, v, false);
end
plot(num_panels, C_L1);
end
grid on;
hold off;
title("Experiment 1: Altering the number of panels");
legend('naca2418', 'naca64209', 'fx84w097', 'mh112');
xlabel("Number of Panels");
ylabel("Lift Coefficient (C_L)");
%% Experiment 2 - Changing the wake angle
wa_length = 0.1118;
theta_max = pi/4;
theta_iter = linspace(0, theta_max, 25);
num_panels_2 = 13;
figure;
hold on;
for d = 1:length(data)
C_L2 = zeros(length(theta_iter), 1);
for i = 1:length(C_L2)
X = points_based_on_input(data{d}, num_panels_2);
X = [X; X(1, :)];
X = [X; [1 + wa_length*cos(theta_iter(i)), -wa_length*sin(theta_iter(i))]];
C_L2(i) = airfoil_wing(X, v, false);
end
plot(theta_iter, C_L2);
end
grid on;
hold off;
title("Experiment 2: Altering the wake angle");
legend('naca2418', 'naca64209', 'fx84w097', 'mh112');
xlabel("Wake Angle Theta (rad)");
ylabel("Lift Coefficient (C_L)");