The "solve" system is not solving my variables
Show older comments
I have a for loop creating a super equation that is the sum of a group of equations that could use variables A1 to A7. Each looping would increase the amount of As, which means amount of equations in that group. The super equation would then be solved.
cb = 1/5.25; %reverse of aspect ratio
cla = 2*pi; %the slope of lift vs aoa
aa = 5*pi/180; % radiant value of 5 degree
N = [3 5 7]; %list of possible N value
syms a1 a2 a3 a4 a5 a6 a7 temp
A = [a1 a2 a3 a4 a5 a6 a7]; %list of possible An
eqn = A; %list of possible equations
solved = A;
for i = 1:3
counter = N(i);
Acou = A(1:counter);
anslist = Acou;
eqncou = eqn(1:counter);
spandiv = (pi/2)/counter;
for j = 1:counter
for k = 1:counter
if rem(j,2)~=0
anslist(k) = A(k)*(sin(k*(spandiv*j)))+0.25*cb*cla*sin(k*(spandiv*j))/sin(spandiv*j);
else
anslist(k) = 0;
end
temp = temp + anslist(k);
end
eqncou(j) = temp == 0.25*cb*2*pi*aa;
end
solve(eqncou)
end
However, instead of seeing a solution in a1 to a3 or a5 or a7, a3, a5, and a7 are always missing from the solutions and instead, there is a temp in the solution. Could you tell me why?
ans =
struct with fields:
a1: [1×1 sym]
a2: [1×1 sym]
temp: [1×1 sym]
ans =
struct with fields:
a1: [1×1 sym]
a2: [1×1 sym]
a3: [1×1 sym]
a4: [1×1 sym]
temp: [1×1 sym]
ans =
struct with fields:
a1: [1×1 sym]
a2: [1×1 sym]
a3: [1×1 sym]
a4: [1×1 sym]
a5: [1×1 sym]
a6: [1×1 sym]
temp: [1×1 sym]
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!