Advanced Excel for Scientific Data Analysis

Advanced Excel® for Scientific Data Analysis Robert de Levie SUB GOttingen 217 194 575 04 2004 A 2324 OXTORD UNIVERSITY PRESS 2004 J Contents 1 ...
0 downloads 0 Views 184KB Size
Advanced Excel® for Scientific Data Analysis

Robert de Levie SUB GOttingen 217 194 575

04 2004 A 2324

OXTORD UNIVERSITY PRESS 2004

J

Contents 1

Survey of Excel

1.1 1.2 1.3 1.4 1.5 1.6 1.7

Spreadsheet basics Making 2-D graphs Making 3-D surface graphs Making surface maps Making movies Printing, copying, linking & embedding Setting up the spreadsheet

1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7

Data Analysis Toolpak Solver VBA Help File Additional macros Additional files Commercial tools Choosing the default settings

1.8 1.9

1.10 1.11

Importing data Error messages Help Functions, subroutines & macros

1.11.1 1.11.2

Custom functions Custom subroutines & macros

1.12 1.13

An example: interpolation Handling the math

1.13.1 1.13.2

Complex numbers Matrices

1.14

Handling the funnies

1.14.1 1.14.2 1.15 1.16 1.17 1.18

The binomial coefficient The exponential error function complement

2

Simple linear least squares

2.1

Repeat measurements

Algorithmic accuracy Mismatches between Excel and VBA Summary For further reading

1 1 4 10 13 16 18 20 20 20 21 21 22 22 23 25 25 26 26 27 28 29 37 37 38 40 40 41 44 49 51 52

53 54

R. de Levie, Advanced Excelfor scientific data analysis 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 2.10 2.11 2.12 2.13 2.14 2.15 2.16 2.17 2.18

Fitting data to a proportionality LinEst Regression LS Trendline Fitting data to a straight line Simple propagation of imprecision Interdependent parameters Centering Extrapolating the ideal gas law Calibration curves Standard addition The intersection of two straight lines Computing the boiling point of water Phantom relations Summary For further reading

56 58 60 62 64 65 66 68 71 76 80 83 86 91 92 96 97

3

Further linear least squares

98

3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 3.18 3.19 3.20 3.20.1 3.20.2

Fitting data to a polynomial Fitting data to a parabola The iodine vapor spectrum The intersection of two parabolas Multiparameter fitting The infrared spectrum of H35C1 Spectral mixture analysis How many adjustable parameters? The standard deviation of the TheF-test Orthogonal polynomials Gas-chromatographic analysis of ethanol Raman spectrometric analysis of ethanol Heat evolution during cement hardening Least squares for equidistant data Weighted least squares An exponential decay Enzyme kinetics Fitting data to a Lorentzian Miscellany The boiling point of water The vapor pressure of water

98 99 100 104 107 107 111 113 115 115 117 122 125 131 135 140 144 144 148 150 150 151

fit

Contents 3.20.3 3.21 3.22

Fitting data to a high-order polynomial Summary For further reading

4

Nonlinear least squares

4.1

Cosmic microwave background radiation The l2 potential energy vs. distance profile Titrating an acid with a strong base Conductometric titration of an acid mixture Fitting a luminescence decay Fitting a curve with multiple peaks Fitting a multi-component spectrum with wavenumber-shifted constituents Constraints Fitting a curve through fixed points Fitting lines through a common point Fitting a set of curves Fitting a discontinuous curve Piecewise fitting a continuous curve Enzyme kinetics, once more The Lorentzian revisited Linear extrapolation Guarding against false minima General least squares fit to a straight line General least squares fit to a complex quantity Miscellany

4.2 4.3 4.4 4.5 4.6 4.7

151 153 156

158 161 165 169 176 180 182

4.22

Summary For further reading

187 192 193 194 198 201 203 205 206 207 208 213 217 219 219 221 224 225 226 227 229

5

Fourier transformation

230

5.1 5.2 5.3 5.4 5.5 5.6 5.7

Sines and cosines Square waves and pulses Aliasing and sampling Leakage Uncertainty Filtering Differentiation

230 235 239 242 243 245 255

4.8 4.9 4.10 4.11 4.12 4.13 4.14 4.15 4.16 4.17 4.18 4.19 4.20 4.20.1 4.20.2 4.20.3 4.20.4 4.20.5 4.21

Viscosity vs. temperature and pressure Potentiometric titration of a diprotic base Analyzing light from a variable star The growth of a bacterial colony Using NIST data sets

R. de Levie, Advanced Excelfor scientific data analysis 5.8 5.9 5.10 5.11 5.12

Interpolation Data compression Analysis of the tides Summary For further reading

261 265 268 277 279

6

Convolution, deconvolution, and time-frequency analysis

280

6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12

Time-dependent filtering Convolution of large data sets Unfiltering Convolution by Fourier transformation Deconvolution by Fourier transformation Iterative van Cittert deconvolution Iterative deconvolution using Solver Deconvolution by parameterization Time-frequency analysis The echolocation pulse of a bat Summary For further reading

280 285 291 295 300 311 321 325 331 335 337 338

7

Numerical integration of ordinary differential equations

339

The explicit Euler method The semi-explicit Euler method Using custom functions Extreme parameter values The explicit Runge-Kutta method The Lotka oscillator 1 The Lotka oscillator 2 The Lotka oscillator 3 Stability Chaos Summary For further reading

340 347 350 354 356 361 365 366 368 372 374 375

7.1 7.2 7.3 7.4 7.5 7.6 7.7 7.8 7.9 7.10 7.11 7.12

8

Write your own macros

8.1

Reading the contents of a cell

311 378

Contents

,2 ,3 .4

Reading & manipulating a cell block Numerical precision Communication boxes

.11

Tools for macro writing

.11.1 .11.2

Editing tools The macro recorder

.12 .13 .14

Troubleshooting Summary For further reading

381 384 385 385 386 390 392 395 395 399 404 408 412 413 415 416 416 417 418 420 422

.4.1 .4.2

Message boxes Input boxes

.5 .6 .7

Case study 1: the propagation of imprecision Case study 2: bisection Case study 3: Fourier transformation

.7.1 ,7.2

A starter macro Comments & embellishments

.8 .9 .10

Case study 4: specifying a graph Case study 5: sorting through permutations Case study 6: raising the bar

.10.1 .10.2

Adding a menu item Adding a toolbar

Macros for least squares &for the propagation of imprecision

423

9 9.1 9.2 9.3 9.4 9.5

General comments LS LSPoly LSMulti LSPermute LLSS

9.6 9.7 9.8 9.9 9.10 9.11

Ortho ELS WLS SolverAid Propagation Matrix operations Invert Multiply Transpose

424 426 436 444 452 459 460 469 481 491 500 509 510 512 512

R. de Levie, Advanced Excelfor scientific data analysis

10 Fourier transform macros 10.1 10.2 10.3 10.4 10.5 10.6

Fourier transformation FT Direct (de)convolution Fourier transform (de)convolution Iterative deconvolution Time-frequency analysis Semi-integration & semi-differentiation

11 Miscellaneous macros 11.1 11.2 11.3 11.4 11.5 11.6 11.6.1 11.6.2 11.6.3 11.7 11.8

Terms & conditions Insert a toolbar Insert a menu Movie demos Lagrange interpolation SolverScan Calling Solver with VBA Programming details Possible extensions Mapper RootFinder

Appendix A.I A.2 A.3 A.4 A. 5 A. 6 A.7 A.8 A.9

The basic spreadsheet operations Some common mathematical functions Trigonometric and related functions Some engineering functions Functions involving complex numbers Matrix operations Excel error messages Some shortcut keystrokes for pc & Mac Installation requirements & suggestions

Epilogue Index

513 513 518 519 523 529 540 544

549 549 551 559 566 572 573 574 575 576 582 596

599 599 600 602 602 603 604 605 605 607

608 6io