how do I solve symbolic eigenvalue?

조회 수: 26 (최근 30일)
marzie jamshidi
marzie jamshidi 2022년 5월 20일
댓글: Walter Roberson 2023년 2월 23일
this is my code:
syms ei l
h=l/4;
k=(2*ei/h^3)*[6 -3*h -6 -3*h; -3*h 2*h^2 3*h h^2; -6 3*h 6 3*h; -3*h h^2 3*h 2*h^2];
m=(1/(30*h))*[36 -3*h -36 -3*h; -3*h 4*h^2 3*h -h^2; -36 3*h 36 3*h; -3*h -h^2 3*h 4*h^2];
K(1,:)=[];
K(:,1)=[];
M(1,:)=[];
M(:,1)=[];
[v,d]=eig(K,M)
i recieved this error:
Error using sym/eig
Too many input arguments.
what should i do?
  댓글 수: 2
Star Strider
Star Strider 2022년 5월 20일
In the Symbolic Math Toolbox eig function, there is only one argument.
syms ei l
h=l/4;
k=(2*ei/h^3)*[6 -3*h -6 -3*h; -3*h 2*h^2 3*h h^2; -6 3*h 6 3*h; -3*h h^2 3*h 2*h^2];
m=(1/(30*h))*[36 -3*h -36 -3*h; -3*h 4*h^2 3*h -h^2; -36 3*h 36 3*h; -3*h -h^2 3*h 4*h^2];
% K(1,:)=[];
% K(:,1)=[];
% M(1,:)=[];
% M(:,1)=[];
[v,d]=eig(k)
v = 
d = 
.
Walter Roberson
Walter Roberson 2023년 2월 23일
Right, symbolic eig() does not support generalized eigenvalues.

댓글을 달려면 로그인하십시오.

답변 (2개)

VBBV
VBBV 2023년 2월 23일
I presume you need to compute the inverse of mass matrix , m, for a 4 x 4 stiffness matrix , before finding the Eigen solution. However, check the equations if they are correct
syms ei l
h=l/4;
k=(2*ei/h^3)*[6 -3*h -6 -3*h; -3*h 2*h^2 3*h h^2; -6 3*h 6 3*h; -3*h h^2 3*h 2*h^2]
k = 
m=(1/(30*h))*[36 -3*h -36 -3*h; -3*h 4*h^2 3*h -h^2; -36 3*h 36 3*h; -3*h -h^2 3*h 4*h^2]
m = 
V = m\k % Take the inverse of matrix m
Warning: Solution is not unique because the system is rank-deficient.
V = 
[v,d]=eig(V) % only one argument
v = 
d = 

Torsten
Torsten 2023년 2월 23일
syms ei l
h=l/4;
k=(2*ei/h^3)*[6 -3*h -6 -3*h; -3*h 2*h^2 3*h h^2; -6 3*h 6 3*h; -3*h h^2 3*h 2*h^2];
m=(1/(30*h))*[36 -3*h -36 -3*h; -3*h 4*h^2 3*h -h^2; -36 3*h 36 3*h; -3*h -h^2 3*h 4*h^2];
k(1,:)=[];
k(:,1)=[];
m(1,:)=[];
m(:,1)=[];
[v,d]=eig(inv(m)*k)
v = 
d = 

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by