
An introduction to numerical methods, advantages of Python, course goals, course audience, course requirements, how to get the Python IDE and course contents. At the end of this lecture the student will know the knowledge and skills that he will learn in this course. He will know how to install the Python IDE and required modules on his computer.
Explore the simple iterations method for solving higher-degree equations, including polynomials and transcendental cases, by rearranging the equation, selecting an initial guess, iterating, and checking convergence.
Demonstrates implementing the simple iterations method in Python with a for loop, using an initial guess, a degree of accuracy with absolute difference, and comparing results to analytical roots.
Code the bisection method in Python to solve 2x^2 -5x +3 = 0. Track sign differences and midpoints with a degree of accuracy to converge on roots 1 and 1.5.
This lecture is includes the graphical illustration about how secant method works in addition to the numerical coding by using a Python function.
Explore using SciPy's optimize module for root finding in Python, applying Newton, bisect, fsolve, and root to solve polynomial equations from initial guesses and intervals.
Explore linear interpolation between two data points in a time-temperature dataset, estimating values with a straight-line slope and Python examples using lambda and a user-defined function.
Build and code Newton's interpolation in Python by constructing the divided differences table with NumPy and implementing the substitution stage to evaluate the interpolation polynomial.
Apply the least squares method to fit a straight line to data using linear regression, deriving coefficients A and B from summations, x-bar, y-bar, and n.
Code the linear regression method using numpy arrays to compute the slope and intercept without loops. Import numpy, define arrays, and use mean and sum for efficient, vectorized calculations.
Learn to code polynomial curve fitting in python with numpy, build data points, form the system of equations, and compute coefficients for quadratic and cubic fits.
Learn to use SciPy's interpolation functions for 1D and multi-dimensional data, including interp1d and Lagrange, to build linear, quadratic, and cubic interpolants from X and Y data in Python.
Explore scipy curve fitting and linear regression with linregress and curve_fit in Python, using models for quadratic and cubic polynomials to extract coefficients and fit data.
Code the forward finite differences method to estimate first and second derivatives of a polynomial at x=0.1, compare with analytical values, and explore how smaller step sizes improve accuracy.
Explore using scipy.misc.derivative to compute first and second derivatives via central differences, with customizable step size and order, and compare results with plotting in Python.
Apply the trapezoidal rule to approximate the area under a curve, a basic numerical integration method. Divide [A, B] into equal-width trapezoids and sum their areas; more divisions reduce error.
Explore Simpson's one third rule for numerical integration, using weighting factors to improve accuracy with even numbers of strips, contrasting it with the trapezoidal rule and outlining its summation-based formula.
Explore the Simpson's 3/8 rule, using four points and three strips with weights on f(x1) and f(x2); derive the integral formula and coding approach.
Learn to perform double integration using Simpson's one-third and three-eighth rules with an extended form, applying outer and inner loops and combining their factors.
Gauss elimination code to handle zero pivots by skipping operations when pivot is zero and swapping rows, preventing division by zero and NaNs while solving linear systems.
Explore Jacobi's method, a basic iterative algorithm for solving linear systems by rearranging equations, using an initial guess and updating all x_i simultaneously until the whole system converges.
Code Jacobi's method in Python using numpy arrays, shape, full, zeros, and empty; set tolerance and iterations, implement i and j loops, convergence check, and copy to avoid aliasing.
Explore the Gauss-Seidel method as an iterative algorithm, applying new x values immediately within each equation, and compare its convergence and efficiency to Jacobi's method.
Learn to solve linear systems in numpy and scipy via direct solve and inverse-based methods, with Python examples, and compare elimination with Gauss-Seidel and Jacobi iterative schemes requiring diagonal dominance.
In this lecture, the steps of Gauss-Jordan method are explained by using a symbolic 4-equation system as well as a hand-solved numeric example. The outcome is to help the student comprehend the theoretical basis of the method.
In this lecture, the algorithm of Gauss-Jordan method is explained in the light of the general formulas written in the previous lecture. A Python code is also developed to solve the numeric problem. Finally, some modifications are made on the code to utilized the internal Numpy loops instead of explicit Python for loop.
Explore Euler's method for solving initial value problems and implement it in Python, highlighting step size effects and comparing numerical results to the analytical solution.
Explore the fourth order Runge-Kutta method to solve y' = 2y + 3 on [2,4] with h=0.1, compare to the exact solution, and visualize results with numpy and matplotlib.
Many of the Numerical Analysis courses focus on the theory and derivations of the numerical methods more than the programming techniques. Students get the codes of the numerical methods in different languages from textbooks and lab notes and use them in working their assignments instead of programming them by themselves.
For this reason, the course of Programming Numerical Methods in Python focuses on how to program the numerical methods step by step to create the most basic lines of code that run on the computer efficiently and output the solution at the required degree of accuracy.
This course is a practical tutorial for the students of Numerical Analysis to cover the part of the programming skills of their course.
In addition to its simplicity and versatility, Python is a great educational computer language as well as a powerful tool in scientific and engineering computations. For the last years, Python and its data and numerical analysis and plotting libraries, such as NumPy, SciPy and matplotlib, have become very popular programming language and tool in industry and academia.
That’s why this course is based on Python as programming language and NumPy and matplotlib for array manipulation and graphical representation, respectively. At the end of each section, a number of SciPy numerical analysis functions are introduced by examples. In this way, the student will be able to program his codes from scratch and in the same time use the advanced library functions in his work.
This course covers the following topics: