LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to curve fit a nonlinear implicit function?

Hi
 
I would like to fit a least squares curve to a set of data points.  I see I can do this using general LSQ fit.vi or Levenberg-Marquadt, but these VIs seem to only handle implicit functions of the form y=f(x,A). 
 
What if I have a data set from a known implicit function, for example a circle:
 
(x-x0)^2 + (y-y0)^2 - r^2 = 0
 
How can I calculate the x0, y0 and r that minimizes the square error?  Can this be done using the L-M VI or a VI from a different toolkit?
 
 
Thank you.
__________________________________
Laine
0 Kudos
Message 1 of 3
(3,107 Views)
This can be considered as an optimization problem. For a circle, you could use the fitting on a sphere vi (in the math > optimization sub-palette), giving 0 as z coordinates.  See the attached vi.
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 3
(3,092 Views)

Fantastic, worked like a charm!

Thanks.

__________________________________
Laine
0 Kudos
Message 3 of 3
(3,085 Views)