Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

10-24-2016 12:00 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hello all,

How can I get slope from any particular point from non linear curve? I am using Lev-Mar curve fitting as this is non-linear. The slope is for determining the dynamic resistance of current-voltage curve of diode where dynamic resistance = 1/slope. Kindly help..

Solved! Go to Solution.

10-24-2016 01:06 AM - edited 10-24-2016 01:15 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

How old is this VI??? 😮 I recommend to use the modern nonlinear curve fit (you are using the quite dysfunctional pre-8.0 version with the default shipping model (i.e. single exponential with offset), which may or may not be appropriate). What is the correct nonlinear model for your data? Once you have the model, you can easily calculate the formula for the analytical derivative (slope). If it gets too complicated you can do numerical derivative.

Highlighted
Options

10-24-2016 02:24 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi aidasaufi,

Please check the attached VI. Some of the vi's in your code is missing as the device drivers for your device is not on my PC. However i got an idea of what you were trying to implement.

Generally, the slope of a curve at a point is expressed as the slope of the Tangent to that curve at the selected point.

Tangent to the curve can found by calculating the derivative of the curve. So in simple words, the slope at any point is given by the value of derivative of the curve at that point.

Here are the steps to follow.

- Find the derivative of the Best fit data.
- Find the value of derivative at the point of interest, it will be the slope at that point.

I have created a vi for you.You can use the attached vi as a subVI i your progam.

Note: I have assumed that you have sampled your data at equal intervals of voltage

Best Regards

Deepu Jacob

-----------------------------------------------------------------------------------------------------------------------------

Waiting For the inner calling 🙂

Waiting For the inner calling 🙂

10-24-2016 03:14 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi djac91,

Thanks for your help! The solution was really helpful. I want to ask, dx(t)/ dt in this case where dx(t) is dI (current) vs dt (voltage) , when running the program; the point of interest is what I give control on to get the slope, but how about dt? From your attached vi it shows that I should give input to dt too while running the program. Kindly correct me if i misunderstood

10-24-2016 03:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

10-24-2016 04:57 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi,

As per the attached image, your code is corect

- You are correct, Best Fit (Y) corresponds to your Fitted data (Current(mA)
- dX(t)/dt>>> correspoonds to dI(t)(current-ma) / dV(voltage) in your case
- similarly dt is dV in your case. Here dt, that i used is the sampling/step interval for your data. which means the voltage steps in which you have taken the measurements. Here i have assumed that you have the voltage values in equal steps. for example say 2v, 4v, 6v, 8v.etc ,thenthe dt(or dV) will be 2v since each steps has a difference of 2v from the next/prev step.

Now if your voltage values are in unequal steps, say like 2v , 5v, 7.5v etc. we have to use a slightly different method.

It will be really helpful ifyou could share the original data and best fit data as a file.

easiest way is to right click on the graph and select "Export>>Excel".

Regards

Deepu

-----------------------------------------------------------------------------------------------------------------------------

Waiting For the inner calling 🙂

Waiting For the inner calling 🙂

10-24-2016 10:45 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

You are still not making a lot of sense!

Once you have the best fit, the best fit parameters, and the fitting model equation, all desired derived parameters such as slope at a certain point, etc. can be derived from the three fitting parameters analytically.

Read my first reply again! None of these convoluted suggestions are necessary. They just complicate the issues.

Do you have a link to a web page that describes the experiment, theory, and fitting model? Is a single exponential with offset really the right one?

Alternatively, you could just fit to a polynomial, where again the derivative is easy to calculate from the coefficients.

Also why do you incrementally fit the data with every iteration? Wouldn't it make more sense to wait until all data is acquired?

10-24-2016 11:37 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Also why do you incrementally fit the data with every iteration? Wouldn't it make more sense to wait until all data is acquired?

Hi aidasaufi,

Christian is on point regarding waiting for entire data before taking the derivatives.

Once you have the best fit, the best fit parameters, and the fitting model equation, all desired derived parameters such as slope at a certain point, etc. can be derived from the three fitting parameters analytically.

Alternatively, you could just fit to a polynomial, where again the derivative is easy to calculate from the coefficients.

Christian,

if possible,can you please show this with a small example.

Best Regards

Deepu Jacob

-----------------------------------------------------------------------------------------------------------------------------

Waiting For the inner calling 🙂

Waiting For the inner calling 🙂

10-25-2016 01:09 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

10-25-2016 03:22 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

@djac91 wrote:

if possible,can you please show this with a small example.

Yes, if you show me a link with the correct theoretical model that describes the data. 😄