Acknowledgments |
|
xi | |
Series Preface |
|
xiii | |
Preface |
|
xv | |
About the Authors |
|
xvii | |
1 Computational Basics for Physics |
|
1 | (38) |
|
|
1 | (1) |
|
|
1 | (11) |
|
1.2.1 Python Visualization Tools |
|
|
2 | (6) |
|
1.2.2 Python Matrix Tools |
|
|
8 | (3) |
|
1.2.3 Python Algebraic Tools |
|
|
11 | (1) |
|
1.3 Dealing with Floating Point Numbers |
|
|
12 | (2) |
|
1.3.1 Uncertainties in Computed Numbers |
|
|
13 | (1) |
|
1.4 Numerical Derivatives |
|
|
14 | (1) |
|
1.5 Numerical Integration |
|
|
15 | (4) |
|
1.5.1 Gaussian Quadrature |
|
|
17 | (1) |
|
1.5.2 Monte Carlo (Mean Value) Integration |
|
|
17 | (2) |
|
1.6 Random Number Generation |
|
|
19 | (5) |
|
1.6.1 Tests of Random Generators |
|
|
21 | (1) |
|
1.6.2 Central Limit Theorem |
|
|
22 | (2) |
|
1.7 Ordinary Differential Equations Algorithms |
|
|
24 | (3) |
|
1.7.1 Euler & Runge-Kutta Rules |
|
|
25 | (2) |
|
1.8 Partial Differential Equations Algorithms |
|
|
27 | (1) |
|
|
27 | (12) |
2 Data Analytics for Physics |
|
39 | (42) |
|
|
39 | (1) |
|
|
39 | (3) |
|
2.3 Least-Squares Fitting |
|
|
42 | (5) |
|
2.3.1 Linear Least-Square Fitting |
|
|
43 | (4) |
|
2.4 Discrete Fourier Transforms (DFT) |
|
|
47 | (4) |
|
2.5 Fast Fourier Transforms (FFT) |
|
|
51 | (3) |
|
|
54 | (4) |
|
2.6.1 Noise Reduction via Autocorrelation Function |
|
|
54 | (2) |
|
2.6.2 Noise Reduction via Digital Filters |
|
|
56 | (2) |
|
2.7 Spectral Analysis of Nonstationary Signals |
|
|
58 | (7) |
|
2.7.1 Short-Time Fourier Transforms |
|
|
59 | (1) |
|
|
60 | (4) |
|
2.7.3 Discrete Wavelet Transforms, Multi-Resolution Analysis |
|
|
64 | (1) |
|
2.8 Principal Components Analysis (PCA) |
|
|
65 | (3) |
|
2.9 Fractal Dimension Determination |
|
|
68 | (2) |
|
|
70 | (11) |
3 Classical & Nonlinear Dynamics |
|
81 | (44) |
|
|
81 | (10) |
|
|
81 | (1) |
|
3.2.1 First a Linear Oscillator |
|
|
81 | (2) |
|
3.2.2 Nonlinear Oscillators |
|
|
83 | (2) |
|
3.2.3 Assessing Precision via Energy Conservation |
|
|
85 | (1) |
|
|
85 | (1) |
|
3.2.5 Linear & Nonlinear Resonances |
|
|
86 | (2) |
|
3.2.6 Famous Nonlinear Oscillators |
|
|
88 | (2) |
|
3.2.7 Solution via Symbolic Computing |
|
|
90 | (1) |
|
|
91 | (5) |
|
|
93 | (1) |
|
|
94 | (1) |
|
|
94 | (2) |
|
3.3.4 Vibrating Pivot Pendulum |
|
|
96 | (1) |
|
3.4 Fourier Analysis of Oscillations |
|
|
96 | (3) |
|
3.4.1 Pendulum Bifurcations |
|
|
97 | (1) |
|
|
98 | (1) |
|
|
99 | (2) |
|
3.6 Realistic Projectile Motion |
|
|
101 | (3) |
|
3.6.1 Trajectory of Thrown Baton |
|
|
102 | (2) |
|
|
104 | (2) |
|
3.8 Three-Body Problems: Neptune, Two Suns, Stars |
|
|
106 | (3) |
|
3.8.1 Two Fixed Suns with a Single Planet |
|
|
107 | (1) |
|
3.8.2 Henon-Heiles Bound States |
|
|
108 | (1) |
|
|
109 | (5) |
|
3.9.1 Rutherford Scattering |
|
|
109 | (1) |
|
|
110 | (2) |
|
|
112 | (2) |
|
|
114 | (1) |
|
3.11 Lagrangian and Hamiltonian Dynamics |
|
|
115 | (3) |
|
3.11.1 Hamilton's Principle |
|
|
115 | (1) |
|
3.11.2 Lagrangian & Hamiltonian Problems |
|
|
116 | (2) |
|
3.12 Weights Connected by Strings (Hard) |
|
|
118 | (1) |
|
|
119 | (6) |
4 Wave Equations & Fluid Dynamics |
|
125 | (44) |
|
|
125 | (1) |
|
|
126 | (8) |
|
4.2.1 Extended Wave Equations |
|
|
128 | (2) |
|
4.2.2 Computational Normal Modes |
|
|
130 | (1) |
|
4.2.3 Masses on Vibrating String |
|
|
131 | (2) |
|
4.2.4 Wave Equation for Large Amplitudes |
|
|
133 | (1) |
|
|
134 | (2) |
|
|
136 | (2) |
|
4.4.1 Advective Transport |
|
|
136 | (1) |
|
|
137 | (1) |
|
4.5 Solitary Waves (Solitons) |
|
|
138 | (6) |
|
4.5.1 Including Dispersion, KdeV Solitons |
|
|
139 | (2) |
|
4.5.2 Pendulum Chain Solitons, Sine-Gordon Solitons |
|
|
141 | (3) |
|
|
144 | (12) |
|
4.6.1 Navier-Stokes Equation |
|
|
144 | (2) |
|
4.6.2 Flow over Submerged Beam |
|
|
146 | (1) |
|
4.6.3 Vorticity Form of Navier-Stokes Equation |
|
|
147 | (3) |
|
4.6.4 Torricelli's Law, Orifice Flow |
|
|
150 | (3) |
|
4.6.5 Inflow and Outflow from Square Box |
|
|
153 | (1) |
|
4.6.6 Chaotic Convective Flow |
|
|
154 | (2) |
|
|
156 | (13) |
5 Electricity & Magnetism |
|
169 | (60) |
|
|
169 | (1) |
|
5.2 Electric Potentials via Laplace's & Poisson's Equations |
|
|
170 | (13) |
|
5.2.1 Solutions via Finite Differences |
|
|
170 | (3) |
|
5.2.2 Laplace & Poisson Problems |
|
|
173 | (3) |
|
5.2.3 Fourier Series vs. Finite Differences |
|
|
176 | (4) |
|
5.2.4 Disk in Space, Polar Plots |
|
|
180 | (1) |
|
5.2.5 Potential within Grounded Wedge |
|
|
180 | (1) |
|
5.2.6 Charge between Parallel Planes |
|
|
181 | (2) |
|
|
183 | (9) |
|
|
183 | (3) |
|
|
186 | (1) |
|
5.3.3 Circularly Polarized Waves |
|
|
187 | (1) |
|
|
188 | (1) |
|
5.3.5 Telegraph Line Waves |
|
|
189 | (3) |
|
5.4 Thin Film Interference of Light |
|
|
192 | (2) |
|
|
194 | (5) |
|
5.5.1 Vector Field Calculations & Visualizations |
|
|
194 | (1) |
|
5.5.2 Fields in Dielectrics |
|
|
194 | (2) |
|
5.5.3 Electric Fields via Integration |
|
|
196 | (2) |
|
5.5.4 Electric Fields via Images |
|
|
198 | (1) |
|
5.6 Magnetic Fields via Direct Integration |
|
|
199 | (3) |
|
5.6.1 Magnetic Field of Current Loop |
|
|
200 | (2) |
|
5.7 Motion of Charges in Magnetic Fields |
|
|
202 | (4) |
|
|
202 | (1) |
|
|
203 | (2) |
|
5.7.3 Magnetic Confinement |
|
|
205 | (1) |
|
|
206 | (4) |
|
5.8.1 Lorentz Transformations of Fields and Motion |
|
|
206 | (2) |
|
5.8.2 Two Interacting Charges, the Breit Interaction |
|
|
208 | (1) |
|
5.8.3 Field Propagation Effects |
|
|
209 | (1) |
|
|
210 | (19) |
6 Quantum Mechanics |
|
229 | (70) |
|
|
229 | (1) |
|
|
230 | (6) |
|
6.2.1 Bound States in 1-D Box (Semianalytic) |
|
|
230 | (1) |
|
6.2.2 Bound States in Arbitrary Potential (ODE Solver + Search) |
|
|
231 | (2) |
|
6.2.3 Bound States in Arbitrary Potential (Sloppy Shortcut) |
|
|
233 | (1) |
|
6.2.4 Relativistic Bound States of Klein-Gordon Equation |
|
|
234 | (2) |
|
6.3 Spontaneous Decay Simulation |
|
|
236 | (2) |
|
6.3.1 Fitting a Black Body Spectrum |
|
|
238 | (1) |
|
|
238 | (2) |
|
6.4.1 Harmonic Oscillator Wave Functions |
|
|
238 | (2) |
|
6.5 Partial Wave Expansions |
|
|
240 | (2) |
|
6.5.1 Associated Legendre Polynomials |
|
|
241 | (1) |
|
6.6 Hydrogen Wave Functions |
|
|
242 | (2) |
|
6.6.1 Hydrogen Radial Density |
|
|
242 | (2) |
|
6.6.2 Hydrogen 3-D Wave Functions |
|
|
244 | (1) |
|
|
244 | (5) |
|
6.7.1 Harmonic Oscillator Wave Packets |
|
|
244 | (1) |
|
6.7.2 Momentum Space Wave Packets |
|
|
245 | (1) |
|
6.7.3 Solving Time-Dependent Schrodinger Equation |
|
|
246 | (2) |
|
6.7.4 Time-Dependent Schrodinger with E Field |
|
|
248 | (1) |
|
|
249 | (8) |
|
6.8.1 Square Well Scattering |
|
|
249 | (3) |
|
|
252 | (2) |
|
6.8.3 Three Disks Scattering; Quantum Chaos |
|
|
254 | (2) |
|
6.8.4 Chaotic Quantum Billiards |
|
|
256 | (1) |
|
6.9 Matrix Quantum Mechanics |
|
|
257 | (8) |
|
6.9.1 Momentum Space Bound States (Integral Equations) |
|
|
257 | (2) |
|
6.9.2 k Space Bound States Delta Shell Potential |
|
|
259 | (1) |
|
6.9.3 k Space Bound States Other Potentials |
|
|
260 | (1) |
|
6.9.4 Hydrogen Hyperfine Structure |
|
|
261 | (2) |
|
6.9.5 SU(3) Symmetry of Quarks |
|
|
263 | (2) |
|
6.10 Coherent States and Entanglement |
|
|
265 | (9) |
|
6.10.1 Glauber Coherent States |
|
|
265 | (2) |
|
6.10.2 Neutral Kaons as Superpositions of States |
|
|
267 | (2) |
|
6.10.3 Double Well Transitions |
|
|
269 | (2) |
|
|
271 | (3) |
|
6.11 Feynman Path Integral Quantum Mechanics |
|
|
274 | (3) |
|
|
277 | (22) |
7 Thermodynamics & Statistical Physics |
|
299 | (36) |
|
|
299 | (1) |
|
|
299 | (5) |
|
7.2.1 Algorithm for Heat Equation |
|
|
300 | (1) |
|
7.2.2 Solutions for Various Geometries |
|
|
301 | (3) |
|
|
304 | (4) |
|
|
304 | (2) |
|
7.3.2 Diffusion-Limited Aggregation, a Fractal Walk |
|
|
306 | (1) |
|
|
307 | (1) |
|
7.4 Thermal Behavior of Magnetic Materials |
|
|
308 | (3) |
|
7.4.1 Roots of a Magnetization vs. Temperature Equation |
|
|
309 | (1) |
|
7.4.2 Counting Spin States |
|
|
309 | (2) |
|
|
311 | (5) |
|
7.5.1 Metropolis Algorithm |
|
|
312 | (3) |
|
|
315 | (1) |
|
7.5.3 Thermodynamic Properties |
|
|
316 | (1) |
|
|
316 | (1) |
|
|
316 | (6) |
|
7.6.1 16 Particles in a Box |
|
|
319 | (3) |
|
|
322 | (13) |
8 Biological Models: Population Dynamics & Plant Growth |
|
335 | (22) |
|
|
335 | (1) |
|
|
335 | (10) |
|
8.2.1 Other Discrete and Chaotic Maps |
|
|
338 | (1) |
|
8.3 Predator-Prey Dynamics |
|
|
339 | (2) |
|
8.3.1 Predator-Prey Chaos |
|
|
341 | (2) |
|
8.3.2 Including Prey Limits |
|
|
343 | (1) |
|
8.3.3 Including Predation Efficiency |
|
|
343 | (2) |
|
8.3.4 Two Predators, One Prey |
|
|
345 | (1) |
|
|
345 | (4) |
|
8.4.1 Protein Folding as a Self-Avoiding Walk |
|
|
346 | (1) |
|
8.4.2 Plant Growth Simulations |
|
|
347 | (1) |
|
|
348 | (1) |
|
|
349 | (1) |
|
|
349 | (8) |
9 Additional Entry-Level Problems |
|
357 | (18) |
|
|
357 | (1) |
|
9.2 Specular Reflection and Numerical Precision |
|
|
357 | (1) |
|
9.3 Relativistic Rocket Golf |
|
|
358 | (2) |
|
9.4 Stable Points in Electric Fields |
|
|
360 | (1) |
|
9.5 Viewing Motion in Phase Space (Parametric Plots) |
|
|
361 | (1) |
|
9.6 Other Useful Visualizations |
|
|
362 | (3) |
|
9.7 Integrating Power into Energy |
|
|
365 | (2) |
|
9.8 Rigid-Body Rotations with Matrices |
|
|
367 | (2) |
|
9.9 Searching for Calibration of a Spherical Tank |
|
|
369 | (1) |
|
9.10 AC Circuits via Complex Numbers |
|
|
370 | (3) |
|
9.10.1 Using Complex Numbers |
|
|
370 | (1) |
|
|
371 | (2) |
|
9.11 Beats and Satellites |
|
|
373 | (2) |
A Appendix: Python Codes |
|
375 | (2) |
Bibliography |
|
377 | (8) |
Index |
|
385 | |