andreasvarga / MatrixEquations.jl

Solution of Lyapunov, Sylvester and Riccati matrix equations using Julia
MIT License
82 stars 8 forks source link

Algebraic equation in matrix form #22

Closed TrumeAAA closed 1 year ago

TrumeAAA commented 1 year ago

Hi, I wanted to solve a Algebraic equation in matrix form that looks like: 屏幕截图 2022-11-21 194159 屏幕截图 2022-11-21 194226 The equation has the form: AX=0 So I need to solve det(A)=0 with respect to k. Actually it is a Algebraic equation in matrix form, is it possible to solve it with MatrixEquations.jl ? Note: It is easy to do it by running: syms k; solution = double(solve(det(A))); Any suggestion will be helpful, Thank you very much!

andreasvarga commented 1 year ago

The short answer is: MatrixEquations is not suited to solve your problem.

However, apparently you have to solve an eigenvalue problem of the form P(k)*x = 0, where P(k) is a second order polynomial matrix in the indeterminate k, which can be written as P(k) = P0+k*P1+k^2*P2 with P0, P1, P2 constant matrices. To compute the eigenvalues of such a matrix you can try to use, for example, the function pmeigvals available in the MatrixPencils package.

TrumeAAA commented 1 year ago

Thanks a lot! I will try it!