How do I compute the second derivative of a one-dimensional array?

Click For Summary

Discussion Overview

The discussion revolves around how to compute the second derivative of a one-dimensional array, with participants exploring the context of the array and the meaning of derivatives in this scenario. The conversation includes aspects of numerical differentiation, data representation in spreadsheets, and the interpretation of physical quantities.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • Some participants inquire about the type of array being discussed, with one specifying it as an array of doubles.
  • There is a suggestion that if the array consists of constants, discussing derivatives may not be meaningful, as the derivative of a constant is zero.
  • Others propose that the discussion may be better framed in terms of first and second differences rather than derivatives, particularly in the context of difference equations.
  • One participant mentions that the array is related to X-ray values sorted into bins, prompting questions about the meaning of "kve vs bin" and the determination of bins.
  • Several participants discuss practical methods for calculating derivatives using Excel, including creating columns for velocity and acceleration based on time and position data.
  • There are requests for examples and clarifications on how to perform calculations in Excel, including the correct formulas for velocity and acceleration.
  • One participant emphasizes the importance of understanding the underlying task before delving into specific calculations, suggesting that clarity on the objective is crucial.

Areas of Agreement / Disagreement

Participants express differing views on the appropriateness of discussing derivatives for an array of constants versus the need for clarity on the context and purpose of the calculations. There is no consensus on how to approach the problem, and multiple competing views remain regarding the interpretation of the array and the calculations involved.

Contextual Notes

There are limitations in the discussion regarding the definitions of terms like "derivative" and "array," as well as the assumptions about the nature of the data being analyzed. The conversation also reflects a mix of practical application and theoretical understanding, with unresolved questions about the specific task at hand.

Who May Find This Useful

This discussion may be useful for individuals interested in numerical methods, data analysis in programming or spreadsheet applications, and those seeking clarification on the concepts of differentiation in various contexts.

  • #31
btb4198 said:
Yeah, I am going to remove it. Sorry, I never code a function to take a derivative of a graph before and I could not find any YouTube videos on how to do it by hand.
See my post #27. It is an instruction.
 
Physics news on Phys.org
  • #32
btb4198 said:
So Basically to take the first derivative, I am going to go through the array and subtract index + 1 from index.
So:
double value = spectrumData[i + 1] - spectrumData;
You need to get your units right in your derivative calculations (both for the numerator and denominator). The units for the numerator look to be "counts" right? And for the denominator, you have bins separated by some delta-energy in keV? So the units of the first derivative would be delta-counts per delta keV?
 
  • #33
berkeman said:
So the units of the first derivative would be delta-counts per delta keV?
It looks like the horizontal bins are spaced linearly? What is the increment in delta-keV per bin? It looks like a small fraction of a keV delta per bin?
 
  • #34
berkeman said:
You need to get your units right in your derivative calculations (both for the numerator and denominator). The units for the numerator look to be "counts" right? And for the denominator, you have bins separated by some delta-energy in keV? So the units of the first derivative would be delta-counts per delta keV?
Yes, that is all correct.
 
  • #35
berkeman said:
It looks like the horizontal bins are spaced linearly? What is the increment in delta-keV per bin? It looks like a small fraction of a keV delta per bin?
1655149886661.png


From this picture is looks like the bins increase by one .
 
  • #36
Another question, if I were to place this Spectrum into an FFT would my sampling rate(fs) be 1hz ?
 
  • #37
btb4198 said:
From this picture is looks like the bins increase by one .
One what? One eV? Could be -- please take care to always include units with the numbers. Thank you.
 
  • #38
btb4198 said:
From this picture is looks like the bins increase by one .
I don't think so. The increments along the horizontal axis (eV) increase by 2000 eV. Since you're attempting to find an approximation to the derivative, is your math background sufficient for you to understand what you're trying to do? That is, have you taken calculus sometime in the past?
 
  • Like
Likes   Reactions: berkeman
  • #39
btb4198 said:
Another question, if I were to place this Spectrum into an FFT would my sampling rate(fs) be 1hz ?
No. You already have a plot of counts per fraction-of-an-eV. What domain do you want the FT to transform that into? You can't randomly do FFT processing on data and get meaningful information.
 
  • #40
berkeman said:
You can't randomly do FFT processing on data and get meaningful information.
In short, GIGO...
 
  • Like
Likes   Reactions: berkeman
  • #41
berkeman said:
No. You already have a plot of counts per fraction-of-an-eV. What domain do you want the FT to transform that into? You can't randomly do FFT processing on data and get meaningful information.
In the example excel file, could you put that into an FFT? Or no ?
anyhow, The Output of the DPP is Very noise, so I wanted to filter out the noise.
 
  • #42
btb4198 said:
In the example excel file, could you put that into an FFT? Or no ?
anyhow, The Output of the DPP is Very noise, so I wanted to filter out the noise.
Your thread is now temporarily locked. I will send you a Private Message (PM) in a few minutes to try to salvage it.
 
  • #43
After the PM discussion with the OP, there is no reason to re-open this thread. Thanks everybody for trying to help the OP out.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 6 ·
Replies
6
Views
1K