LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I force a nonlinear (quadratic) curve fit through the origin?

I need to curve fit 2D data to a polynomial and that fit must pass through the origin.  The data will be collected by instrumentation and supplied on the fly so I would like to use the curve fitting routines to acheive this but I cannot find anything that forces the line through zero.
0 Kudos
Message 1 of 3
(4,479 Views)
You can use General LS fit.
 
If you look at the "general Polynomial Fit" vi in LabVIEW 7.0, the code is exposed as in the attached image (sorry, beginning with LabVIEW 7.1 this stuff is done directly in a dll). You just need to slighly reengineer it to eliminate the first term when building the H matrix.
From what I can tell, you could just move the "+1" node from its current place to after the iteration terminal in the inner loop.
I think this should do it, but please verify. Good luck! 🙂
 
The first term in the result will be the linear term, next the quadratic, etc.
 

Message Edited by altenbach on 01-10-2006 04:25 PM

Message Edited by altenbach on 01-10-2006 04:43 PM

Download All
Message 2 of 3
(4,479 Views)
Thanks!!!! That worked perfectly!!!
0 Kudos
Message 3 of 3
(4,439 Views)