# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Re: Slope of non linear curve

Hi Christian,

Does the diode equation shown below suffice.?

Regards

Deepu Jacob

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂

Message 11 of 24
(1,084 Views)

## Re: Slope of non linear curve

@djac91 wrote:

Does the diode equation shown below suffice.?

This has no resemblance to the default pre-8.0 nonlinear model you were using. (there is only one linear model, but an infinite amount of different nonlinear models, but only one is appropriate!)

So yes, once you define what the dependent and indepdendent variable is and what the fitting parameter and constants are, you would implement it as a model for nonlinear fit. Then fit the data to it after providing reasonable estimates for the fitting parameters (correct sign, ~correct order of magnitude, etc). See how far you get.

LabVIEW Champion. It all comes together in GCentral
Message 12 of 24
(1,076 Views)
Solution
Accepted by topic author aidasaufi

## Re: Slope of non linear curve

Hi aida,

I got a set for data corresponding to IN4007 diode from a website. Based on that i did some analysis and found that a simple exponential fit is sufficient for the data.

The same method seems to be suitable for the diode you are using.

I have made a vi to demonstrate this as shown below. VI has been attached(unzip the file).

Run the Vi and move the cursors. you can see the dynamic resistance value for the selected point.

Note: As christian earlier suggested, this method might me little overdoing of things, but seems to work.

Christian, what do you think?

Best Regards

Deepu Jacob

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂

Message 13 of 24
(1,067 Views)

## Re: Slope of non linear curve

djac91 wrote:

Christian, what do you think?

• It annoys me if small VIs have the front panel and diagram maximised to the screen, especially when using a big monitor.
• The theoretical model given earlier is an exponential with offset, you fit it to an exponential without offset (look at the default for the "parameter bounds" input). I would recommend the nonliear fit with the correct model.
• The y and dy/dx can easily be calculated from the best fit parameters for any x without any need for all these approximate numerical methods.
• The timeout event can be deleted.
• You don't need to wire the indices of Index array if the desired elements are in sequence starting with index 0.

LabVIEW Champion. It all comes together in GCentral
Message 14 of 24
(1,047 Views)
Solution
Accepted by topic author aidasaufi

## Re: Slope of non linear curve

Here's what I have in mind using the nonlinear model. See if it works for you. 😄

(quick draft, please check for bugs).

(I am doing a simple numerical derivative with a delta of 1e-6, you can easily program an analytical version, of course)

LabVIEW Champion. It all comes together in GCentral
Message 15 of 24
(1,038 Views)

## Re: Slope of non linear curve

Yes, this seems work. May i know what this "?" function ; calc dR , apparently I do not have this function

Message 16 of 24
(1,021 Views)

## Re: Slope of non linear curve

Sorry I accidentally click as solution. But it almost to solution

Message 17 of 24
(1,016 Views)

## Re: Slope of non linear curve

Hi Christian,

Thank you,

I understand the flow on how to get the slope from your vi but when I calculated it manually, I select point 749.73mV and draw the tangent line, the value of slope is different thus affect the dynamic resistance value. The calculation is on the image.

Message 18 of 24
(1,004 Views)

## Re: Slope of non linear curve

@aidasaufi wrote:

I understand the flow on how to get the slope from your vi but when I calculated it manually, I select point 749.73mV and draw the tangent line, the value of slope is different thus affect the dynamic resistance value. The calculation is on the image.

Of course the values will be slightly different, because my solution is much more precise.

Still, 637mOhm is very close to 0.667Ohm (= 667mOhm or within 5%!), so I would say they agree, more or less, but my value is much more accurate, of course. Note that I format with SI units. You can change the formatting of the indicator if you don't like it.

LabVIEW Champion. It all comes together in GCentral
Message 19 of 24
(979 Views)

## Re: Slope of non linear curve

Hi Christian,

That's a great example. Thank you for sharing.

However, after looking at the diode fitting model vi,i found that a '-1' is missing from the equation. Did you omitted that by mistake or is it purposeful for some reason?

The results are slightly different if  '-1' is included.

I assume that the model vi was sketched out of some standard template. If yes, what is the purpose for the 'output control'(unused in this case).

I'm looking forward to using this fitting technique (with a model vi) wherever suitable.

Best Regards

Deepu Jacob

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂

Message 20 of 24
(944 Views)