From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

non linear fit for diode equations

Solved!
Go to solution

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

0 Kudos
Message 1 of 8
(3,236 Views)

See if this thread helps answer your question.

Fitting-Non-ideal-Diode-equation

 

-Jim

0 Kudos
Message 2 of 8
(3,227 Views)

"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

0 Kudos
Message 3 of 8
(3,219 Views)

I'd use the 'Split 1D Array' primitive.

-Jim

0 Kudos
Message 4 of 8
(3,214 Views)

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

0 Kudos
Message 5 of 8
(3,202 Views)

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

0 Kudos
Message 6 of 8
(3,192 Views)
Solution
Accepted by topic author baptiste13

Ok, I understand.

I'l try tomorow morning.

 

Best regards

 

Baptiste

0 Kudos
Message 7 of 8
(3,189 Views)

Work fine

 

Thank's

 

Baptiste

0 Kudos
Message 8 of 8
(3,153 Views)