Skip to main content
1-Visitor
May 22, 2016
Solved

Variable in determinant

  • May 22, 2016
  • 3 replies
  • 3928 views

I have an equation like det((-a^2)*M+S)=0, where M and S are matrices. How can I find the two solutions (the two roots) for a? It will be a biquadratic equation, and I need the two positive roots of the four. I've tried it with a solve block, but I could only one root calculated. 

Thanks a lot!

Best answer by Werner_E

When asking a question about Mathcad it would be beneficial if you state which version of Mathcad or Prime you are using and if you post the worksheet to make clear what you are searching for.

As you say you are getting a biquadratic equation in a it seems like M and S should be 2x2 matrices.

The numeric solve block will only give you one solution, depending on the guess value. A different guess might give you the second solution. If you are looking for an non-real solution, the guess has to be non-real, too.

The get all solutions at once you have two ways to go.

Either use the symbolic "solve" command

where you can restrict the solution to real values using the "assume" keyword

or you can use the numeric "polyroot" function which needs the vector of the coefficients of your polynomial as argument.

I use the symbolic "coeffs" to create that vector so that I don't have to type it in by hand,

"polyroot" is a numeric function and as you can see we experience some numerical inaccuracies (the real part of the imaginary solutions is not exact zero).

We can cope with that by setting either the zero tolerance threshold or zhe Complex threshold to a lower value than 9. At least we can do so in Mathcad 15 and below - I don't think that Prime offers a way to do so:

Hope that this helps. Otherwise please post your worksheet.

Regards

Werner

3 replies

19-Tanzanite
May 23, 2016

This would be easier to deal with if you specified the matrices M and S here.

Alan

tbalázs1-VisitorAuthor
1-Visitor
May 23, 2016

Sorry, I'm tottaly new in this site and almost in Mathcad.

In the next answer, Werner Exinger answered my question, and I got the same result as I had calculated manually.

Thanks, Thomas

Werner_E25-Diamond IAnswer
25-Diamond I
May 23, 2016

When asking a question about Mathcad it would be beneficial if you state which version of Mathcad or Prime you are using and if you post the worksheet to make clear what you are searching for.

As you say you are getting a biquadratic equation in a it seems like M and S should be 2x2 matrices.

The numeric solve block will only give you one solution, depending on the guess value. A different guess might give you the second solution. If you are looking for an non-real solution, the guess has to be non-real, too.

The get all solutions at once you have two ways to go.

Either use the symbolic "solve" command

where you can restrict the solution to real values using the "assume" keyword

or you can use the numeric "polyroot" function which needs the vector of the coefficients of your polynomial as argument.

I use the symbolic "coeffs" to create that vector so that I don't have to type it in by hand,

"polyroot" is a numeric function and as you can see we experience some numerical inaccuracies (the real part of the imaginary solutions is not exact zero).

We can cope with that by setting either the zero tolerance threshold or zhe Complex threshold to a lower value than 9. At least we can do so in Mathcad 15 and below - I don't think that Prime offers a way to do so:

Hope that this helps. Otherwise please post your worksheet.

Regards

Werner

tbalázs1-VisitorAuthor
1-Visitor
May 23, 2016

Thank you very much, I was able to solve it with the "solve" command.

Thomas

21-Topaz II
May 23, 2016

The given equation, with simple algebraic operations turns into a eigenvalue equation. See the following examples:

Eigenvalues equations.jpg

about eigenvalues. A quick explanation.jpg