mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.48k stars 895 forks source link

Is it possible to solve generalized eigenvalue problems using MathNet.Numerics? #754

Closed EmilPoulsen closed 3 years ago

EmilPoulsen commented 3 years ago

Hi. Many thanks for this great library.

I was wondering if there is a way to compute the generalized eigenvalue problem with MathNet.Numerics of the form:

| K − λM |= 0

where both K and M are symmetrical matrices. A common use case for this is computing natural frequencies of structures in structural dynamics, where K and M represent the stiffness and mass matrices.

The MATLAB equivalent of this is:

[V,D] = eig(a,b)

Any input would be greatly appreciated. Thanks

wo80 commented 3 years ago

If M is positive definite, you can use the Cholesky factorization to solve the generalized problem like done here.

EmilPoulsen commented 3 years ago

thanks @wo80! that should work