×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Too many input arguments using EIG function

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!

RE: Too many input arguments using EIG function

" 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"

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.  

peace
Fe

RE: Too many input arguments using EIG function

Matlab knows nothing about vibration. It is solving a standard eigenvalue problem.  You need to reformulate as eigenvalue problem and feed it one matrix. For example
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

Just to back up a bit.
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 don't know about the symbolic toolbox overloaded version, but eig(K,M) is a valid matlab expression numerically. I use it all the time. It calculates the eigenvalues of K w.r.t. M.

i.e. such that

[K]*[phi]=[lambda][M][phi]

M

--
Dr Michael F Platten

RE: Too many input arguments using EIG function

I may be misunderstanding the term "generalized", but...

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

I'm no numerical linear algebra expert, but I think by leaving it in the generalised eigenvalue form (see my 1st post), the eigenvalue calculation is much quicker (so long as the 2 matrices are symmetric) because Cholesky factorisation can be used and no inversion of the mass matrix is necessary. It probably makes next to no difference for a 3x3 matrix though.

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

For symbolic;
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...

peace
Fe

RE: Too many input arguments using EIG function

Quote:

In Matlab, as the others have indirectly mentioned, a numerical approach is solvable.
It can be solved in Matlab symbolically as discussed above: eig(inv(Mc)*K)

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

Quote:

By the way, my ancient version of Maple (Maple V version 4) doesn't do symbolic eigenvalues.
I should clarify... it doesn't have a function built in for this. But it is trivial excercize in Maple to build a symboic matrix A-Lambda*I,  then compute the determinant, the find the values of Lambda where determinant is 0 (the eigenvalues).. all done symbolically.   

=====================================
Eng-tips forums: The best place on the web for engineering discussions.

RE: Too many input arguments using EIG function

I didn't mean to contradict.
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)

peace
Fe

RE: Too many input arguments using EIG function

(OP)
Thank you for the suggestions!  I ended up using eig(inv(Mc)*K) to solve for the eigenvalues.  This worked superbly and is a great work around.  I'm programming a finite element eigenvalue solver.  I find doing this symbolically keeps things more general and easier to use and book keep.

 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Design for Additive Manufacturing (DfAM)
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now