Skip to main content
1-Visitor
May 27, 2019
Solved

Problems with polyroots function

  • May 27, 2019
  • 2 replies
  • 1951 views

Im a newbie in mathcad, im using mathcad 15. My problem is that somehow polyroots isnt working properly for me. I attached an example, which explains my problem. My original task is to create a program, which solves a function, similar to the one u can find in the example file. One of the coeffecients (the constant) is the function of time in my task. Then i have to pick out the appropriate real root and illustrate it as the function of time. Unfortunately polyroots is the only suitable way to execute the task according to my short term mathcad knowledge. Thanks for the help!

Best answer by Werner_E

Luc guessed it without seeing your worksheet - chapeau bas!

The problem is the algorithm which is per default "LaGuerre". If you change it to "Companion Matrix" by right clicking the word "polyroots" you get what you want.

B1.png

 

I am not sure if I understood correctly what you are finally after. You want to change the constant (-30.995) and pick the real valued solution (possibly the positive one). If thats true, you might as well use a solve block which you can turn into a function of that variable constant:

B2.png

And if you know for sure that the seached for values always are, lets say, between 0 and 10, you may even use the "root" command for the task.

B3.png

 

Worksheet attached (in Format MC11)

2 replies

23-Emerald IV
May 27, 2019

I can't read your file. Does this help:

LM_20190527_Polyroots.png

?

Note that when your dynamic range is big (large ratio's of coefficients) it may be wise to choose the best algorithm. Select the polyroots function, press the right-mouse button and select between LaGuerre (default) and Companion Matrix...

 

Success!
Luc

Werner_E25-Diamond IAnswer
25-Diamond I
May 27, 2019

Luc guessed it without seeing your worksheet - chapeau bas!

The problem is the algorithm which is per default "LaGuerre". If you change it to "Companion Matrix" by right clicking the word "polyroots" you get what you want.

B1.png

 

I am not sure if I understood correctly what you are finally after. You want to change the constant (-30.995) and pick the real valued solution (possibly the positive one). If thats true, you might as well use a solve block which you can turn into a function of that variable constant:

B2.png

And if you know for sure that the seached for values always are, lets say, between 0 and 10, you may even use the "root" command for the task.

B3.png

 

Worksheet attached (in Format MC11)