cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

2-Guest

## Problems with polyroots function

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!

1 ACCEPTED SOLUTION

Accepted Solutions
24-Ruby V
(To:kdaniel97)

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.

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:

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.

Worksheet attached (in Format MC11)

2 REPLIES 2
23-Emerald III
(To:kdaniel97)

?

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

24-Ruby V
(To:kdaniel97)

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.

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:

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.

Worksheet attached (in Format MC11)

Announcements
Top Tags