Different results with same code??
4 ビュー (過去 30 日間)
古いコメントを表示
Please consider 2 scripts below, this supposed to be output the same results of D but it doesn't
script 1:
m_s = 2000; %(kg) Sprung mass
m_u = 200; %(kg) Un-sprung mass
k_s = 200000; %(N/m) Suspension stiffness
k_u = 870000; %(N/m) Tire stiffness
c_s = 6000; %(Ns/m) Damping coefficient
M = [m_u 0;0 m_s];
K = [k_s+k_u -k_s; -k_s k_s];
A = M\K;
[V,D] = eig(A);
D
script 2:
m_s = 2000; %(kg) Sprung mass
m_u = 200; %(kg) Un-sprung mass
k_u = 870000; %(N/m) Tire stiffness
c_s = 6000; %(Ns/m) Damping coefficient
syms k_s
M = [m_u 0;0 m_s];
K = [k_s+k_u -k_s; -k_s k_s];
A = M\K;
[V,D] = eig(A);
k_s = 200000;
D=double(subs(D))
THANK YOU!
9 件のコメント
ali hassan
2020 年 11 月 27 日
編集済み: ali hassan
2020 年 11 月 27 日
brother these are eigen values and you have got two answers and the position does'nt matter in my reckoning.
did u get it or i need to explain more??
if u want i can
ali hassan
2020 年 11 月 27 日
actually i hope you know but just to remind you.
actually D is a scalor value and when it is multipled with the eigen vector it satisfies the equation
w’A = Dw’
here D is a scalor value and you have got two different values which means when you will multiply your two values one by one with the eigen vector, you must get the left side of equation(w’A) and it is true in your case. so dont get puzzled with the sequence.
採用された回答
VBBV
2020 年 11 月 27 日
編集済み: VBBV
2020 年 11 月 27 日
D=double(subs(D,k_s))
Use the variable k_s as argument, I get the same results now
m_s = 2000; %(kg) Sprung mass
m_u = 200; %(kg) Un-sprung mass
k_s = 200000; %(N/m) Suspension stiffness
k_u = 870000; %(N/m) Tire stiffness
c_s = 6000; %(Ns/m) Damping coefficient
M = [m_u 0;0 m_s];
K = [k_s+k_u -k_s; -k_s k_s];
A = M\K;
[V,D] = eig(A);
D
D =
1.0e+03 *
5.3690 0
0 0.0810
clear
m_s = 2000; %(kg) Sprung mass
m_u = 200; %(kg) Un-sprung mass
k_u = 870000; %(N/m) Tire stiffness
c_s = 6000; %(Ns/m) Damping coefficient
syms k_s
M = [m_u 0;0 m_s];
K = [k_s+k_u -k_s; -k_s k_s];
A = M\K;
[V,D] = eig(A);
k_s = 200000;
D=double(subs(D,k_s))
D =
1.0e+03 *
5.3690 0
0 0.0810
1 件のコメント
その他の回答 (2 件)
VBBV
2020 年 11 月 27 日
It depends on values for input variables inside the M and K matrices If you use different values for each of script the resulting D will not be same
1 件のコメント
ali hassan
2020 年 11 月 27 日
***if we use same values for each of script the resulting D will not be same.
right???
Steven Lord
2020 年 11 月 27 日
編集済み: Steven Lord
2020 年 11 月 27 日
m_s = 2000; %(kg) Sprung mass
m_u = 200; %(kg) Un-sprung mass
k_s = 200000; %(N/m) Suspension stiffness
k_u = 870000; %(N/m) Tire stiffness
c_s = 6000; %(Ns/m) Damping coefficient
M = [m_u 0;0 m_s];
K = [k_s+k_u -k_s; -k_s k_s];
A = M\K;
[Vdbl,Ddbl] = eig(A);
Ddbl;
syms k_s
M = [m_u 0;0 m_s];
K = [k_s+k_u -k_s; -k_s k_s];
A = M\K;
[Vsym,Dsym] = eig(A);
k_s = 200000;
Dsym2=double(subs(Dsym));
isequal(sort(diag(Ddbl)), sort(diag(Dsym2)))
Ddbl and Dsym2 do contain the same diagonal elements, but the order of those elements along the diagonal is not the same. If you swap the columns of Vsym accordingly you'll see that each eigenvector in Vdbl is a non-zero scalar multiple of the corresponding eigenvector in Vsym. If v is an eigenvector of A with eigenvalue d, k*d is also an eigenvector of A with eigenvalue d for any non-zero scalar k.
format longg
Vdbl./fliplr(double(subs(Vsym)))
So same answers, just in a different order in the output.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Operating on Diagonal Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!