Approximate Numbers Sources of Errors in Numerical Calculations Absolute and Relative Errors Representation of Numbers Significant Digits Errors of Elementary Operations References and Suggested Further Reading Basic Programming Techniques Programming Concepts Functions and Parameters Passing Arguments to Python Functions Passing Arguments to C/C++ Functions Arrays in Python Dynamic Array Allocation in C/C++ Basic Matrix Operations References and Suggested Further Reading Elements of Scientific Graphics The Tkinter Package The Canvas Widget Simple Tkinter Applications Plotting Functions of One Variable Graphics Library graphlib.py Creating Plots in C++ Using the Library graphlib.py References and Suggested Further Reading Sorting and Indexing Introduction Bubble Sort Insertion Sort Quicksort Indexing and Ranking Implementations in C/C++ Problems References and Suggested Further Reading Evaluation of Functions Evaluation of Polynomials by Horner's Scheme Evaluation of Analytic Functions Continued Fractions Orthogonal Polynomials Spherical Harmonics Associated Legendre Functions Spherical Bessel Functions Implementations in C/C++ Problems References and Suggested Further Reading Algebraic and Transcendental Equations Root Separation Bisection Method Method of False Position Method of Successive Approximations Newton's Method Secant Method Birge-Vieta Method Newton's Method for Systems of Nonlinear Equations Implementations in C/C++ Problems References and Suggested Further Reading Systems of Linear Equations Introduction Gaussian Elimination with Backward Substitution Gauss-Jordan Elimination LU Factorization Inversion of Triangular Matrices Cholesky Factorization Tridiagonal Systems of Linear Equations Block Tridiagonal Systems of Linear Equations Complex Matrix Equations Jacobi and Gauss-Seidel Iterative Methods Implementations in C/C++ Problems References and Suggested Further Reading Eigenvalue Problems Introduction Diagonalization of Matrices by Similarity Transformations Jacobi Method Generalized Eigenvalue Problems for Symmetric Matrices Implementations in C/C++ Problems References and Suggested Further Reading Modeling of Tabulated Functions Interpolation and Regression Lagrange Interpolation Polynomial Neville's Interpolation Method Cubic Spline Interpolation Linear Regression Multilinear Regression Models Nonlinear Regression: The Levenberg-Marquardt Method Implementations in C/C++ Problems References and Suggested Further Reading Integration of Functions Introduction Trapezoidal Rule; A Heuristic Approach The Newton-Cotes Quadrature Formulas Trapezoidal Rule Simpson's Rule Adaptive Quadrature Methods Romberg's Method Improper Integrals: Open Formulas Midpoint Rule Gaussian Quadratures Multidimensional Integration Adaptive Multidimensional Integration Implementations in C/C++ Problems References and Suggested Further Reading Monte Carlo Method Introduction Integration of Functions Importance Sampling Multidimensional Integrals Generation of Random Numbers Implementations in C/C++ Problems References and Suggested Further Reading Ordinary Differential Equations Introduction Taylor Series Method Euler's Method Runge-Kutta Methods Adaptive Step Size Control Methods for Second-Order ODEs Numerov's Method Shooting Methods for Two-Point Problems Finite-Difference Methods for Linear Two-Point Problems Implementations in C/C++ Problems References and Suggested Further Reading Partial Differential Equations Introduction Boundary-Value Problems for Elliptic Differential Equations Initial-Value Problems for Parabolic Differential Equations Time-Dependent Schroedinger Equation Initial-value Problems for Hyperbolic Differential Equations Implementations in C/C++ Problems References and Suggested Further Reading Appendices Index
Titus Adrian Beu, professor of theoretical and computational physics at the University "Babes-Bolyai" from Cluj-Napoca, Romania, has been active in the broader field of computational physics for more than 30 years. His research topics have evolved from Tokamak plasma and nuclear reactor calculations in the 1980s, collision theory and molecular cluster spectroscopy in the 1990s, to fullerenes and nanofluidics simulations in recent years. Development of ample computer codes has been at the core of all research projects the author has conducted. In parallel, he has lectured on general programming techniques and advanced numerical methods, general simulation methods, and advanced molecular dynamics.
"This book is written for advanced undergraduate and graduate students in natural sciences and engineering for a one- or two-semester course. The material presented includes many topics treated in a numerical analysis course and contains a lot of coding examples in Phyton, and C/C++. ... The value of the book lies in the presentation of the programming and a program example on almost every second page." -Gudula Runger, Zentralblatt MATH, 1308 "In a relatively crowded field of numerical programming books, this is the only one to include both Python and C code examples. ... a good reference for a one- or two-semester course for advanced undergraduate students or for graduate students in science or engineering." -Optics & Photonics News, 2015 "Working through this book you will become an expert in numerical techniques ... . Your journey will be a real pleasure since the book focuses on thorough explanations, hands-on code examples, and graphical representations." -Professor Dr. Alexander K. Hartmann, Institute for Physics, University of Oldenburg "... by taking simple mathematical examples and translating them into what the computer actually does, this textbook provides us with a good picture of what is achieved in a numerical simulation. A basic necessity for whoever wants to address more complex coding and algorithms!" -Professor Michel Mareschal, Department of Physics, Universite Libre de Bruxelles "This is a useful book, both as a text and as a reference for computational physics students and instructors. Right from the first chapter about errors it provides an invaluable resource for aspects that are often not sufficiently emphasised, despite their importance for reliable calculations. I strongly recommend it for everyone's bookshelf." -Professor Joan Adler, Technion, Israel Institute of Technology "... a comprehensive introduction to classical numerical methods for advanced-level undergraduate students in the physical sciences, engineering, and applied mathematics. The book is novel in teaching both numerics and the art of programming, via clear and simple codes in Python and C/++. ... I will recommend it to my students." -Professor Mike Wheatland, The University of Sydney "This book is unique in providing an introduction to [numerical methods, programming languages, and graphics]. Each topic is clearly explained and can be practiced using ready-made computer programs." -Professor R.I. Campeanu, York University, Toronto