Jump to content

derivative


Recommended Posts

HI!

Does anybody know a program, which calculates the derivative from X,Y points??  :unsure:

Best regards,

Peter

5427[/snapback]

- convert your (X,Y) points into two arrays [X] and [Y]

- use LV's 'derivative.vi' to calculate arrays [dX] and [dY]

- divide the two to get [dY/dX]

(this assumes that the points (X,Y) are sorted with respect to X)

Link to comment
HI FRANZ!

Thank you for your programs!

Could you explain me the method III please? For what did you use the variable "N"? Do you use this variable to control the border of the dates?  :unsure:

Best regards,

Peter

5531[/snapback]

Hi Peter,

Method iii is the one described in the 3rd paragraph of my last posting:

"Then the best solution would be to perform a polynomial fit to a subset of the original data which is centered symmetrically around point (Xi,Yi). Take 2N+1 data Xi-N, ... , Xi, ... , Xi+N (and the corresponding Yi-N,...,Yi+N) and fit a polynomial, then take the (analytical) 2nd derivative at point Xi as an estimate of the 2nd derivative of the original dataset."

N is the number of data to the left and to the right of a specific data point i, so the total number of data taken for a polynomial fit is 2N+1. Data points i towards the beginning and end of the dataset may have less than N points to the left or right, and then of course less than 2N+1 data are taken.

Example for dataset of size m:

For N=2 the following fits are performed:

for i=0 points 0,1,2 are fitted

for i=1 points 0,1,2,3 are fitted

for i=2 points 0,1,2,3,4 are fitted

for i=3 points 1,2,3,4,5 are fitted

for i=4 points 2,3,4,5,6 are fitted

.

.

.

for i=m points m-2,m-1,m are fitted

I think what I implemented is called a smoothing polynomial filter, but here it is not used to filter the original data, rather only the 2nd derivatives of the data are obtained. If for each data point Xi a new Yi were computed from the polynomial and would replace the original Yi, one would indeed have the implementation of a smoothing polynomial filter. The VI I posted can be easily modified for that.

regards

Franz

Link to comment

HI FRANZ!

Thank you for your explanation. I thin the problem is when i filter the original data, i would lose some geometric details and i think it*s better to filter the 2nd derivatives.

There should not be so a big difference, between the method with filtering the original data and filtering the 2nd derivatives!??

Is that right??

Best regards,

PETER

Link to comment
HI FRANZ!

Thank you for your explanation. I thin the problem is when i filter the original data, i would lose some geometric details and i think it*s better to filter the 2nd derivatives.

There should not be so a big difference, between the method with filtering the original data and filtering the 2nd derivatives!??

Is that right??

Best regards,

PETER

5537[/snapback]

Peter,

whatever you do to your data depends on what information you want to extract. If you want curvature (=2nd derivative), go with method iii) above, I can hardly figure a better way to find a 2nd derivative for noisy data. If you want to compare complete curves, and the curvature is only a tool you use for comparison, there might be better ways to make a reliable comparison, but that depends on details of you setup which I do not know. But in any case, you should try to reduce the noise in you data beforehand as good as possible. E.g. I've seen 2 or 3 outliers in your data (outliers in the X-data set) which you should try to avoid or, if unavoidable, exclude from the analysis.

Another comment (again without knowing the details): if a derivative is the signal of interest, it is often best to do some kind of modulation spectroscopy, i.e. you modulate the signal which represents your x-axis sinusoidally with a small amplitude and detect the y-signal with a lock-in amplifier. Then you measure directly the 1st deivative with a much better signal to noise ratio than calculating it from y(x) data. But probably a modulation is not possible in your setup?

good luck

Franz

Link to comment

HI Franz!

With the second derivatives and other factors, i calculate the bending strength ( the 2nd derivative is the main factor in the formula). I need this bending strength to compare several synthetic material bars.

So it*s very important to have the right formula-calculation for my comparison.

In my program i will youse the method free, because i saw that it was the best solution for my program. Yes thats the problem, the modulation setup is not possible in my setup, so i will use method tree. With this method you help me very much!!!! :worship:

In that case i will thank you for your help!

Best regards,

PETER Fischbacher

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.