hmwk_5_2010_solutions

# 3 ξ 2 h finally we re index so that the node j

• Notes
• 9

This preview shows page 4 - 7 out of 9 pages.

(3) ( ξ ) 2 h Finally, we re-index so that the node j corresponds with x 3 d 3 f dx 3 x j = f j - 3 f j - 1 + 3 f j - 2 - f j - 3 h 3 E = 3 2 f (3) j h 4

Subscribe to view the full document.

Problem 3 For this problem, we evaluate the approximations for f (4) and verified them using a Python script (see prob 3.py ). (a) Δ 4 f i h 4 = Δ 3 f i ) h 4 = Δ 3 ( f i +1 - f i ) h 4 = Δ 2 f i +1 - Δ f i ) h 4 = Δ 2 ( f i +2 - 2 f i +1 + f i )) h 4 = Δ(Δ f i +2 - f i +1 + Δ f i )) h 4 = Δ( f i +3 - f i +2 - 2 f i +2 + 2 f i +1 + f i +1 - f i ) h 4 = Δ( f i +3 - 3 f i +2 + 3 f i +1 - f i ) h 4 = Δ f i +3 - f i +2 + 3Δ f i +1 - Δ f i h 4 = f i +4 - f i +3 - 3 f i +3 + 3 f i +2 + 3 f i +2 - 3 f i +1 - f i +1 + f i h 4 = f i +4 - 4 f i +3 + 6 f i +2 - 4 f i +1 + f i h 4 (b) Δ 3 f i h 4 = Δ 3 ( f i - f i - 1 ) h 4 = Δ 2 f i - Δ f i - 1 ) h 4 = Δ 2 ( f i +1 - 2 f i + f i - 1 ) h 4 = Δ(Δ f i +1 - f i + Δ f i - 1 ) h 4 = Δ( f i +2 - 3 f i +1 + 3 f i - f i - 1 ) h 4 = f i +2 - f i +1 + 3Δ f i - Δ f i - 1 ) h 4 = f i +3 - f i +2 - 3 f i +2 + 3 f i +1 + 3 f i +1 - 3 f i - f i + f i - 1 h 4 = f i +3 - 4 f i +2 + 6 f i +1 - 4 f i + f i - 1 h 4 (c) 2 Δ 2 f i h 4 = 2 Δ( f i +1 - f i ) h 4 = 2 f i +1 - Δ f i ) h 4 = 2 ( f i +2 - 2 f i +1 + f i ) h 4 = ( f i +2 - 2 f i +1 + f i ) h 4 = ( f i +2 - 3 f i +1 + 3 f i - f i - 1 ) h 4 = f i +2 - 4 f i +1 + 6 f i - 4 f i - 1 + f i - 2 h 4 5
Problem 4 For this problem we are working with the following function: f ( x ) = 3 x 5 - 4 x 3 + x - 6 which has the following derivatives: f (1) ( x ) = 15 x 4 - 12 x 2 + 1 f (2) ( x ) = 60 x 3 - 24 x f (3) ( x ) = 180 x 2 - 24 (a) The matlab script computes all the values asked for in the homework assignment. The results are shown in Table 1. h f 2 f 1 f 0 f 0 (1) approx E actual E 1 1.0 60.000000 -6.000000 -6.000000 -33.000000 34.000000 -8.000000 0.5 -6.000000 -5.906250 -6.000000 0.375000 0.625000 -2.000000 0.1 -5.831040 -5.903970 -6.000000 1.075800 -0.075800 -0.080000 0.05 -5.903970 -5.950499 -6.000000 1.019739 -0.019738 -0.020000 0.01 -5.980032 -5.990004 -6.000000 1.000800 -0.000800 -0.00080 Table 1: Functional values, approximations, and errors for problem 4 (b) (i) As can be seen in Figure 1, the estimated error curve has a slope of 2 on the log-log plot, and the actual error curve generally has a slope of 2. The slope of the estimated error makes sense since taking logs of both sides and then rearranging yields the following: log( E 1 ) = log( 1 3 h 2 f (3) 0 ) = log( 1 3 f (3) 0 ) + log( h 2 ) = 2 log( h ) + log( 1 3 f (3) 0 ) log( E 1 ) = 2 log( h ) + log( 1 3 f (3) 0 ) Since log(E 1 ) is on the y-axis and log(h) is on the x-axis in the plot, this equation is in the form y = mx + b. The slope (m) is 2 which is what we see in the plot. Simply put, we expect a second order accurate formula to result in a straight line with a slope of 2 on the log-log plot.

Subscribe to view the full document.

You've reached the end of this preview.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern