All published worksheets from http://sagenb.org
Image: ubuntu2004
ESBS
Biophysics practicals 2012
This SAGE notebook contains some hints and programs that will allow you to analyse the data recorded during the experiments. Exemples are provided to show you the more appropriate way to analyse and display your data. The graphics could be exported directly to fit within your reports as png files.
1. TP 2 Mass transport : Non-linear fitting of the time dependant evolution of the gel's temperature
The time evolution of the gel's temperature could be modelled using the following equation:
where
- First : Get an idea of the effect of each of the parameters on the curve using the following interactive plot
In particular, check which parameter influences 1) the value of the plateau 2) the initial slope
- Second : We should define the function to be fitted, in a way that will be recognized by NUMPY
- Third : The measured values have to be entered in the program. First option : enter the values manually as shown below
Second option: download a text file named as you like (just set the right value for the fname variable), that contains the recorded temperatures according the following format:
Fri Mar 16 17:31:34 2012 23.56
Fri Mar 16 17:31:40 2012 23.5
And run the following script
...
- Finally : Perform the non-linear fit using the program curve_fit that is included in the optimize library of SCIPY
- Note on error estimates :
The program optimize.curve_fit returns, along with the optimized parameters, a covariance matrix on these parameters. The diagonal terms on this matrix provides you with the variance on the parameters. This variance is a good estimate of the uncertainties, provided that your model is correct and that the noise is random.
The standard deviation on the T0 (initial temperature) and a (heating rate) can be calculated directly from the variance of the first and last parameter (A and C)
dA = pcov[0][0]^0.5
dC = pcov[2][2]^0.5
The error on the Heat capacity value, however, should be obtained from a error propagation calculation, since its value results from two parameters B and C :
with
B and C beeing the optimized parameters.
- Assess the nature of the noise
It is useful to analyse the distribution of the experimental points around those calculated from the model. In particular, the shape of the distribution will help to assess the random or systematic nature of the noise.