# 15 - 15 Curve Fitting with splines 15 Objectives Understand...

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

15: Curve Fitting with splines 15: Curve Fitting with splines

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

View Full Document
Nov 6, 2006 20:16 2 Objectives Understand that splines perform curve fitting while minimizing oscillations. Recognize that cubic polynomials are preferable to quadratic and to higher- order splines. Understand the conditions underlying a cubic spline fit. Understand the differences between natural, clumped, and not-a-knot end conditions. Fit a spline to data using MATLAB's built-in functions.
Nov 6, 2006 20:16 3 Introduction For n data points, an ( n -1)th-order polynomial can be fit This may result in erroneous interpolation due to round-off error and oscillations. Instead, lower-order polynomials ( spline functions ) are used on subsets of data. Example: third-order curves curves connecting each pair of data points are called cubic splines.

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

View Full Document
Nov 6, 2006 20:16 4 Why splines? Consider the step function on the right In Figures (a) through (c), n data points are obtained and an ( n -1)th-order polynomial is fit The greater the number of data points, the more oscillations we observe In Figure (d), linear splines are used to connect the data points; a closer fit is obtained Thus, splines usually provide a better approximation of the behaviour of functions with discontinuities
Nov 6, 2006 20:16 5 Linear splines For n data points, there are n -1 intervals Each interval i has its own spline function, s i ( x ) For linear splines, s i ( x ) is a straight line with This is equivalent to using Newton's first-order polynomial to interpolate within each interval s i x  = a i b i x x i a i = f i b i = f i 1 f i x i 1 x i x 1 x 2 x i x i+1 x n-1 x n f i f i+1 s i (x)

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

View Full Document
6 Linear splines – Example Consider the following data points Using linear splines, we have We can interpolate for the value of f at x=5 as follows i 1 3.0 2.5 2 4.5 1.0 3 7.0 2.5 4 9.0 0.5 x i f i s 1 x  = 2.5 1.0 2.5 4.5 3.0 x 3.0 s 2 x  = 1.0 2.5 1.0 7.0 4.5 x 4.5 s 3 x  = 2.5 0.5 2.5 9.0 7.0 x
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 11/13/2011 for the course CIVE 2*** taught by Professor - during the Spring '11 term at Carleton CA.

### Page1 / 21

15 - 15 Curve Fitting with splines 15 Objectives Understand...

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

View Full Document
Ask a homework question - tutors are online