What function should I fit to this data?

Click For Summary

Homework Help Overview

The original poster is investigating the first ionization energy of Argon using data obtained from a mass spectrometer, specifically plotting amplifier voltage against electron volts. They are encountering issues with the smoothness of the first and second derivatives of their data and are seeking a suitable function to fit the data for better derivative analysis.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the potential need for data smoothing to improve the quality of derivative plots. Suggestions include exploring different smoothing algorithms and questioning the effectiveness of exponential smoothing given the data's original time-based plotting.

Discussion Status

Participants are actively exploring various smoothing techniques and their implications on the data analysis. Some have suggested methods like moving averages, while others are inquiring about specific smoothing functions available in numpy. There is no explicit consensus on the best approach yet.

Contextual Notes

The original poster notes that each data point is an average of a noisier dataset, which may influence the choice of smoothing methods discussed.

gothloli
Messages
37
Reaction score
0

Homework Statement


I'm supposed to find the first ionization energy of a gas (Argon), and to do that I used mass spectrometer. The data I plotted was amplifier voltage (acts as Ion current) vs. electron volts. The graph appears in the attachment as data2.jpeg.
To find the ionization energy I'm supposed to take the first and second derivative of the data, and the max x-value of the data is the ionization energy. When I do that the plot of the derivatives is not smooth; the points fluctuate. So I decided to fit a function to the data, and then take the derivative.

Homework Equations


I fitted using curve_fit on numpy, python 2.7. and tested the goodness of fit using chi-squared/dof. The fit was bad.

The Attempt at a Solution


I used the logistic function defined here http://en.wikipedia.org/wiki/Logistic_function, with parameters, (0.026, 0.745, 19.0, 0.0005). The fitted function is shown here. Since the fit was not good, is there a better function to fit this kind of data, or is there a better way to find the derivatives of the data?
data.jpeg


data.jpeg
 

Attachments

  • data2.jpeg
    data2.jpeg
    18.6 KB · Views: 534
Last edited:
Physics news on Phys.org
gothloli said:

Homework Statement


I'm supposed to find the first ionization energy of a gas (Argon), and to do that I used mass spectrometer. The data I plotted was amplifier voltage (acts as Ion current) vs. electron volts. The graph appears in the attachment as data2.jpeg.
To find the ionization energy I'm supposed to take the first and second derivative of the data, and the max x-value of the data is the ionization energy. When I do that the plot of the derivatives is not smooth; the points fluctuate. So I decided to fit a function to the data, and then take the derivative.

Homework Equations


I fitted using curve_fit on numpy, python 2.7. and tested the goodness of fit using chi-squared/dof. The fit was bad.

The Attempt at a Solution


I used the logistic function defined here http://en.wikipedia.org/wiki/Logistic_function, with parameters, (0.026, 0.745, 19.0, 0.0005). The fitted function is shown here. Since the fit was not good, is there a better function to fit this kind of data, or is there a better way to find the derivatives of the data?
View attachment 80813

View attachment 80813
Why not do some smoothing first? Numerical Recipes has some methods for doing this.
 
Quantum Defect said:
Why not do some smoothing first? Numerical Recipes has some methods for doing this.
would smoothing the data give a clean first and second differential plot? If so which smoothing algorithm would work best? Since the data was originally plotted with time, would exponential smoothing work?
 
gothloli said:
would smoothing the data give a clean first and second differential plot? If so which smoothing algorithm would work best? Since the data was originally plotted with time, would exponential smoothing work?

You have high frequency noise, with a very clean underlying signal. I would just try some different ways to smooth (moving window is easiest) and see what you get. It will get rid of the high frequency noise, and should clean up the derivatives.
 
Actually each data point shown above, was an average of an even noisier data set. Since I changed the electron volts every 2 seconds, I took the average of the voltage every two seconds. So using moving average would make the data even more cleaner? Do you know any smoothing functions from numpy?
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
28
Views
4K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 12 ·
Replies
12
Views
4K