{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hmwk_5_2010_solutions

# hmwk_5_2010_solutions - CE 30125 Computational Methods...

This preview shows pages 1–3. Sign up to view the full content.

CE 30125 Computational Methods: Assignment 5 December 8, 2010 Problem 1 A fourth order accurate central approximation to the second derivative (p=2, n=4) requires p + n - 1 = 2 + 4 - 1 = 6 - 1 = 5 nodes. The second central derivative can therefore be approximate to O(h 4 ) as: f (2) i - E = α 1 f i - 2 + α 2 f i - 1 + α 3 f i + α 4 f i +1 + α 5 f i +2 h 2 T.S. expansions about x i are: f i - 2 = f i - 2 hf (1) i + 2 h 2 f (2) i - 4 h 3 3 f (3) i + 2 h 4 3 f (4) i - 4 h 5 15 f (5) i + 4 h 6 45 f (6) i + O ( h 7 ) f i - 1 = f i - hf (1) i + h 2 2 f (2) i - h 3 6 f (3) i + h 4 24 f (4) i - h 5 120 f (5) i + h 6 720 f (6) i + O ( h 7 ) f i = f i f i +1 = f i + hf (1) i + h 2 2 f (2) i + h 3 6 f (3) i + h 4 24 f (4) i + h 5 120 f (5) i + h 6 720 f (6) i + O ( h 7 ) f i +2 = f i + 2 hf (1) i + 2 h 2 f (2) i + 4 h 3 3 f (3) i + 2 h 4 3 f (4) i + 4 h 5 15 f (5) i + 4 h 6 45 f (6) i + O ( h 7 ) Substituting into our assumed form of f i (2) and re-arranging: f (2) i - E = α 1 f i - 2 + α 2 f i - 1 α 3 f i + α 4 f i +1 + α 5 f i +2 h 2 = ( α 1 + α 2 + α 3 + α 4 + α 5 ) h 2 f i + ( - 2 α 1 - α 2 + α 4 + 2 α 5 ) h f (1) i + (2 α 1 + α 2 2 + α 4 2 + 2 α 5 ) f (2) i +( - 4 α 1 3 - α 2 6 + α 4 6 + 4 α 5 3 ) hf (3) i + ( 2 α 1 3 + α 2 24 + α 4 24 + 2 α 5 3 ) h 2 f (4) i + ( - 4 α 1 15 - α 2 120 + α 4 120 + 4 α 5 15 ) h 3 f (5) i +( 4 α 1 45 + α 2 720 + α 4 720 + 4 α 5 45 ) h 4 f (6) i We want f i (2) and 4 th order accuracy, so we note that the coeﬃcients must satisfy the following equalities: α 1 + α 2 + α 3 + α 4 + α 5 = 0 - 2 α 1 - α 2 + α 4 + 2 α 5 = 0 2 α 1 + α 2 2 + α 4 2 + 2 α 5 = 1 - 4 α 1 3 - α 2 6 + α 4 6 + 4 α 5 3 = 0 2 α 1 3 + α 2 24 + α 4 24 + 2 α 5 3 = 0 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
We can then write this system of equations in matrix form AX = B 1 1 1 1 1 - 2 - 1 0 1 2 2 0 . 5 0 0 . 5 2 - 1 . 33333 - 0 . 16667 0 0 . 16667 1 . 33333 0 . 66667 0 . 041667 0 0 . 041667 0 . 66667 α 1 α 2 α 3 α 4 α 5 = 0 0 1 0 0 Solving this equation in Matlab (see asgn5 prob1.m) yields α 1 = - 1 12 , α 2 = 4 3 , α 3 = - 5 2 , α 4 = 4 3 , and α 5 = - 1 12 . The equation for our fourth order accurate central approximation to the second derivative now be- comes = (0) f i + (0) f (1) i + (1) f (2) i + (0) f (3) i + (0) f (4) i + (0) f (5) i + ( - 1 90 ) f (6) i + O ( h 5 ) The fourth order accurate central approximation to the second derivative is as follows:
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

hmwk_5_2010_solutions - CE 30125 Computational Methods...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online