# h3 hn2 2hn2 hn1

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 0 2(h1 + h2 ) h2 h2 2(h2 + h3 ) .. . h3 .. . .. . .. . .. . hn−2 .. . 2(hn−2 + hn−1 ) 0 hn−1 1 c1 c2 c3 . . . . . . cn−1 cn = − f2 ) − − f1 ) − f3 ) − − f2 ) 3 2 . . . . . . 3 (fn − fn−1 ) − h 3 (fn−1 − fn−2 ) hn − 1 n− 2 0 3 (f3 h2 3 (f4 h The formulas to compute the bi ’s and di ’s are 1 hi (fi+1 − fi ) − (2ci + ci+1 ) for i = 1, 2, . . . , n − 1 hi 3 1 = (ci+1 − ci ) for i = 1, 2, . . . , n − 1. 3hi bi = di 1 3 (f2 h1 3 (f3 h . Task 1 1. Let f (x) = e−20x for x ∈ [−1, 1] and let x0 = −1, x1 = −0.9, x2 = −0.8, . . . , x19 = 0.9, x20 = 1 be twenty-one distinct points in [−1, 1]. The following code evaluates f at the nodes, computes the coeﬃcients of interpolating polynomial P20 , and displays the maximum absolute error maxj =0,1,...,2×105 |f (yj ) − P20 (yj )|, where yj = −1 + 10−5 j...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online