LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a labview VI that will fit a data set to a bi-exponential decay?

I am writing a VI that requires that I fit an acquired dataset to a bi-exponential decay:

y=a*exp(-b*t)+c*exp(-d*t)

So far, I have found no way to do this within labview and am forced to export the data and process it externally. I have seen a fit-function for a single exponential. Does anyone know where I can find a VI to fit data to a bi-exponential?
0 Kudos
Message 1 of 3
(3,512 Views)
If you can do it externally, I presume you have some C-code that will do the fit for you. Create a library (on windows a .dll file) with your code and link labview against it. Since it is a normal library, you can debug it rather easily, using standard tools. See the "Using External Code in LabVIEW" pdf-file that comes with LabVIEW 6.

A different method is to use the "Levenberg Marquardt.vi" from the from the Curve Fitting palette. (FDS and Higher only?). This will allow you to specify your own function to fit to (even at run-time). Disadvantage: it is painfully slow, as the maths is interpreted and not compiled as the rest of LabVIEW: a recipe for slowness. But it will allow you to test you fitting.

However, if you make a copy of the "Levenberg Marquardt.vi" (save a
copy as...), it can be hacked to accept vi references and use those for calculations: usually a 10-fold or more increase in speed. Requires some work, and I don't think you are allowed to distribute the result.
0 Kudos
Message 2 of 3
(3,512 Views)
Hi Steve,

In LV6i (Advanced Only) there is a function called General LS Linear
Fit.
In the help is an example on how to use it with several functions.
It should do the job, but I haven't tried it yet.

Stephan Heising

Steve E wrote:
>
> I am writing a VI that requires that I fit an acquired dataset to a
> bi-exponential decay:
>
> y=a*exp(-b*t)+c*exp(-d*t)
>
> So far, I have found no way to do this within labview and am forced to
> export the data and process it externally. I have seen a fit-function
> for a single exponential. Does anyone know where I can find a VI to
> fit data to a bi-exponential?

--
Stephan Heising Tel: +41 22 76 72160
PS Division Fax: +41 22 76 79145
CERN G01620
CH 1211 Geneve 23 email: stephan.heising@cern.
ch
0 Kudos
Message 3 of 3
(3,512 Views)