This book concentrates on the practical aspects of numerical analysis and linear and non-linear programming. It discusses the methods for solving different types of mathematical problems using MATLAB and Python. Although the book focuses on the approximation problem rather than on error analysis of mathematical problems, it provides practical ways to calculate errors. The book is divided into three parts, covering topics in numerical linear algebra, methods of interpolation, numerical differentiation and integration, solutions of differential equations, linear and non-linear programming problems, and optimal control problems. This book has the following advantages: It adopts the programming languages, MATLAB and Python, which are widely used among academics, scientists, and engineers, for ease of use and contain many libraries covering many scientific and engineering fields. It contains topics that are rarely found in other numerical analysis books, such as ill-conditioned linear systems and methods of regularization to stabilize their solutions, nonstandard finite differences methods for solutions of ordinary differential equations, and the computations of the optimal controls. It provides a practical explanation of how to apply these topics using MATLAB and Python. It discusses software libraries to solve mathematical problems, such as software Gekko, pulp, and pyomo. These libraries use Python for solutions to differential equations and static and dynamic optimization problems. Most programs in the book can be applied in versions prior to MATLAB 2017b and Python 3.7.4 without the need to modify these programs. This book is aimed at newcomers and middle-level students, as well as members of the scientific community who are interested in solving math problems using MATLAB or Python.
Author(s): Eihab B. M. Bashier
Publisher: CRC Press
Year: 2020
Language: English
Pages: 330
Cover
Half Title
Title Page
Copyright Page
Dedication
Contents
Preface
Author
Part I: Solving Linear and Nonlinear Systems of Equations
1. Solving Linear Systems Using Direct Methods
1.1 Testing the Existence of the Solution
1.2 Methods for Solving Linear Systems
1.2.1 Special Linear Systems
1.2.2 Gauss and Gauss-Jordan Elimination
1.2.3 Solving the System with the rref Function
1.3 Matrix Factorization Techniques
1.3.1 The LU Factorization
1.3.2 The QR Factorization
1.3.3 The Singular Value Decomposition (SVD)
2. Solving Linear Systems with Iterative and Least Squares Methods
2.1 Mathematical Backgrounds
2.1.1 Convergent Sequences and Cauchi’s Convergence
2.1.2 Vector Norm
2.1.3 Convergent Sequences of Vectors
2.2 The Iterative Methods
2.2.1 The General Idea
2.2.2 The Jacobi Method
2.2.3 The Jacobi Method in the Matrix Form
2.2.3.1 The Gauss-Seidel Iterative Method
2.2.4 The Gauss-Seidel Method in the Vector Form
2.2.5 The Relaxation Methods
2.3 The Least Squares Solutions
2.3.1 Some Applications of Least Squares Solutions
3. Ill-Conditioning and Regularization Techniques in Solutions of Linear Systems
3.1 Ill-Conditioning in Solutions of Linear Systems
3.1.1 More Examples of Ill-Posed System
3.1.2 Condition Numbers and Ill-Conditioned Matrices
3.1.3 Linking the Condition Numbers to Matrix Related Eigenvalues
3.1.4 Further Analysis on Ill-Posed Systems
3.2 Regularization of Solutions in Linear Systems
3.2.1 The Truncated SVD (TSVD) Method
3.2.2 Tikhonov Regularizaton Method
3.2.3 The L-curve Method
3.2.4 The Discrepancy Principle
4. Solving a System of Nonlinear Equations
4.1 Solving a Single Nonlinear Equation
4.1.1 The Bisection Method
4.1.2 The Newton-Raphson Method
4.1.3 The Secant Method
4.1.4 The Iterative Method Towards a Fixed Point
4.1.5 Using the MATLAB and Python solve Function
4.2 Solving a System of Nonlinear Equations
Part II: Data Interpolation and Solutions of Differential Equations
5. Data Interpolation
5.1 Lagrange Interpolation
5.1.1 Construction of Lagrange Interpolating Polynomial
5.1.2 Uniqueness of Lagrange Interplation Polynomial
5.1.3 Lagrange Interpolation Error
5.2 Newton’s Interpolation
5.2.1 Description of the Method
5.2.2 Newton’s Divided Differences
5.3 MATLAB’s Interpolation Tools
5.3.1 Interpolation with the interp1 Function
5.3.2 Interpolation with the Spline Function
5.3.3 Interpolation with the Function pchip
5.3.4 Calling the Functions spline and pchip from interp1
5.4 Data Interpolation in Python
5.4.1 The Function interp1d
5.4.2 The Functions pchip interpolate and CubicSpline
5.4.3 The Function lagrange
6. Numerical Differentiation and Integration
6.1 Numerical Differentiation
6.1.1 Approximating Derivatives with Finite Differences
6.2 Numerical Integration
6.2.1 Newton-Cotes Methods
6.2.2 The Gauss Integration Method
7. Solving Systems of Nonlinear Ordinary Differential Equations
7.1 Runge-Kutta Methods
7.2 Explicit Runge-Kutta Methods
7.2.1 Euler’s Method
7.2.2 Heun’s Method
7.2.3 The Fourth-Order Runge-Kutta Method
7.3 Implicit Runge-Kutta Methods
7.3.1 The Backward Euler Method
7.3.2 Collocation Runge-Kutta Methods
7.3.2.1 Legendre-Gauss Methods
7.3.2.2 Lobatto Methods
7.4 MATLAB ODE Solvers
7.4.1 MATLAB ODE Solvers
7.4.2 Solving a Single IVP
7.4.3 Solving a System of IVPs
7.4.4 Solving Stiff Systems of IVPs
7.5 Python Solvers for IVPs
7.5.1 Solving ODEs with odeint
7.5.2 Solving ODEs with Gekko
8. Nonstandard Finite Difference Methods for Solving ODEs
8.1 Deficiencies with Standard Finite Difference Schemes
8.2 Construction Rules of Nonstandard Finite Difference Schemes
8.3 Exact Finite Difference Schemes
8.3.1 Exact Finite Difference Schemes for Homogeneous Linear ODEs
8.3.1.1 Exact Finite Difference Schemes for a Linear Homogeneous First-Order ODE
8.3.1.2 Exact Finite Difference Scheme for Linear Homogeneous Second Order ODE
8.3.1.3 Exact Finite Difference Scheme for a System of Two Linear ODEs
8.3.2 Exact Difference Schemes for Nonlinear Equations
8.3.3 Exact Finite Difference Schemes for Differential Equations with Linear and Power Terms
8.4 Other Nonstandard Finite Difference Schemes
Part III: Solving Linear, Nonlinear and Dynamic Optimization Problems
9. Solving Optimization Problems: Linear and Quadratic Programming
9.1 Form of a Linear Programming Problem
9.2 Solving Linear Programming Problems with linprog
9.3 Solving Linear Programming Problems with fmincon MATLAB’s Functions
9.4 Solving Linear Programming Problems with pulp Python
9.5 Solving Linear Programming Problems with pyomo
9.6 Solving Linear Programming Problems with gekko
9.7 Solving Quadratic Programming Problems
10. Solving Optimization Problems: Nonlinear Programming
10.1 Solving Unconstrained Problems
10.1.1 Line Search Algorithm
10.1.2 The Steepest Descent Method
10.1.3 Newton’s Method
10.1.4 Quasi Newton’s Methods
10.1.4.1 The Broyden-Fletcher-Goldfarb-Shanno (BFGS) Method
10.1.4.2 The Davidon-Fletcher-Powell (DFP) Algorithm
10.1.5 Solving Unconstrained Optimization Problems with MATLAB
10.1.6 Solving an Unconstrained Problem with Python
10.1.7 Solving Unconstrained Optimization Problems with Gekko
10.2 Solving Constrained Optimization Problems
10.2.1 Solving Constrained Optimization Problems with MATLAB fmincon Function
10.2.2 Solving Constrained Minimization Problems in Python
10.2.3 Solving Constrained Optimization with Gekko Python
11. Solving Optimal Control Problems
11.1 Introduction
11.2 The First-Order Optimality Conditions and Existence of Optimal Control
11.3 Necessary Conditions of the Discretized System
11.4 Numerical Solution of Optimal Control
11.5 Solving Optimal Control Problems Using Indirect Methods
11.5.1 Numerical Solution Using Indirect Transcription Method
11.6 Solving Optimal Control Problems Using Direct Methods
11.6.1 Statement of the Problem
11.6.2 The Control Parameterization Technique
11.6.2.1 Examples
11.6.3 The Gekko Python Solver
Bibliography
Index