There are several problems with your code.
You are only saving the last iteration of ‘A’, and since it does not appear that ‘A’ is calculated recursively, this change in the ‘lambda_r’ loop will save all of them:
lambda_rv = 0:0.25:1;
for k = 1:numel(lambda_rv)
lambda_r = lambda_rv(k);
c_root = (2*S) / ((1+lambda_r)*b);
c_tip = ((2*S)/((1+lambda_r)*b)) * (1-((2*(1-lambda_r))/b)*(b/2));
MAC = (2/3)*(c_root+c_tip-(c_root*c_tip)/(c_root+c_tip));
lambda = c_tip / c_root;
alpha_segment(1) = alpha;
theta_segment(1) = pi/2;
for N = 2:N
c(N) = c_root+(c_tip-c_root)/N.*N;
alpha_segment(N) = alpha+(theta_t)/N.*N;
theta_segment = pi/(2*N):pi/(2*N):pi/2;
end
xb = 4*b./(pi*c);
for i = 1:N
for j = 1:N
B(i,j) = (sin(j.*theta_segment(i))).*(xb(i)+j/(sin(theta_segment(i))));
end
slope(i) = (alpha_segment(i)-alpha_0)*(pi/180);
end
A(:,k) = B\transpose(slope);
end
You can eliminate the ‘fai’ loop with:
fai = 1:N;
delta_LE = fai(:).*(A/A(1)).^2;
Note that ‘alpha’ was then calculated as a (100x100) matrix. Since I believe you may want it to be a (100x5) matrix, do element-wise division:
alpha = (alpha_inf)./(1+(alpha_inf)/(pi*AR));
The most serious problem is that ‘alpha’ and many of the rest of your values are all NaN. This is the result of 0/0, Inf/Inf, or existing NaN values. NaN values do not plot.
I defer to you to solve the NaN problems.
Best Answer