02-03-2010 11:35 AM
(xpost: http://lavag.org/topic/11870-multiparameter-nonlinear-multi-curve-fit/)
There is a model of a physical process formalized in LabVIEW simulation toolkit. It take a set of parameters, and produces time dependencies of observables. I have an experimental data, same time dependencies of observables, but measured on a real system. I would like to get the set of parameters, so that model curves will fit experimental. I have an idea of the initial values of the parameters. Sample of data is provided below:
Points are experimental data, curves are the results of manual fitting, using the above mentioned model.
Had there been one curve, it would have been easy. I would have used NonlinearCurveFit.vi, and supply it with a reference to a model curve generating VI. What can I do with multiple curves? I really would like to avoid porting the fitting
algorithm from the Numerical Recipes. I would also like to avoid writing a wrapper (OriginC <-> LabVIEW) to do a linked fit in Originlab Origin. I can use Matlab, of course, but it will require writing another wrapper. Is there a quick way of doing it, without leaving LabVIEW?
Solved! Go to Solution.
02-03-2010 01:40 PM - edited 02-03-2010 01:40 PM
One way to do this is to "stack" your different curves into a single 1D array and fit them. Here is an example of fitting a*exp(-x/x0) and a(1-exp(-x/x0)) simultaneously. In exponentials.vi I take a single x array and output concatenated arrays for f(x,a) as well as the derivatives. In the curve fitting routine, there is no requirement that x be single valued or continuous, or ordered, etc. It is just a pile of data, and as long as you can properly calculate a guess for each data point you are alright.
02-03-2010 01:43 PM
06-22-2010 04:41 PM
Can you convert this to LabView 8.6?
Thanks in advance.
06-22-2010 05:00 PM
In LV8.6