Mathematical Physics II (Practical)
:: Home :
CV :
Teaching :
Research :
Publications :
Presentations :
Leisure ::
Lectures
- Lecture 01. [Recapitulation]
- Lecture 02. [NumPy Array]
- Lecture 03. [SciPy]
- Lecture 04. [Numerical Integration]
- Lecture 05. [Ordinary Differential Equation]
- Lecture 06. [Curve Fitting]
Codes
Plots
- Plot 01:
- Plot 02:
- Plot 03:
- Plot 04:
Remarks
- See Numpy Lecture 1
and Lecture 2 by Prof.
Ananda Dasgupta. Here are
presentations by Prof. Abhijit Kar Gupta.
- CU Question Set for a few years.
- Use Pydriod from Android PlayStore to practice codes on your cellphone.
Topics
- Introduction to numpy and scipy:
- The numpy array:
- properties: size, shape, ndim, dtype.
- creating arrays:
- zeros, one(), full(), fill().
- arange(),linspace(),logspace().
- identity(), eye().
- astype().
- Indexing and slicing arrays (view versus copy).
- Important array methods:
- reshape(), ravel(), flatten().
- hstack() and vstack().
- Element wise functions:native numpy functions,the vectorise() method.
- Aggregate functions np.sum(),np.prod(),np.mean(),np.std(),np.var(),np.min(),np.max(), np.argmin(), np.argmax().
- Using numpy for matrix operators (the 2D numpy array):
- addition, multiplication(dot).
- Gauss elemination (using partial pivoting)(numpy code):
- for evaluating the determinant.
- for solving linear equation.
- The numpy linalg module:
- solving equations: (a) mesh equations of electric circuits (3 meshes), (b) coupled spring mass systems (3 masses).
- diagonalisation.
- Scientific Applications:
- Interpolation: Using both numpy and scipy.interpolate(for visualization of the results use
matplotlib) -basic numerical analysis theory to be explained.
- Lagrange Interpolation.
- Newton Forward Interpolation.
- Numerical Integration:(for both functions and equi-spaced data):
- Trapezoidal rule.
- Simpson’s one-third rule. Using both numpy and scipy.integrate.quad(), scipy.integrate.trapz(),
scipy.intgrate.simps() - basic numerical analysis theory to be explained.
- Numerical Integration by n-point Gaussian Quadrature method. [Basic theory and numpy code - nodes
and weights to be read from files, Integration by scipy.integrate.quad().]
- Solution of ODE:
- Solution of 1st order and 2nd order ordinary differential equation using 4th order Runge Kutta
(RK4) algorithm [algorithm and numpy code - detailed theory not required]
- Curve fitting:
- With numpy polynomials.
- With user defined functions using scipy.optimize module.
- Introduction to matplotlib (Using the pyplot submodule):
- figure, axes, subplot.
- plot(), scatter(), show().
- labels, legends, titles, styles, ticks.
- dynamically updating curves.
- saving graphs.
Study Materials
- Accuracy and Stability of Numerical Algorithms - Nicholas J. Higham.
- Python for Scientists - John M. Stewart (2nd Edition) (Numpy).
- Matplotlib Plotting Cookbook - Alexandre Devert. (Matplotlib).
- Programming for Computation-Python - Svein Linge & Hans Petter Lantangen.
- Computatioal Physics problem solving with Computers - Landau, Paez, Bordeianu.
- Introduction to Numerical Programming - Titus Adrian Beu. (Integration).
- Scientific Computing in Python - Abhijit Kar Gupta.