DOC PREVIEW
IIT MATH 149 - MATH 149 LABORATORY ASSIGNMENT 6

This preview shows page 1-2 out of 5 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 5 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

MATH 149LABORATORY ASSIGNMENT 6NEWTON'S METHOD In past laboratory assignments we have encountered equations for which there are no general formulas for the solution. (For example, x = 1 + sin ( 2x ) ). However, MAPLE can usually find an approximation of the solution to any number of decimal places using the "fsolve" command. This laboratory investigates one of the several methods MAPLE uses in executing "fsolve". Newton's Method is a technique for approximating the solutions of an equation of the form f ( x ) = 0. It is based on the observation that, in most cases, if we make a fairly good initial guess, say x1 , to the zero of a function f , then the x-intercept of the tangent line to the graph of f at ( x1, f ( x1 ) ), which we call x2 , is a better estimate of the zero than was x1 . We repeat the process, finding the next approximation x3 , the x-intercept of the tangent to the graph of f at ( x2 , f (x2 ) ). Repeating this process n-times, we found in class that the (n + 1)st approximation is given by: x + n 1 = xn - f ( xn ) / f ' ( xn ) . Example Find all numbers x in the interval [ 0 , 1 ] for which ⎡⎣⎢⎢⎤⎦⎥⎥⎛⎝⎜⎜⎞⎠⎟⎟cos3 π x22 = x.First we put the equation in the form f ( x ) = 0, setting f ( x ) = ⎡⎣⎢⎢⎤⎦⎥⎥⎛⎝⎜⎜⎞⎠⎟⎟cos3 π x22 - x , and we plot the graph of f in order to see the approximate locations of the zeros of f.> restart;> with(plots):> f:=x->x-(cos(3*Pi*x/2))^2;:= f → x − x⎛⎝⎜⎜⎞⎠⎟⎟cos32πx2> plot(f,0..1);In order to estimate the location of the three zeros of f in the interval [ 0 , 1 ] through Newton's Method, we begin by defining the function g , which will be used to compute the successive approximations. > g:= x-> x-f(x)/D(f)(x); := g → x − x()f x()()D fxThe value of g for any x is:> g(x); − x − x⎛⎝⎜⎜⎞⎠⎟⎟cos3 π x22 + 13⎛⎝⎜⎜⎞⎠⎟⎟cos3 π x2⎛⎝⎜⎜⎞⎠⎟⎟sin3 π x2πNow to obtain the first zero of f in [ 0 , 1 ] , we make an initial guess using the graph for reference, and obtain each successive approximation by evaluating g at the previous estimate. We will want to use decimal representations for all of theapproximations, and therefore will use "evalf ". From the graph, it appears that x1 = 0.25 is a reasonable first guess.> x[1]:= 0.25; := x10.25For every positive integer n, x + n 1 = g( xn ). Therefore,> x[2]:=evalf(g(x[1])); := x20.2260966036> x[3]:=evalf(g(x[2])); := x30.2277515534> x[4]:=evalf(g(x[3])); := x40.2277581314> x[5]:=evalf(g(x[4])); := x50.2277581315> x[6]:=evalf(g(x[5])); := x60.2277581316> x[7]:=evalf(g(x[6])); := x70.2277581315Thus, it appears that the first zero of f in the interval [ 0 , 1 ] is 0.227758132 to nine decimal places. The "for / do " command allows us to calculate any number of approximations in one step:> for n from 1 to 8 do x[n+1]:=evalf(g(x[n])) od; := x20.2260966036 := x30.2277515534 := x40.2277581314 := x50.2277581315 := x60.2277581316 := x70.2277581315 := x80.2277581316 := x90.2277581315Even better, we can tell MAPLE to calculate approximations until xn and the next approximation, x + n 1 , are equal in a predetermined number of decimal places. In this example we specify 15 decimal places; NOTE THAT THE NUMBER OF DIGITS IN MAPLE DECIMAL EXPRESSIONS MUST BE RESET TO BE AT LEAST TWO MORE THAN THE DESIRED LEVEL OF ACCURACY.> Digits:=17; := Digits 17Now we can define the commands to be executed:> k:=1:> while (abs(x[k+1]-x[k]) > 10^(-15) ) do> k:=k+1:> x[k+1]:=evalf(g(x[k])):> od; := k 2 := x30.22775155332125591 := k 3 := x40.22775813150313093 := k 4 := x50.22775813160876803 := k 5 := x60.22775813160876803From the graph, it appears that the second zero in the interval [0 , 1] is approximately 0.5, and, in fact, it is exactly 0.5, since ⎡⎣⎢⎢⎤⎦⎥⎥⎛⎝⎜⎜⎞⎠⎟⎟cos3 π42= 12 .To approximate the final zero of f in [ 0 , 1 ], we first make an initial guess by examining the graph of f , and then we apply Newton's Method to obtain successive approximations as before. > Digits:=10; := Digits 10> plot(f,0..1);A reasonable first estimate would appear to be z1 = 0.75. We will again use a "while/do" command to generate a solution accurate to 8 decimal places.> z[1]:=0.75; := z10.75> z[2]:=evalf(g(z[1])); := z20.7739033963> k:=1:> while (abs(z[k+1]-z[k]) > 10^(-8) ) do> k:=k+1;> z[k+1]:=evalf(g(z[k])):> od; := k 2 := z30.7722484468 := k 3 := z40.7722418685 := k 4 := z50.7722418681Thus the third zero rounded to eight decimal places is


View Full Document

IIT MATH 149 - MATH 149 LABORATORY ASSIGNMENT 6

Documents in this Course
QUIZ

QUIZ

2 pages

QUIZ

QUIZ

3 pages

Quiz

Quiz

2 pages

Exam

Exam

4 pages

Load more
Download MATH 149 LABORATORY ASSIGNMENT 6
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view MATH 149 LABORATORY ASSIGNMENT 6 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view MATH 149 LABORATORY ASSIGNMENT 6 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?