03-31-2014 08:04 AM - edited 03-31-2014 08:05 AM
Hello
I want to make a non linear fit of diodes characteristics.
The function I have to implement is could be wrote as Y=f(X,Y).
That means that the Y datas are both the goal of the fit and a part of the equation.
Is it possible with the levenberg-Marquardt non linear fit vi?
Best regards
baptiste
Solved! Go to Solution.
03-31-2014 08:25 AM
03-31-2014 08:40 AM
"You could rearrange J= f(J,V) to be J - f(J,V)=0. The Y input to the Nonlinear Curve Fit.vi becomes an array of zeros, with length equal to the number of J (or V) values. Concatenate J and V data arrays, and pass as the X input to the Nonlinear Curve Fit.vi. In your model function, split the X input back to J and V, and evaluate J - f(J,V) for each (j,v)"
That help to sove my problem.
How do I split the X input in the model function?
Thank's
Baptiste
03-31-2014 08:46 AM
I'd use the 'Split 1D Array' primitive.
-Jim
03-31-2014 09:14 AM
Thank's for your help.
I don't understand if I have to enter in the lev-mar Vi and modify it, or if I just have to split the data before the vi?
I also have a problem: There is two options:
f(x,a) is a VI or f(x,a) is a formula chain.
I suppose that I have to use the first one, and to split the data in the function vi, but I don't know how to do.
Baptiste
03-31-2014 10:01 AM
No need to modify the curve fitting VIs. There are actually two steps. First, concatenate the J and V arrays using 'build array'. Make sure to right-click on 'build array' and choose concatenate. This concatenated array is passed to the 'Nonlinear Curve Fit.vi' as the X input. I would recommend using the VI reference interface, and not the formula string. Create a model VI using the template located at: ...\vi.lib\gmath\NumericalOptimization\LM model function and gradient.vit
Inside your new model VI there is an X input array. This is the array that you will have to split using the 'Split 1D Array' primitive.
Take a look at the following example: ...\examples\Mathematics\Fitting\Ellipse fit.vi
On the diagram notice the use of interleave 1D array. Instead of interleaving, it may be more efficient to use the build array. Now open the model VI for the ellipse (...\examples\Mathematics\Fitting\support\ellipse model.vi). Notice the use of decimate 1D array. Instead of decimate, you would use Split 1D Array.
-Jim
03-31-2014 10:15 AM
Ok, I understand.
I'l try tomorow morning.
Best regards
Baptiste
04-01-2014 04:05 AM
Work fine
Thank's
Baptiste