Lecture 3 Group Homework

Lecture 3 Group Homework - for i = 1:n S = S + 4*.9^i; end...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture 3 Homework Exercise 3.1 The calculated value that MatLab returns for the 5 th root of 7 [format long] is 1.475773161594552. Running mynewton on the function f(x) = x 5 – 7, with x 0 = 2 and n = 6, the same value is obtained. For all n larger than 6, the value does not change. However, by substituting x = 1.475773161594552 into the original f(x), MatLab returns the following result: 2.664535259100376e 015. This, albeit very (relatively) close, is not equal to 0. Exercise 3.2 The following is the source code of a script program entitled “ballbouncing” that determines the total distance traveled by a ball with elasticity of 0.9 after being dropped from an initial height of 2 meters. % ballbouncing computes the total distance traveled % by a bouncing ball with a coefficient of elasticity % equal to 0.9 after being dropped from an initial % height of 2 meters % Initialize the height to 2 meters S = 2: % The loop performs “n” times where “n” is declared % in the command window
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for i = 1:n S = S + 4*.9^i; end % Show the final result in the command window disp(S); By letting n = 328, ballbouncing returns the value 37.999999999999972 . This value does not change for any n larger than 328. Additionally, this value makes sense if we define D total in the following way: Using the basic principle of determining what value a geometric series converges to, we see that as n tends to infinity, the summation in D total converges to 9. Thus, D total converges to 38, and the value achieved beyond n = 328 makes sense. Exercise 3.3 The following is a table detailing the first 4 results (including iteration 0) of Newtons Method with f(x) = x 3 4; f(x ) = 3x 2 and x = 2. X Value Output of Newtons Method Error Percent error x0 2 (Iteration 0) .4126 25.992% x1 1.666. .. .0793 4.993% x2 1.59111. .. .0037 0.2337% x3 1.5874097 8.6380318E 6 0.5442E 3% *Hand calculations are attached...
View Full Document

This note was uploaded on 01/15/2011 for the course MATH 345 taught by Professor Staff during the Spring '08 term at Ohio State.

Ask a homework question - tutors are online