Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

First Derivative

  1. Mar 24, 2015 #1

    I have some points say, 100 points which come from a periodic tube profile, i.e., (z,r), where z and r are the axial and radial coordinates, respectively.

    Now, I need to calculate the first derivative at each point.

    Could you please help me in this regard?

  2. jcsd
  3. Mar 24, 2015 #2


    User Avatar

    Staff: Mentor

    Can you post a sketch of the setup? And you want to calculate the derivatave of what with respect to what? Can you show some sample data?

    Is this for schoolwork, or is a data set from your work?
  4. Mar 24, 2015 #3
    Hi, I have given the profile below


    I want to calculate dh/dz. Some data are below:

    z h
    -1 1
    -0.8 0.823664
    -0.6 0.714683
    -0.4 0.714683
    -0.2 0.823664
    0 1
    0.2 1.176336
    0.4 1.285317
    0.6 1.285317
    0.8 1.176336
    1 1

    The data set from my work.


    Attached Files:

  5. Mar 24, 2015 #4


    User Avatar

    Staff: Mentor

    It looks to me like your data do not match your graph...

    But in any case, are you aware of the definition of the derivative? Or implementations in discrete datasets?

    One way to do it is:

    [tex]h'(z) =\frac{h(z+1)-h(z-1)}{2z}[/tex]

    Okay, LaTeX isn't working for me tonight... In clear text:
    Note from Mark44: It's fixed now @Berkman -- there was an extra brace that I removed.

    h'(z) = ( h(z+1) - h(z-1) ) / 2z

    Where 2z is the distance between the 2 bracketing datapoints (in the units of z). Does that make sense?
    Last edited by a moderator: Mar 25, 2015
  6. Mar 24, 2015 #5
    Yes, I understand the facts. Many thanks.

  7. Mar 25, 2015 #6


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Numeric derivatives are notoriously bad, so take your results with a grain of salt. A better approach would be to attempt to fit your data to a sinusoidal function. Then get your derivatives from that.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook