09-03-2007 10:32 AM
09-04-2007 03:38 AM
09-04-2007 03:50 AM
Thanks,
your option seems quite simple to implement, & I guess I know how to choose the first X0 & X1 values, deriving them from the user's choice on the actual regression curve monotonous sub zone.
Cheers
09-04-2007 04:05 AM
09-05-2007 05:15 AM
Hi Shane
a quick implementation of your method works fine with both order 2 & 3 polynomials, as long as I stick to the first X0 to X1 sub zone.
Here is the little VI I did put together. Coeff for both examples you see on the graph pictures are loaded when you run the VI.
If you choose order 2 for instance, an Y value that would be on the example curve, & the first X range from 1 to 4, GREAT approx.
If you do the same using X Range from 4.5 to 8 to get another solution, the method does not find the correct value & return one of the range limit.
Any idea how I should make the system more robust ? Users should still have to select the proper range.
Thanks
PS : sorry my math courses are so old...
Using LV 7.1 & LV8.20 on WXP SP2
09-05-2007 01:34 PM
09-05-2007 02:33 PM
First of all, don't use Levenberg Marquardt for a polynomial fit. It's overkill. There is a polynomial fit built-in. 🙂
Easiest would be to adjust your constant term by subtracting the desired y and use "Polynomial roots". Use all real solutions and ignore the imaginary ones. 🙂
09-05-2007 03:30 PM - edited 09-05-2007 03:30 PM
Message Edited by altenbach on 09-05-2007 01:30 PM
09-06-2007 11:43 AM
09-07-2007 03:45 AM
Thanks Shane
that was indeed very simple. I know I should get id of the formula node but I have no need for polynomials with different orders than 2 a 3.
Your simple correction makes it work fine
Thanks a lot