Too many input arguments using EIG function
Too many input arguments using EIG function
(OP)
I have a simple eigenvalue problem I'm needing to solve. I'm using R14. Here is my m-file input:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
syms A E L p
% Stiffness matrix
K = ((A*E)/(15*L))*[35 -40 5;
-40 80 -40;
5 -40 35]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CONSISTENT MASS METHOD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Consistent mass matrix
Mc = p*A*L*[2/15 -1/6 7/15;
-1/6 1/3 -1/2;
7/15 -1/2 32/15]
eig(K,Mc)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
When matlab tries to evaluate for the generalized eigenvalues it gives me the dreaded "??? Error using ==> sym.eig Too many input arguments." error. My first suspicion is that it can't handle all of the parameters such as p, A, E, and L that I've premultiplied K and Mc by. Does anyone have a suggestion of what a better approach may be?
Thank you!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
syms A E L p
% Stiffness matrix
K = ((A*E)/(15*L))*[35 -40 5;
-40 80 -40;
5 -40 35]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% CONSISTENT MASS METHOD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Consistent mass matrix
Mc = p*A*L*[2/15 -1/6 7/15;
-1/6 1/3 -1/2;
7/15 -1/2 32/15]
eig(K,Mc)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
When matlab tries to evaluate for the generalized eigenvalues it gives me the dreaded "??? Error using ==> sym.eig Too many input arguments." error. My first suspicion is that it can't handle all of the parameters such as p, A, E, and L that I've premultiplied K and Mc by. Does anyone have a suggestion of what a better approach may be?
Thank you!





RE: Too many input arguments using EIG function
Yes.
" Does anyone have a suggestion of what a better approach may be?"
I would do that one by hand if you are after a general expression.
Fe
RE: Too many input arguments using EIG function
eig(inv(Mc)*K)
Then your eignevalues will be w^2
Also I'm not sure but you may need to declare M and K as syms
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Too many input arguments using EIG function
The standard eigenvalue problem is [A-Lambda*I] x = 0
Matlab is expecting you to feed it A (it doesn't know what the heck M and K are!)
You have
w^2 M * X = K*X
w^2*X = Minv * K * X
(Minv*K – w^2*I)X = 0
This is in the same standard eigenvalue form as above with
A = Minv*K
Lambda = w^2
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Too many input arguments using EIG function
i.e. such that
[K]*[phi]=[lambda][M][phi]
M
--
Dr Michael F Platten
RE: Too many input arguments using EIG function
h
Suggests that the overloaded symbolic form does not do generalised eigenvalues.
Have you tried
eig(M\K)?
--
Dr Michael F Platten
RE: Too many input arguments using EIG function
I would think that the "general" eigenvalue formulation takes a single argument A.
Anything that takes two arguments M and K would be a special application to vibration. It is a very small subset of the possible uses of eigenvalues.
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Too many input arguments using EIG function
Anyway, electricpete, it appears the answer to the question of how to do it symbolically is the one you originally suggested. It appears that the backslash operator is not applicable to symbolic objects and you are reduced to using the inv() function and using the simple rather than generalised eigenvalue solver.
M
--
Dr Michael F Platten
RE: Too many input arguments using EIG function
I recommend the alternative software Maple.
It should be able to perform this problem very quickly.
In Matlab, as the others have indirectly mentioned, a numerical approach is solvable.
Do it by hand and then correlate the answer you get...
Fe
RE: Too many input arguments using EIG function
Also as previously discussed, the symbolic form of eig accepts one and only one argument corresponding to A... which is perfectly logical to me. The fact that there is any general eigenvalue routine not tailored to vibration that directly accepts M and K matrices is a surprise to me, but apparently fairly common. Personally I will stick with straightforward single argument A so I know exactly what it's doing in accordance with the unambiguous universal defintion of eigenvalue... without having to dig inot the reference information to figure out which one goes first (M or K) in order to determine whether my eigenvalue is going to be w^2 or 1/w^2.
By the way, my ancient version of Maple (Maple V version 4) doesn't do symbolic eigenvalues. It does do numeric eigenvalues... and does accept one or two matrix arguments.
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Too many input arguments using EIG function
=====================================
Eng-tips forums: The best place on the web for engineering discussions.
RE: Too many input arguments using EIG function
I just thought it would be easier if the OP did it in Maple.
Personally, I don't like the Matlab symbolic toolbox. The one I use has such a large computation time for even simple problems. (don't get me wrong, I use Matlab for almost everything else)
Anyways, I don't see why one would not do it by hand still.
(unless we are talking about a 5by5 ect. eigenvalue problem)
Fe
RE: Too many input arguments using EIG function