{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hmwk_4_2010_solutions_rev

# hmwk_4_2010_solutions_rev - CE 30125 Computational Methods...

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

CE 30125 Computational Methods: Assignment 4 KEY Provided courtesy of Jake T. Lussier November 1, 2010 Problem 1 For this problem we develop a Hermite interpolating polynomial which utilizes all the available data points and the corresponding functional and/or derivative values shown in Table 1. i x i f(x i ) f (1) (x i ) 0 1.5 119.6460 -31.7500 1 2.5 No data -76.0000 2 6.0 -74.6040 No data Table 1: Data points and the corresponding functional and/or derivative values. Given this tabulated data, we note that p = 1 and N + 1 = 3. Therefore, if we had complete data for these points, we would impose (1+1)(3) = 6 constraint equations to match the function and its derivative at three data points. However, since we are missing f(x 1 ) and f (1) (x 2 ), we have the four following constraint equations: g ( x 0 ) = f 0 g ( x 2 ) = f 2 g (1) ( x 0 ) = f (1) 0 g (1) ( x 1 ) = f (1) 1 Therefore we require a 3rd degree polynomial. g ( x ) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 g (1) ( x ) = a 1 + 2 · a 2 x + 3 · a 3 x 2 Application of constraints: g (1 . 5) = f 0 = 119 . 6460 = a 0 + 1 . 5 · a 1 + 2 . 25 · a 2 + 3 . 375 · a 3 g (6 . 0) = f 2 = ⇒ - 74 . 6040 = a 0 + 6 . 0 · a 1 + 36 . 0 · a 2 + 216 . 0 · a 3 g (1) (1 . 5) = f (1) 0 = ⇒ - 31 . 7500 = a 1 + 3 . 0 · a 2 + 6 . 75 · a 3 g (1) (2 . 5) = f (1) 1 = ⇒ - 76 . 0000 = a 1 + 5 . 0 · a 2 + 18 . 75 · a 3 Constraint equations may be written in matrix form AX = B. 1 1 . 5 2 . 25 3 . 375 1 6 . 0 36 . 0 216 . 0 0 1 3 . 0 6 . 75 0 1 5 . 0 18 . 75 a 0 a 1 a 2 a 3 = 119 . 6460 - 74 . 6040 - 31 . 7500 - 76 . 0000 1

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

View Full Document
Calculating inv(A) * B in Matlab to solve for X yields the following solution: a 0 = 73 . 4168 a 1 = 108 . 0799 a 2 = - 61 . 3009 a 3 = 6 . 5293 So our final Hermite interpolating polynomial is g ( x ) = 73 . 4168 + 108 . 0799 · x + - 61 . 3009 · x 2 + 6 . 5293 · x 3 2
Problem 2 For this problem, we have the functional values and first derivatives (shown below) for three points (h, 2h, and 3h). f ( h ) = f 0 f (1) ( h ) = f (1) 0 f (2 h ) = f 1 f (1) (2 h ) = f (1) 1 f (3 h ) = f 2 f (1) (3 h ) = f (1) 2 With this data, we first note that p = 1 and N + 1 = 3. We therefore require (1+1)(3) = 6 constraint equations to match the function and its derivative at three data points. This simply means that our interpolation function g(x) must equal f(x) and f (1) (x) at the points above. More specifically, we have the following constraints: g ( h ) = f 0 g (1) ( h ) = f (1) 0 g (2 h ) = f 1 g (1) (2 h ) = f (1) 1 g (3 h ) = f 2 g (1) (3 h ) = f (1) 2 6 constraints requires a 5th degree polynomial of the following form: g ( x ) = a 0 + a 1 x + a 2 x 2 + a 3 x 3 + a 4 x 4 + a 5 x 5 g (1) ( x ) = a 1 + 2 · a 2 x + 3 · a 3 x 2 + 4 · a 4 x 3 + 5 · a 5 x 4 Application of the constraints: g ( h ) = f 0 = f 0 = a 0 + a 1 h + a 2 h 2 + a 3 h 3 + a 4 h 4 + a 5 h 5 g (1) ( h ) = f (1) 0 = f (1) 0 = a 1 + 2 ·

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

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

{[ snackBarMessage ]}

### Page1 / 8

hmwk_4_2010_solutions_rev - CE 30125 Computational Methods...

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

View Full Document
Ask a homework question - tutors are online