LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When fitting an exponential curve, how can you


get the fitting to implement a Y offset to the
fitted data? The offset changes from sample to sample, so it would need to calculate that also.
0 Kudos
Message 1 of 3
(2,898 Views)
Look at the nonlinear lev-mar fit. This curve fit routine is supplied with an example equation that it fits to, but you can "save as" and create your own lev-mar curve fit to any equation that you plug in. I used it successfully to curve fit to an exponential+sinwave type equation.
Stu
0 Kudos
Message 2 of 3
(2,898 Views)
I'm with Stu--go with the Nonlinear Lev-Mar Fit. The helpful aspect for you is that the default fit equation hardwired into its "Target Fnc & Deriv Nonlin" subVI is actually the very function you're trying to fit:

y = a0*exp(a1*x) + a2

Here, a2 is the offset you're asking about. If you simply wire your X and Y value arrays into the Lev-Mar inputs and provide an Initial Guess Coefficients input of [1,1,0], you'll probably get a decent result for data that crosses close to zero.

Regards,
John Lum
National instruments
Message 3 of 3
(2,898 Views)