Transcript
Page 1: Numerical Methods for Engineers and Scientists: An Introduction with Applications Using MATLAB

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

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

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

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

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

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

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

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

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

Slide 10

Lecturer: Assistant Prof. Dr. Aydin Azizi

Newton's method : Step #4


Top Related