1. Sep 18, 2004

### Emc2brain

I just recently collected data from a muon lifetime determination experiment. The data was presented in the form of two columns: x = time (microseconds) and y = counts/bin. After plotting this xy into a graph I found that my muon lifetime was 2.12 (close enough).

I was supposed to find a "combined fit" for the xy graph to:

N= Noe^(-t/tau) + C

Where tau is the mean lifetime. But! Haha! I simply took it upon myself to use excel trendline to determine the two seperate components of fitting it. In the Excel attachment you will see what I mean by fitting the graph (by the two red dashed lines) One red line indicates the exponential component and the other red line indicates the constant (linear) background component.

What is key here is that i'm supposed to use a HISTOGRAM! Well, I am ashamed to say that I don't particularly know how to use a histogram as well as I wish. Besides that, I don't even understand conceptually what a histogram does with my data (which is also provided). How do I use a histogram to fit it to the above?

THANX
Hannah

#### Attached Files:

• ###### EMC234.doc
File size:
19.5 KB
Views:
64
Last edited: Sep 18, 2004
2. Sep 18, 2004

### vanesch

Staff Emeritus
But you already have a histogram, if I understand your message well.
Let me explain a bit: to make a histogram, you have to repeat the same experiment many times, and the outcome of each experiment must give you a number, say: the lifetime of a muon.
So you have a long list of muon lifetimes: if you measured 5000 muons, you measured 5000 lifetimes. These are the data you start with.
To make a histogram, you choose a real axis which represents the quantity you've been measuring (here the muon lifetime), and you define a number of equal-sized bins on that axis that will be relevant. So you define the bin:
0-0.1 microsecond, the bin 0.1-0.2 microsecond etc... for example.
Next, you process your data: you will count in each bin how many times the measurement result was within the limits of the bin.
These numbers of counts, as a function of the bin center, is what's called a histogram. But that's the data you already have !
The reason for doing this "histogramming" is that it is the experimentalist's way of measuring a probability distribution.

cheers,
Patrick.

3. Sep 18, 2004

### Emc2brain

Lost! Muon

Okay thanx, that makes a bit of sense because I was able to actually solve for the mean lifetime without using a generated histogram (that which I proceeded to make in excel! which I guess now makes no sense, right? it would be essentially a histogram of a histogram, how peculiar).

Alright, but do you know how I would find a combined fit from this output histogram? Should matlab be used here or is excel okay? This combined fit is a mixture of both exponential and linear, so excel's "trendline" isn't really sufficient (which is why I used trendline for the two different portions of my histogram output). If you know anything on this matter.

Hannah

#### Attached Files:

• ###### EMC234.doc
File size:
19.5 KB
Views:
98
4. Sep 18, 2004

### vanesch

Staff Emeritus
Excel is for used car salesmen and economists, not for scientific work :yuck:
Probably the best way (also from a pedagogical point of view) to solve the fit problem is to write out the cost function (take least squares):

f(a,b,c) = Sum_i ( m(x_i ; a,b,c) - n(x_i) )^2

In the above, a,b and c are your parameters ( a exp(- b x) + c) or something ;
x_i represents the center values of the bins (the center lifetimes) and n(x_i) represents the number of counts for that bin with center x_i.

m(x_i ; a,b,c) is your model function evaluated at the bin center.

m(x ; a,b,c) = a exp(- b x) + c)

You sum over all the bins you have in your data and that gives you the cost function f(a,b,c) as a function of the values for the parameters.
The best fit is then given by the minimum of that function ; this can be done numerically, by solving:

df/da = 0 ; df/db = 0 ; df/dc = 0

cheers,
patrick.