numerical methods for engineers and scientists: an introduction with applications using matlab
TRANSCRIPT
![Page 1: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/1.jpg)
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
![Page 2: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/2.jpg)
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
![Page 3: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/3.jpg)
Slide 3
Lecturer: Assistant Prof. Dr. Aydin Azizi
TAYLOR SERIES EXPANSION OF FUNCTIONS
![Page 4: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/4.jpg)
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
![Page 5: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/5.jpg)
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:
![Page 6: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/6.jpg)
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
![Page 7: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/7.jpg)
Slide 7
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #1
![Page 8: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/8.jpg)
Slide 8
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #2
![Page 9: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/9.jpg)
Slide 9
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #3
![Page 10: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB](https://reader037.vdocuments.us/reader037/viewer/2022091123/58e4c0201a28abc24e8b4ad1/html5/thumbnails/10.jpg)
Slide 10
Lecturer: Assistant Prof. Dr. Aydin Azizi
Newton's method : Step #4