Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

First Derivative

Nazmul_I_1
Beginner
2,927 Views

Hi,

I have some data (z,h) which reprents sinusoidal curve. Now, I would like to calculate first derivative dh/dz at each point (z,h).

I am using Intel Fortran Compiler with IMSL.

Can you please help me in this regard?

Cheers

0 Kudos
22 Replies
NotThatItMatters
Beginner
466 Views

The problem I have of table fitting data is confounded by several items: 1) the data comes in as fixed decimal point data, thereby indicating inaccuracy at best in the last decimal place; 2) this data is re-tabulated using a linear fit of the original data to a greater number of points. This may compound (or not) the inaccuracy in the input data; 3) the data is then replaced (!) with a single intercept point and a number of slopes equal to the number of data points.  For example, if the initial data is yi then the new data is yi = yo + mi * δx, where the mi are tabulated.  The reason for this is that the legacy code assumed mi as constant for all i.  So now I need to compute the derivative of y with respect to x, noting that both mi and δx depend on x.  I was hoping (praying) to utilize some noise cancellation in taking the derivative of mi and thought that the method from the paper might give me insight.

0 Kudos
jimdempseyatthecove
Honored Contributor III
466 Views

I think with a modification of your #22 statement might yield better results in your final data using:

1) expand the number of input data as you currently do inserting interpolated points as you do.
2) Using the curve fitting algorithm (one of the listed above) to determine the frequency and time offset.
3) Using the result of 2, generate a new table of expanded data points.
4) Generate the final result: intercept and list of slope points.

This should remove the "error" of the linear interpolation (convert saw tooth output into sinusoidal output).

Jim Dempsey

0 Kudos
Reply