LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fitting a parabola using a polynomial fit of order 2.

Hello, 

 

I'm trying to fit a parabola using a polynomial fit of order 2.

I have 11 data points that represent the shape of a parabola. Unfortunately, the X data have values very highly (about 10E6) and I think that it's causing problems in the data fitting. How can I solve this problem?

 

I have attached the Vi where I'm trying the fitting. As you can see, the fitting isn't done properly.

 

Any help will be appreciated.

 

Thank you.  

0 Kudos
Message 1 of 6
(4,304 Views)

I do not have one subVI what you used in your code, but anyway, it is not needed. You can play with some settings of the fit VI, it can give usable results:

 

fitting_parabola.png

0 Kudos
Message 2 of 6
(4,283 Views)

Thank you for your fast response.

 

Now the parabola fitting works properly.
However, I want that the fitting curve has more than 11 points because I need a low resolution. I'm trying to evaluating the polynomial (with the coefficients provided by the fit Vi) at different points (between the X limits) but it doesn't work. Is this due to the highly values of X data?

 

0 Kudos
Message 3 of 6
(4,261 Views)
I guess you wanted to write high resolution not low 🙂 It is very simple what you want: just generate let's say 100 X values in the desired range, and calculate the corresponding Y values using the coefficients from the fit. I'm from my phone now, but later I can show you how to do it...
0 Kudos
Message 4 of 6
(4,252 Views)
But if this is a home work, pls first try to do it yourself, that is the way of learning...
0 Kudos
Message 5 of 6
(4,249 Views)

Have you looked at the Help for General Polynomial Fit?  In particular, have you looked at the Default Values for all of the parameters?  Do you know the difference between the three Methods and seven Algorithms?  I believe a problem like yours has a "logically best" choice of settings which I don't think have been selected yet in this discussion.

 

It is always a good idea to understand Algorithms before applying them.

 

Bob Schor 

0 Kudos
Message 6 of 6
(4,235 Views)