LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Non-Linear Fitting

Hi,

I have a problem, and someone may be able to help me. Let me first
explain what it is that I want to do, and then why I can't get it to
work.

Once again the problem is a non-linear fitting problem. The function
which I want to fit to my data is an exponential decay, much like the
standard function in the G-library. The origin of the decay is not
important, the important bit is that I have noise on the decay that is
known to be distributed with a poisson distribution. Therefor I want
to fit in two steps: 1 - keep baseline fixed (to zero) and from this
fit make an estimate of the noise in each point. 2 - fit again, but
this time with the approximated noise level as the weighing factor.

The Levenberg-Marquardt algorithm in the standard library is the
algorithm I want to use, but (here comes the problem) with a few
tweaks.

1) I want to be able to hold some variables during the fit. To do this
I want to give a parameter-enable vector to the function. This looks a
lot like the function as described in "Numerical Recipes in [your
favorite programming language, but not G]"

2) I'd like to be able to pass a reference to a fit-function (vi) to the
library, so that I could (in the future) use a more elaborate function
to do the fit, without having to rewrite the whole fitting vi. This is
something that is seriously lacking from the NI supplied vi's.

3) The termination conditions should be passed to the fit-vi's.

Since I'll be using the vi's under Linux, I don't have any serious
objections against using CIN's. Both compiler and LV CIN tools are
available. CIN's take away some flexibility, but once they work,
they're fine. I know enough about C to write my own fitting function,
so if the basic construct is OK, everything should be alright 🙂 (this
last option of course takes away the possibility of using vi
references, so I guess getting everythig to work is more important 🙂

Greetings,

Maarten Sneep

sneep@nat.vu.nl
(please CC your reply to me as well, otherwise I might miss it completely)
0 Kudos
Message 1 of 1
(2,424 Views)