Message Boards Message Boards

2 Replies
0 Total Likes
View groups...
Share this post:

Curve Fitting Data

Posted 10 years ago

Hi there, so I'm attempting to take some data collected by Balmer during his study of spectral lines of hydrogen and fit a formula to it to find a constant.

The data in question is pulled from

I've collected the data for the values of m, and the wavelength in a .dat file, and I've had no trouble getting mathematica to understand and it and plot it out, but I'm having some issues getting it to curve fit balmers formula to it.

I'm attempting to get ?= h m^2 /(m^2 ? 4) for m=3,4,5...

I've having some trouble understanding how mathematica wants to to tell it to curvefit, the program tutorial for curve fitting is a bit confusing to be honest.

Any help at all is greatly appreciated. Thanks.

POSTED BY: chris jackson
2 Replies

Here is your data:

wavelengths = 
 Import["", "Data"][[1,2 ;; 5]][[All, 2]]


{6562.1, 4860.74, 4340.1, 4101.2}

You say this corresponds to m from 3 to 6.

So let's fit it to your expression with h as the unknown:

FindFit[Transpose[{Range[3, 6], wavelengths}],  h m^2/(m^2 - 4), h, m] 


 {h -> 3645.6}
POSTED BY: David Reiss
Posted 10 years ago

Thanks for the reply, after fighting with the program for a while I got it to do what I wanted.

I came to the same value of h, so that's promising :)

Again, thanks for taking the time to answer a pretty basic question.

POSTED BY: chris jackson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract