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

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

How to get polynomial coeffs in program block?

ifomenko
15-Moonstone

How to get polynomial coeffs in program block?

Hi guys!

I need your help again 🙂

How to get polynom coeffs in program block.PNG

MC15 file is attached.

 

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:ifomenko)

Try this.

 

Success!
Luc

View solution in original post

9 REPLIES 9

How about the attached?

 

ifomenko
15-Moonstone
(To:Werner_E)

Thank you Werner!

Sorry, I marked LucMeekes`s answer as correct because of his level is less than yours, don`t be offended by me 🙂


@ifomenko wrote:

Thank you Werner!

Sorry, I marked LucMeekes`s answer as correct because of his level is less than yours, don`t be offended by me 🙂


Don't worry! Most of us don't care about that level, points, ... 🙂

 

BTW, the main point is that the symbolic evaluation must be done INSIDE the program. In your trials you evaluated the whole function symbolically which happens automatically if the function is just a one-liner.

That was the reason for my dummy line with the quotes.

As an alternative you can put the symbolic eval in parenthesis like ...:=(t coeffs, x[i -> )

 

All this won't work in Prime, BTW, as they have broken the possibility to insert symbolic evals inside programmed functions 😞

LucMeekes
23-Emerald III
(To:ifomenko)

Try this.

 

Success!
Luc

ifomenko
15-Moonstone
(To:LucMeekes)

Luc!

I made some critical changes with your function, it has to return 3x3 matrix.

coeffsOfVectorFunction.PNG

LucMeekes
23-Emerald III
(To:ifomenko)

No problem.

I took it one step further. It now should work for n equations (with n variables) and independent on the setting of ORIGIN.

LM_20190206_Coeffs.png

Success!
Luc

ifomenko
15-Moonstone
(To:LucMeekes)

Why there is an error in the first case (rows({Coeffs}) but there is not in the second (rows(scalar))?

why different.PNG

LucMeekes
23-Emerald III
(To:ifomenko)

That's potentially because {Coeffs}  is symbolic, so the numeric processor complains if there it contains any undefined variables.

The numeric processor never complains about 1000.

I don't mind as long as the function functions.

 

Success!
Luc

ifomenko
15-Moonstone
(To:LucMeekes)

I see, many thanks

Top Tags