11-24-2009 06:40 PM
I understand examples to use the roots.vi to solve 0=Ax^2+Bx+C for the polynomial roots when the coeficients are known...
But how do I find the polynomial roots for 0=Ax^y+Bx+C where y=.625 for example? Ideally I would like to do this in matscript which I am already using.
Hopefully this is a trivial question but I am over my head!
Thanks in advance!
Solved! Go to Solution.
11-24-2009 09:51 PM
Your second equation is not a polynomial, but at any rate I would investigate the fzero MathScript Function to find the zeros.
http://zone.ni.com/reference/en-XX/help/371361E-01/lvtextmath/msfunc_fzero/
11-25-2009 08:52 AM
Can someone give me an example of how to use fzero to solve for the roots of 0 = Ax^.625 + Bx + C? Or any other MathScript method. As I have said, this is new to me and example code is rare!
Thanks again.
11-25-2009 08:59 AM
11-25-2009 09:08 AM
Giving me the same answer again that I was responding to is of no help. I have read the referenced page several times and tried to code it for my equation but am getting nowhere. Is posting a working example VI using this function to solve my specific equation possible?
Thanks
11-25-2009 09:09 AM - edited 11-25-2009 09:18 AM
Oh, sorry. I didn't see that Darin had posted that link....
Follow the instructions on that link and you get a working example...
Save the following script as nonlinzero.m in a directory in the MathScript search path:
11-25-2009 09:24 AM
11-25-2009 09:29 AM
Tim - Thanks for the help. My test vi is exactly as your posted example. The rub is the script - which you did not post?
In any event I am not sure this is going to be a workable solution as my polynomial coefficients are calculated and change constantly. I can not hard code them in a script. Does that make sense?
11-25-2009 09:34 AM
The script is 4 lines. And I copied and pasted it directly from that help page. Make sure you save it where it tells you to (default is My Documents\Labview Data). Or save it at a custom directory, but make sure you tell labview to look there.
11-25-2009 09:52 AM