{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Lecture24 - Engineering Analysis ENG 3420 Fall 2009 Dan C...

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

1 Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00

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

View Full Document
2 Lecture 24 Lecture 24 ± Attention: The last homework HW5 and the last project are due on Tuesday November 24!! ± Last time: ² Lagrange interpolating polynomials ² Splines ± Today ² Cubic splines ² Searching and sorting ² Numerical integration (chapter 17) ± Next Time ² Numerical integration
3 Cubic splines ± Cubic splines Æ the simplest representation with the appearance of smoothness and without the problems of higher order polynomials. ² Linear splines have discontinuous first derivatives ² Quadratic splines have discontinuous second derivatives and require setting the second derivative at some point to a pre-determined value ² Quartic or higher-order splines tend to exhibit ill-conditioning or oscillations. ± The cubic spline function for the i th interval can be written as: ± For n data points, there are ( n -1) intervals and thus 4( n -1) unknowns to evaluate to solve all the spline function coefficients. s i x () = a i + b i x x i ( ) + c i x x i ( ) 2 + d i x x i ( ) 3

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

View Full Document
4 Conditions to determine the spline coefficients ± The first condition Æ the spline function goes through the first and last point of the interval ; this leads to 2(n-1) equations: ± The second condition Æ the first derivative should be continuous at each interior point ; this leads to (n-2) equations: ± The third condition Æ the second derivative should be continuous at each interior point ; this leads to (n-2) equations: ± So far we have (4n-6) equations; we need (4n-4) equations! s i x i () = f i a i = f i s i x i + 1 = f i s i x i + 1 = a i + b i x i + 1 x i + c i x i + 1 x i 2 + d i x i + 1 x i 3 = f i s i ' x i + 1 = s i + 1 ' x i + 1 b i + 2 c i x i + 1 x i ( ) + 3 d i x i + 1 x i ( ) 2 = b i + 1 s i '' x i + 1 = s i + 1 '' x i + 1 2 c i + 6 d i x i + 1 x i ( ) = 2 c i + 1
5 Two additional equations ± There are several options for the final two equations: ² Natural end conditions Æ the second derivative at the end knots are zero. ² Clamped end conditions Æ the first derivatives at the first and last knots are known. ² “Not-a-knot” end conditions Æ force continuity of the third derivative at the second and penultimate points (results in the first two intervals having the same spline function and the last two intervals having the same spline function)

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

View Full Document
6 Built-in functions for piecewise interpolation ± MATLAB has several built-in functions to implement piecewise interpolation. ± spline Æ yy=spline(x, y, xx) ² Performs cubic spline interpolation, generally using not-a-knot conditions. ² If y contains two more values than x has entries, then the first and last value in y are used as the derivatives at the end points (i.e. clamped) ± Example: ² Generate data: x = linspace(-1, 1, 9); y = 1./(1+25*x.^2); ² Calculate 100 model points and determine not-a-knot interpolation xx = linspace(-1, 1); yy = spline(x, y, xx); ² Calculate actual function values at model points and data points, the 9-point not-a-knot interpolation (solid), and the actual function (dashed), yr = 1./(1+25*xx.^2) plot(x, y, ‘o’, xx, yy, ‘-’, xx, yr, ‘--’)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 31

Lecture24 - Engineering Analysis ENG 3420 Fall 2009 Dan C...

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

View Full Document
Ask a homework question - tutors are online