error getting eigenvalues varying with time

3 ビュー (過去 30 日間)
PetronasAMG
PetronasAMG 2021 年 10 月 4 日
コメント済み: Rena Berman 2021 年 11 月 5 日
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!
  1 件のコメント
Rena Berman
Rena Berman 2021 年 11 月 5 日
(Answers Dev) Restored edit

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2021 年 10 月 4 日
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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by