numerical methods for engineers and scientists: an introduction with applications using matlab
TRANSCRIPT
This document is intended for internal use only and shall not be distributed outside of GUtech in Oman
Numerical Methods for Engineers and Scientists
Lecturer: Assistant Prof. Dr. AYDIN AZIZI
Slide 2
Copyright © 2014 John Wiley & Sons, Inc. All rights reserved.
Third Edition
Amos Gilat • Vish Subramaniam
Numerical Methods for
Engineers and Scientists
Lecturer: Assistant Prof. Dr. Aydin Azizi
Slide 3
Lecturer: Assistant Prof. Dr. Aydin Azizi
TAYLOR SERIES EXPANSION OF FUNCTIONS
Slide 4
Lecturer: Assistant Prof. Dr. Aydin Azizi
APPROXIMATION OF A FUNCTION WITH TAYLOR SERIES EXPANSION
Approximate the function y = sin(x) by using Taylor series expansion about x = 0, using six terms. Using MATLAB, plot the function and the approximation for 0≤x ≤ π.
SOLUTION
Slide 5
Lecturer: Assistant Prof. Dr. Aydin Azizi
Solving Nonlinear Equations: Newton's method
Algorithm for Newton's method
1. Choose a point xi as an initial guess of the solution.
2. For i=1, 2, . . . , until the error is smaller than a specified value, calculateXi+1 by using following equation:
Slide 6
Lecturer: Assistant Prof. Dr. Aydin Azizi
Find the solution of the equation 8-4.5(x-sinx) = 0. Use MATLAB with the function NewtonRoot. Use 0.0001 for the maximum relative error and 10 for the maximum number of iterations. use x = 2 as the initial guess of the solution.Solution:
Step 1• Define Newton method function in a new script.
Step 2 • Define f(xi) function in a new script.
Step 3• Define f '(xi) function in a new script.
Step 4• Run defined Newton method function
Solving Nonlinear Equations: Newton's method
Slide 7
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #1
Slide 8
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #2
Slide 9
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #3
Slide 10
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #4