error getting eigenvalues varying with time

2 views (last 30 days)
xcg = 0.15; rea = 0.5; xe = 0.35; cla=2*pi ; m= 5*pi; a0 = 0; wr = (1/2); mu = 1+(3*a0^2);
U = 0:0.01:1;
a1 = ((mu*((U.*cla)/2*m))*(/(1-(xcg^2/rea^2)); a2 = wr^2/(1); a3 = ((mu*((U.^2*cla)/2*m)*/(1-(xcg^2/rea^2)); b1 = (1-((mu*((U.^2*cla)/2*m))/(1-(xcg^2/rea^2)); b2 = ((-mu*((U.*cla)/2*m))*/(1-(xcg^2/rea^2)); b3 = (-wr^2*(xcg/rea^2))
A = [a2 1 0 a1;0 2 5 0;0 0 b3 1;0 -b2 -b1 0];
nt = length(U); v = zeros(4,4,nt); d =zeros(4,1,nt);
for i = 1:nt [V,E] = eig(A); v(:,:,i) = V; d(:,1,i) = diag(E); end I am trying to get eigen valuse and vectors from corresponding time, but running into an error Error using vertcat Dimensions of arrays being concatenated are not consistent. A = [a2 1 0 a1;0 2 5 0;0 0 b3 1;0 -b2 -b1 0];
any suggestions? Also since I am getting two lambda (each being +/-) how would i be able to plot these eigenvaluse respect to U? please help!

Accepted Answer

Walter Roberson
Walter Roberson on 4 Oct 2021
You need to fix a1, which has the invalid syntax (/( and is missing two )
You need to fix a3, which has the invalid syntax */ and is missing two )
You need to fix b1, which is missing two )
You need to fix b2, which has the invalid syntax */ and is missing one )
Please recheck a2, which divides by 1: explicit division by 1 is confusing, suggesting that something went missing
xcg = 0.15; rea = 0.5; xe = 0.35; cla=2*pi ; m= 5*pi; a0 = 0; wr = (1/2);
mu = 1+(3*a0^2);
U = reshape(0:0.01:1, 1, 1, []);
nU = numel(U);
sU = size(U);
a1 = ((mu*((U.*cla)/2*m))*(/(1-(xcg^2/rea^2));
a2 = repmat(wr^2/(1), sU);
a3 = ((mu*((U.^2*cla)/2*m)*/(1-(xcg^2/rea^2));
b1 = (1-((mu*((U.^2*cla)/2*m))/(1-(xcg^2/rea^2));
b2 = ((-mu*((U.*cla)/2*m))*/(1-(xcg^2/rea^2));
b3 = repmat((-wr^2*(xcg/rea^2)), sU);
A = [a2 ones(sU) zeros(sU) a1;
2*ones(sU) 5*ones(sU) zeros(sU);
zeros(sU) zeros(sU) b3 ones(sU);
zeros(sU) -b2 -b1 zeros(su)];
v = zeros(4,4,nU);
d =zeros(4,1,nU);
for i = 1:nU
[V,E] = eig(A(:,:,i));
v(:,:,i) = V;
d(:,1,i) = diag(E);
end

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!