# Least squares method for cloud of atom

1. Mar 16, 2015

### diracdelta

1. The problem statement, all variables and given/known data
After turnig of magnetic-optic pit, cold cloud of atom 87 Rb is expanding. Size of cloud after time t, is given with relation:

where, k_B is Boltzman constant, m mass of 87 Rb.
Draw a plot, then use least squares method to find temperature T, and initial size of cloud sigma_0, for next results of measurement.
t(ms)
sigma(mm)

3. The attempt at a solution
I am familiar with least squares method. What I dont understand in this problem is next.
First of i must get this formulae to some linear shape ( regrression).
So, ok, firstly we square the whole equation.
I get next.

now, on to assigning values to get form like y=ax+b, its obvius,
y= sigma^2
b=sigma_0^2
x=t^2
x= (k_B * T)/m

and now, to use least square methd, i must calculate, x,y,xy,x^2,y^2, and sum of them all.
my question here is next:

This member boltzman constant/m. What should i do with it?
Shuld i calculate it and continue to multiply numbers with it whole process?
Or just write results like 0.157746 * ( K-b/m) and in the end multiply a with it?

2. Mar 16, 2015

### carllacan

If you are given a series of data points you can use the squares method. You will find the constants that define your line: a and b. Since $a = \frac {k_b T }{m}$ you can simply get T out of it, using the known values for the Boltzmann constant and the mass.

3. Mar 16, 2015

### haruspex

You mean $a=\frac{k_B T}{m}$, right?
I'm not sure what your question is. The least squares method will give you a value for a, which you can then multiply by $\frac m{k_B}$ to get T. What else would you do?

4. Mar 16, 2015

### diracdelta

Ok. I see that. THank you for answer.
What bothers me is how to know when that solution is good? I.e. i get a=0.01785
How do i recognize it is acceptable, and it fits the formulae.

5. Mar 16, 2015

### carllacan

Try plotting the values (in Excel, Matlab or whatever) and see if the slope of the line agrees with what you got.

6. Mar 16, 2015

### haruspex

That I can't help with. Does it give a reasonable T?

7. Mar 16, 2015

### diracdelta

OK, I will do it in excel now.
Reason why I'm asking you this is because i have midterm where i must know least square method, and i want to know if i do it right there.
Because using only calculator and milimeter paper..
THanks for reply guys. I really appreciate it.

8. Mar 16, 2015

### carllacan

If you have the millimeter paper you can still draw your line and see how much it "fits" the existing points. It wont pass over every one of them, because there's always a certain error, but the point of this method is that this error (or rather, its square) will be minimal (hence "least squares")