README.md

Download
markdown 152 lines 4.3 KB
  1# Mathematical Methods Example Files
  2
  3This directory contains 12 standalone Python scripts demonstrating mathematical methods commonly used in physics and engineering (based on Mary Boas' "Mathematical Methods in the Physical Sciences").
  4
  5## Files Overview
  6
  7### 01_infinite_series.py
  8- Series convergence tests (ratio, root, comparison)
  9- Partial sums and convergence visualization
 10- Taylor and Maclaurin series expansions
 11- Euler summation technique
 12- Power series radius of convergence
 13
 14### 02_complex_numbers.py
 15- Complex arithmetic operations
 16- Polar and exponential forms
 17- Euler's formula
 18- Roots of unity
 19- Conformal mappings (z², 1/z, exp(z))
 20- Simple Mandelbrot set visualization
 21
 22### 03_linear_algebra.py
 23- Matrix operations (addition, multiplication, transpose)
 24- Determinants and matrix inverse
 25- Eigenvalues and eigenvectors
 26- Matrix diagonalization
 27- Singular Value Decomposition (SVD)
 28- Solving linear systems
 29- Matrix exponential
 30
 31### 05_vector_analysis.py
 32- Gradient of scalar fields
 33- Divergence of vector fields
 34- Curl of vector fields
 35- Line integrals
 36- Surface integrals
 37- Green's, Stokes', and Divergence theorem verification
 38
 39### 06_fourier.py
 40- Fourier series coefficients
 41- Fast Fourier Transform (FFT)
 42- Spectral analysis
 43- Filtering in frequency domain
 44- Parseval's theorem
 45- Windowing techniques (Hanning, Hamming, Blackman)
 46
 47### 07_ode.py
 48- Euler's method
 49- Runge-Kutta 4th order (RK4)
 50- scipy.integrate.solve_ivp
 51- Harmonic oscillator
 52- Damped oscillator
 53- Lorenz system (chaotic dynamics)
 54- Phase portraits
 55
 56### 08_special_functions.py
 57- Bessel functions J_n(x) and Y_n(x)
 58- Legendre polynomials P_n(x)
 59- Hermite polynomials H_n(x)
 60- Laguerre polynomials L_n(x)
 61- Spherical harmonics Y_l^m(Īø,φ)
 62- Gamma function Ī“(x)
 63- Orthogonality properties
 64
 65### 10_pde.py
 66- Heat equation (parabolic): finite difference method
 67- Wave equation (hyperbolic): explicit scheme
 68- Laplace equation (elliptic): Jacobi relaxation
 69- Poisson equation with source term
 70- Time evolution visualization
 71
 72### 11_complex_analysis.py
 73- Cauchy integral formula (numerical)
 74- Residue theorem and computation
 75- Laurent series expansion
 76- Poles and essential singularities
 77- Analytic continuation concepts
 78- Conformal mapping visualization
 79
 80### 12_laplace_transform.py
 81- Laplace transform pairs
 82- Inverse Laplace transform (Bromwich integral)
 83- Solving ODEs using Laplace transform
 84- Transfer functions
 85- Step response
 86- Frequency response (Bode plots)
 87- Convolution theorem
 88
 89### 14_calculus_of_variations.py
 90- Euler-Lagrange equation
 91- Brachistochrone problem (fastest descent)
 92- Catenary curve (hanging chain)
 93- Geodesics on surfaces
 94- Lagrangian mechanics (pendulum, spring-mass)
 95- Minimal surface of revolution (catenoid)
 96
 97### 15_tensors.py
 98- Tensor operations with numpy
 99- Index notation and Einstein summation (np.einsum)
100- Metric tensor (Euclidean, polar, spherical)
101- Christoffel symbols
102- Coordinate transformations (Cartesian ↔ polar)
103- Raising and lowering indices
104- Levi-Civita tensor and cross product
105
106## Requirements
107
108All scripts are standalone and can be run independently. They require:
109
110- **Required**: `numpy`
111- **Optional**: `scipy` (for advanced numerical methods)
112- **Optional**: `matplotlib` (for visualizations)
113
114If scipy or matplotlib are not available, the scripts will run with reduced functionality and skip visualizations.
115
116## Usage
117
118Run any script directly:
119
120```bash
121python 01_infinite_series.py
122python 02_complex_numbers.py
123# ... etc
124```
125
126Each script:
127- Prints detailed numerical results to console
128- Generates visualizations (saved as PNG files) if matplotlib is available
129- Includes docstrings explaining the mathematical concepts
130
131## File Naming Convention
132
133Files are numbered according to the chapter structure in Boas' textbook:
134- Chapter 1: Infinite Series (01)
135- Chapter 2: Complex Numbers (02)
136- Chapter 3: Linear Algebra (03)
137- Chapter 5: Vector Analysis (05)
138- Chapter 6: Fourier Analysis (06)
139- Chapter 7: ODEs (07)
140- Chapter 8: Special Functions (08)
141- Chapter 10: PDEs (10)
142- Chapter 11: Complex Analysis (11)
143- Chapter 12: Laplace Transform (12)
144- Chapter 14: Calculus of Variations (14)
145- Chapter 15: Tensors (15)
146
147Note: Not all chapters have example files (e.g., Chapter 4 was incorporated into Chapter 3).
148
149## License
150
151These examples are part of the 03_Study project and are released under the MIT License.