8 Piecewise Polynomial Interpolation

Size: px
Start display at page:

Download "8 Piecewise Polynomial Interpolation"

Transcription

1 Applied Math Notes by R. J. LeVeque 8 Piecewise Polynomial Interpolation 8. Pitfalls of high order interpolation Suppose we know the value of a function at several points on an interval and we wish to find an interpolating function that we can use to approximate the function at all other points in the interval. We know from the previous section that if we have N + function values then we can find a unique polynomial of degree N that interpolates these values. We might hope that by adding more points we will get a better approximation, but this is not always the case, even if the function is very smooth. Figure 8. shows a famous example, a variant of an example first used by Runge about years ago to demonstrate the difficulty. The function f(x) = + x (8.) is shown in Figure 8.(a) over the interval 6 x 6. Figures (b,c,d) show the interpolating polynomials we obtain if we interpolate at N + equally spaced points in the interval [, ] for N + = 8,, 6. The interpolating polynomial looks good near the center of the interval, but not near the edges. Adding more points and using a higher degree polynomial only makes the problem worse, and the error in polynomial interpolation goes to infinity near the ends of the interval as N. There are two approaches to deriving a better interpolating polynomial. One approach is to use points that are not equally spaced. With a clever set of points one can get good high order polynomial approximations for this particular function and for other smooth functions. However, often we do not have any control over the interpolation points. A table of values or set of data is given to use at some fixed set of points and we need to use this to interpolate to other points. Another approach is to use some other form of interpolating polynomial rather than a high degree polynomial. In this section we will consider one other possibility, piecewise polynomials obtained by stitching together low order polynomials over subintervals of the interval of interest. 8. Piecewise Linear Interpolation We have already discussed piecewise linear interpolation in the context of the matlab plot command. Take another look at Figure 4.(b) and (c), which show piecewise linear functions approximating f(x) = sin(x) + cos(x). Now let s look at the error made in approximating a general function f(x) over some interval of interest [a,b] by a piecewise linear function interploting f at some N + points in the interval. In particular consider the equally spaced points x i = a + (i )h, for i =,,..., N +, where h = (b a)/n is the distance between grid points. These are the points that would be generated in matlab by the commands 8

2 Runge function Interpolating polynomial of degree (a) Interpolating polynomial of degree (b) Interpolating polynomial of degree (c) (d) Figure 8.: (a) The Runge function (8.). The other figures show three interpolating polynomials through (b) 8, (c), and (d) 6 equally spaced points. xdata = linspace(a,b,n+); or xdata = a:h:b; for example. Denote the piecewise linear function by p h (x), f[x ] + f[x,x ](x x ) if x x x, f[x ] + f[x,x ](x x ) if x x x, p h (x) = f[x ] + f[x,x 4 ](x x ) if x x x 4, f[x N ] + f[x N,x N+ ](x x N ) if x N x x N+. (8.) Now suppose we approximate f( x) for some x [a,b] by p h ( x), which is just the value obtained by linearly interpolating between the two closest values of x i where the function values of f are known. If x happens to be one of the points x i then the error is zero. Otherwise, suppose x j < x < x j+ for some index j. Then from (7.) we know that f( x) p h ( x) = f (η)( x x j )( x x j+ ). 8

3 for some η satisfying x j η x j+ and hence Moreover, we know that f( x) p h ( x) max x j z x j+ f (z) ( x x j )(x j+ x). ( x x j )(x j+ x) 4 h since this quadratic function takes its maximum when x =.(x j + x j+ ). Often we do not try to find the maximum of f over each subinterval. Instead we assume we have some bound for how large f is over the full interval [a,b]. Then we know that anywhere on the interval [a,b] the error will be bounded by or f( x) p h ( x) h 8 max a z b f (z), (8.) f( x) p h ( x) h 8 f for any x [a,b], (8.4) where for any function g (such as f ) we define the infinity norm of g on [a,b] by g = max g(z). (8.) a z b This is also often called the max norm. We ll see later why it s called the infinity norm. Since (8.4) holds for every x in the interval [a,b], we can also conclude that f p h h 8 f. (8.6) Note that for a given function f(x) and a fixed interval [a,b], the value of f is some fixed number that doesn t change if we change our interpolating function. In particular, it doesn t change if we do piecewise linear interpolation with more points. So (8.6) tells us how the error in this type of interpolation behaves as we take more and more points in the interval (i.e., as we make h smaller). The error goes to zero like some constant times h. So, for example, if we decrease h from. to. (i.e., use times as many points on the interval) then we expect the error to go down by a factor of. Example 8.. Recall that Figure 4. shows plots of piecewise linear approximations to the function (4.), f(x) = sin(x) + cos(x) over the interval [,] using points (h.), points (h /), and points (h ). For this function we can compute f (x) = sin(x) cos(x) and so an upper bound is f 7 since sin(x) and cos(x) are both bounded by. So we have an error bound.7 for h =, f p h.7h =.7 for h = /,.7 for h =.. With points or even points we expect a sizable error, as is seen in the plots of Figure 4.. For points (h.), on the other hand, the error is so small that it cannot possibly be observed with the resolution of the printer used to produce Figure 4. and for all practical purposes we have plotted the true function f(x). 8

4 8. Big-oh notation We say that f p h = O(h ) as h (8.7) using the big-oh notation that is often used in error analysis of this type. More generally, if h is a discretization parameter and E(h) is the error in a computed value resulting from a given value of h, we say that if there is some constant C, independent of h, so that E(h) = O(h p ) as h (8.8) E(h) Ch p (8.9) for all h > that are sufficiently small. Another way to say this is that E(h) h p C (8.) for all h sufficiently small, i.e., that E(h)/h p is uniformly bounded above as h. Note again that for a fixed function f the value f is independent of h, and so piecewise linear interpolation gives a max-norm error that is O(h ) for any function f C on the interval in question. The constant factor multiplying the h will depend on the particular function. We say that piecewise linear approximation is second order accurate since the error goes to zero like h for any f that is suitably smooth. By contrast piecewise quadratic approximation (discussed in the next section) is third order accurate; we will see that the error is O(h ) for any f that is sufficiently smooth (f C in this case). This type of analysis gives us a way to compare two different numerical algorithms (e.g. piecewise linear and piecewise quadratic interpolation) in general terms rather than just for a specific function f. 8.4 Piecewise Quadratic Interpolation As we have just seen, one way to obtain a more accurate interpolant is to increase the number of points and continue to use piecewise linear approximation. But we often don t have this luxury, for example when we have only a few tabulated values of the function and must interpolate from these. Another way to increase the accuracy is to increase the order of the polynomial approximations. Instead of a piecewise linear approximation we might try a piecewise quadratic interpolant. Determining a quadratic interpolant requires pieces of data. Suppose again that we have N + points where function values f(x i ) are known, and suppose N + is odd. Then there are an even number of subintervals, and we can pair these up into subintervals of length h on which values of f are known: at each end and in the middle. Our first subinterval is now [x,x ] and we know f(x ), f(x ), and f(x ). From these we can compute a quadratic polynomial and this polynomial will be used to approximate f(x) over [x,x ]. Similarly, on [x,x ] we compute a quadratic interpolating the values f(x ), f(x 4 ), and f(x ), and so on. The procedure yields a function p h (x) that is piecewise quadratic, given by a different quadratic polynomial on each interval [x j,x j+ ] for j =,,..., N/. To evaluate p h (x) 8 4

5 at any point we first determine what subinterval the point lies in and evaluate the appropriate quadratic function at the point. Here s the core of a matlab function pwquadinterp.m that takes as input a set of data points (xdata,ydata) and a (typically larger) set of points xi where we want to evaluate p h (x) and returns an array yi with the interpolated values: function yi = pwquadinterp(xdata,ydata,xi) yi = zeros(size(xi)); % initialize N = length(xdata)-; i = ; for j=::n+ % determine polynomial on interval [xdata(j-), xdata(j)] x = xdata(j-); x = xdata(j-); x = xdata(j); f = ydata(j-); f = ydata(j-); f = ydata(j); % compute divided differences: f = (f-f) / (x-x); f = (f-f) / (x-x); f = (f-f) / (x-x); % set function values for any xi(i) that lie in this interval: while i<=length(xi) & xi(i)<=x yi(i) = f + f*(xi(i)-x) + f*(xi(i)-x)*(xi(i)-x); i = i+; end end This routine has been cut down to the basics; a longer version on the webpage includes checks on the data to make sure an odd number of data points are provided and that the xdata and xi values are in increasing order, for example. Figure 8.(a) shows a plot of a simple data set and the piecewise linear interpolant p h (x), while Figure 8.(b) shows the piecewise quadratic interpolant for this same data, plotted at points by the following commands: xdata = :; ydata = [ ]; xi = linspace(,,); yi = pwquadinterp(xdata,ydata,xi); plot(xi,yi); hold on; plot(xdata,ydata, o ); hold off This data was purposely taken to be not very smooth so it would be clear where the different quadratic functions are joined together, at the points x =,, 7, 9,,. These points are called the knots of the piecewise polynomial. If smoother data were used, for example function values of some smooth function that is fairly well resolved at the data points, then the piecewise quadratic curve would look smoother. If f is a C function then error analysis similar to what we did for the piecewise linear case shows that, on a set of data points distance h apart, the error can be bounded by f p h Ch = O(h ) as h. The constant C depends on the size of the third derivative of f over the interval. Piecewise quadratic interpolation is rarely used in practice (though it forms the basis for Simpson s rule for quadrature, which we will study later). 8

6 8 piecewise linear 8 piecewise quadratic (a) (b) cubic spline 8 shape preserving piecewise cubic (c) (d) Figure 8.: (a) Piecewise linear function through data points. (b) Piecewise quadratic function through the same data points, with knots at x = ::. The function is defined by a single quadratic function on each interval indicated by dashed lines. (d) Cubic spline function through the same data points. This function is C (twice continuously differentiable). (c) Shape-preserving piecewise cubic function through the same data points. This function is C (the function and its first derivative are continuous. The second derivative is discontinuous at the knots x = :4). 8 6

7 8. Piecewise cubic interpolation A very popular form of piecewise polynomial interpolation is to use cubic functions on subintervals. A cubic function is determined by four pieces of data. However, rather than using four function values, a more common approach is to define a cubic function p i (x) on each subinterval [x i,x i+ ] by requiring the four conditions p i (x i ) = y i, p i (x i) = σ i, p i (x i+ ) = y i+, p i (x i+) = σ i+, (8.) where y i and y i+ are the desired function values at the ends of the interval (e.g., the function values f(x i ) and f(x i+ ) from a function we are interpolating) and σ i and σ i+ are the slopes of the function p i we wish to impose at the ends of the interval. If we know the derivative of f(x) then we might naturally use σ i = f (x i ) and σ i+ = f (x i+ ), but we will also consider other choices of these slopes below. Why do we choose to specify to function values and two slopes in this way? The main reason is that the resulting piecewise cubic function will not only be continuous at the knots x i, since p,i (x i ) = p i (x i ) = y i, (8.) but also the derivative of the piecewise cubic function will be continuous, p,i (x i ) = p i(x i ) = σ i, (8.) since the same slope condition is imposed on both cubics that meet at x i. A piecewise cubic approximation of this form will thus look smoother than a piecewise quadratic approximation of the form discussed above. For the moment suppose we know the four data values on the right hand side of (8.). How would we determine p i (x)? There are various ways. For example we could write p i (x) = c + c x + c x + c x and evaluate this function and its derivative p i (x) = c + c x + c x at the two endpoints of the subinterval. Requiring that (8.) be satisfied would then give four equations in the four unknowns c, c, c, and c. An easier way is to again use a divided difference table and the Newton form. This requires some modification to incorporate the slope data. We compute the following table: x i f[x i ] x i f[x i ] f[x i,x i ] x i+ f[x i+ ] f[x i,x i+ ] f[x i,x i,x i+ ] x i+ f[x i+ ] f[x i+,x i+ ] f[x i,x i+,x i+ ] f[x i,x i,x i+,x i+ ] (8.4) Note that each point is repeated twice since we have two pieces of information. The divided differences are computed using the usual formula (7.6) with two exceptions: we use f[x i,x i ] = σ i and f[x i+,x i+ ] = σ i+. Note that these values are not defined properly by the usual formula f[x,x ] = (f(x ) f(x ))/(x x ) since this is /. However, in the limit as x x this approaches f (x ), so it makes sense to replace this first order divided difference by the derivative value in this case. 8 7

8 The other values in (8.4) are computed by (7.6), e.g., f[x i,x i,x i+ ] = f[x i,x i+ ] f[x i,x i ] x i+ x i = The interpolating polynomial also has the usual form, f(x i+ ) f(x i ) x i+ x i σ i. x i+ x i p i (x) = f[x i ] + f[x i,x i ](x x i ) + f[x i,x i,x i+ ](x x i ) + f[x i,x i,x i+,x i+ ](x x i ) (x x i+ ). (8.) This is sometimes called Hermite cubic interpolation. How do we choose the values σ i if we don t know the exact derivative f (x i )? One way is to base σ i on approximations to f (x i ) obtained using divided differences. Another very popular method is to use a cubic spline. With this method the values σ i are chosen by requiring that the resulting piecewise cubic function have continuous second derivatives at the knots as well as continuity of the function and first derivative. This gives a very smooth looking function. It turns out it is always possible to choose σ i values so that the second derivative is continuous, but doing so requires solving a linear system of equations for all the σ i values based on all the data. We will not investigate this method in more detail, but it is often used in practice and can be computed using the matlab function described in the next section. 8.6 Piecewise polynomials in matlab In matlab there is a function interp that interpolates data in dimension by piecewise polynomials. It can be called in the same manner as the function pwquadinterp defined above. It takes another argument, a string that specifies the method to use. The command y = interp(xdata,ydata,x, linear ); uses piecewise linear interpolation based on the data xdata, ydata and evaluates the resulting interpolating function at all points in x. The command y = interp(xdata,ydata,x, spline ); determines and evaluates the cubic spline. There is another option, y = interp(xdata,ydata,x, cubic ); which uses shape preserving cubic interpolation, which chooses the slopes σ i in a way that avoids introducing oscillations in the function that are not in the data. Figure 8.(c) and (d) show the two piecewise cubics for one set of data. There is another form of interp that may also be useful: p = interp(xdata,ydata, cubic, pp ); for example, determines the data needed to construct the cubic spline p and returns a data structure with all this information, but doesn t evaluate this function at any points. Once p has been computed, it can be evaluated anywhere desired using y = ppval(p, x); 8 8

9 piecewise linear cubic spline Figure 8.: (a) Piecewise linear function through data points on a spiral curve. (b) Cubic spline function through the same data points. 8.7 Parameterized curves So far we have always used the plot command to plot graphs of functions, but plot can be used to plot any curve in the plane. Often we want to plot a smooth curve but only know a few points on the curve and would like to interpolate between them. We can do this by viewing the points (x,y) on the curve as being functions of some parameter t, so the curve is defined by (x(t),y(t)). We can then view the given data points as being values of these functions at a few points, and interpolate in t to obtain values in between. Here s an example: tdata = linspace(,6*pi,); xdata = tdata.*cos(tdata); ydata = tdata.*sin(tdata); plot(xdata,ydata, ro ); % plot the points t = linspace (, 6*pi, ); x = interp(tdata,xdata,t, spline ); y = interp(tdata,ydata,t, spline ); hold on; plot(x,y) % plot the smooth curve axis([- - ]); daspect([ ]) This defines points on a spiral curve and then evaluates the cubic spline approximations to x(t) and y(t) at points to produce the smooth curve shown in Figure 8.(b). If we simply performed plot(xdata,ydata) we would instead get Figure 8.(a). 8 9

Mar. 20 Math 2335 sec 001 Spring 2014

Mar. 20 Math 2335 sec 001 Spring 2014 Mar. 20 Math 2335 sec 001 Spring 2014 Chebyshev Polynomials Definition: For an integer n 0 define the function ( ) T n (x) = cos n cos 1 (x), 1 x 1. It can be shown that T n is a polynomial of degree n.

More information

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331 Remark Reconsidering the motivating example, we observe that the derivatives are typically not given by the problem specification. However, they can be estimated in a pre-processing step. A good estimate

More information

Handout 4 - Interpolation Examples

Handout 4 - Interpolation Examples Handout 4 - Interpolation Examples Middle East Technical University Example 1: Obtaining the n th Degree Newton s Interpolating Polynomial Passing through (n+1) Data Points Obtain the 4 th degree Newton

More information

February 2017 (1/20) 2 Piecewise Polynomial Interpolation 2.2 (Natural) Cubic Splines. MA378/531 Numerical Analysis II ( NA2 )

February 2017 (1/20) 2 Piecewise Polynomial Interpolation 2.2 (Natural) Cubic Splines. MA378/531 Numerical Analysis II ( NA2 ) f f f f f (/2).9.8.7.6.5.4.3.2. S Knots.7.6.5.4.3.2. 5 5.2.8.6.4.2 S Knots.2 5 5.9.8.7.6.5.4.3.2..9.8.7.6.5.4.3.2. S Knots 5 5 S Knots 5 5 5 5.35.3.25.2.5..5 5 5.6.5.4.3.2. 5 5 4 x 3 3.5 3 2.5 2.5.5 5

More information

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010 Lecture 8, Ceng375 Numerical Computations at December 9, 2010 Computer Engineering Department Çankaya University 8.1 Contents 1 2 3 8.2 : These provide a more efficient way to construct an interpolating

More information

Evaluating the polynomial at a point

Evaluating the polynomial at a point Evaluating the polynomial at a point Recall that we have a data structure for each piecewise polynomial (linear, quadratic, cubic and cubic Hermite). We have a routine that sets evenly spaced interpolation

More information

CS 450 Numerical Analysis. Chapter 7: Interpolation

CS 450 Numerical Analysis. Chapter 7: Interpolation Lecture slides based on the textbook Scientific Computing: An Introductory Survey by Michael T. Heath, copyright c 2018 by the Society for Industrial and Applied Mathematics. http://www.siam.org/books/cl80

More information

Interpolation - 2D mapping Tutorial 1: triangulation

Interpolation - 2D mapping Tutorial 1: triangulation Tutorial 1: triangulation Measurements (Zk) at irregular points (xk, yk) Ex: CTD stations, mooring, etc... The known Data How to compute some values on the regular spaced grid points (+)? The unknown data

More information

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

Engineering Analysis ENG 3420 Fall Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00 Engineering Analysis ENG 3420 Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 11:00-12:00 1 Lecture 24 Attention: The last homework HW5 and the last project are due on Tuesday November

More information

Section 5.5 Piecewise Interpolation

Section 5.5 Piecewise Interpolation Section 5.5 Piecewise Interpolation Key terms Runge phenomena polynomial wiggle problem Piecewise polynomial interpolation We have considered polynomial interpolation to sets of distinct data like {( )

More information

Derivative. Bernstein polynomials: Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 313

Derivative. Bernstein polynomials: Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 313 Derivative Bernstein polynomials: 120202: ESM4A - Numerical Methods 313 Derivative Bézier curve (over [0,1]): with differences. being the first forward 120202: ESM4A - Numerical Methods 314 Derivative

More information

Numerical Integration

Numerical Integration Numerical Integration Numerical Integration is the process of computing the value of a definite integral, when the values of the integrand function, are given at some tabular points. As in the case of

More information

Piecewise polynomial interpolation

Piecewise polynomial interpolation Chapter 2 Piecewise polynomial interpolation In ection.6., and in Lab, we learned that it is not a good idea to interpolate unctions by a highorder polynomials at equally spaced points. However, it transpires

More information

APPM/MATH Problem Set 4 Solutions

APPM/MATH Problem Set 4 Solutions APPM/MATH 465 Problem Set 4 Solutions This assignment is due by 4pm on Wednesday, October 16th. You may either turn it in to me in class on Monday or in the box outside my office door (ECOT 35). Minimal

More information

Polynomials tend to oscillate (wiggle) a lot, even when our true function does not.

Polynomials tend to oscillate (wiggle) a lot, even when our true function does not. AMSC/CMSC 460 Computational Methods, Fall 2007 UNIT 2: Spline Approximations Dianne P O Leary c 2001, 2002, 2007 Piecewise polynomial interpolation Piecewise polynomial interpolation Read: Chapter 3 Skip:

More information

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes CSCI 420 Computer Graphics Lecture 8 Splines Jernej Barbic University of Southern California Hermite Splines Bezier Splines Catmull-Rom Splines Other Cubic Splines [Angel Ch 12.4-12.12] Roller coaster

More information

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines

EECS 556 Image Processing W 09. Interpolation. Interpolation techniques B splines EECS 556 Image Processing W 09 Interpolation Interpolation techniques B splines What is image processing? Image processing is the application of 2D signal processing methods to images Image representation

More information

An introduction to interpolation and splines

An introduction to interpolation and splines An introduction to interpolation and splines Kenneth H. Carpenter, EECE KSU November 22, 1999 revised November 20, 2001, April 24, 2002, April 14, 2004 1 Introduction Suppose one wishes to draw a curve

More information

Interpolation by Spline Functions

Interpolation by Spline Functions Interpolation by Spline Functions Com S 477/577 Sep 0 007 High-degree polynomials tend to have large oscillations which are not the characteristics of the original data. To yield smooth interpolating curves

More information

Interpolation. TANA09 Lecture 7. Error analysis for linear interpolation. Linear Interpolation. Suppose we have a table x x 1 x 2...

Interpolation. TANA09 Lecture 7. Error analysis for linear interpolation. Linear Interpolation. Suppose we have a table x x 1 x 2... TANA9 Lecture 7 Interpolation Suppose we have a table x x x... x n+ Interpolation Introduction. Polynomials. Error estimates. Runge s phenomena. Application - Equation solving. Spline functions and interpolation.

More information

Math 226A Homework 4 Due Monday, December 11th

Math 226A Homework 4 Due Monday, December 11th Math 226A Homework 4 Due Monday, December 11th 1. (a) Show that the polynomial 2 n (T n+1 (x) T n 1 (x)), is the unique monic polynomial of degree n + 1 with roots at the Chebyshev points x k = cos ( )

More information

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li. Fall 2014 CSCI 420: Computer Graphics 4.2 Splines Hao Li http://cs420.hao-li.com 1 Roller coaster Next programming assignment involves creating a 3D roller coaster animation We must model the 3D curve

More information

Chapter 19 Interpolation

Chapter 19 Interpolation 19.1 One-Dimensional Interpolation Chapter 19 Interpolation Empirical data obtained experimentally often times conforms to a fixed (deterministic) but unkown functional relationship. When estimates of

More information

Lecture 9: Introduction to Spline Curves

Lecture 9: Introduction to Spline Curves Lecture 9: Introduction to Spline Curves Splines are used in graphics to represent smooth curves and surfaces. They use a small set of control points (knots) and a function that generates a curve through

More information

Design considerations

Design considerations Curves Design considerations local control of shape design each segment independently smoothness and continuity ability to evaluate derivatives stability small change in input leads to small change in

More information

lecture 10: B-Splines

lecture 10: B-Splines 9 lecture : -Splines -Splines: a basis for splines Throughout our discussion of standard polynomial interpolation, we viewed P n as a linear space of dimension n +, and then expressed the unique interpolating

More information

The Bisection Method versus Newton s Method in Maple (Classic Version for Windows)

The Bisection Method versus Newton s Method in Maple (Classic Version for Windows) The Bisection Method versus (Classic Version for Windows) Author: Barbara Forrest Contact: baforres@uwaterloo.ca Copyrighted/NOT FOR RESALE version 1.1 Contents 1 Objectives for this Lab i 2 Approximate

More information

Here are some of the more basic curves that we ll need to know how to do as well as limits on the parameter if they are required.

Here are some of the more basic curves that we ll need to know how to do as well as limits on the parameter if they are required. 1 of 10 23/07/2016 05:15 Paul's Online Math Notes Calculus III (Notes) / Line Integrals / Line Integrals - Part I Problems] [Notes] [Practice Problems] [Assignment Calculus III - Notes Line Integrals Part

More information

LECTURE NOTES - SPLINE INTERPOLATION. 1. Introduction. Problems can arise when a single high-degree polynomial is fit to a large number

LECTURE NOTES - SPLINE INTERPOLATION. 1. Introduction. Problems can arise when a single high-degree polynomial is fit to a large number LECTURE NOTES - SPLINE INTERPOLATION DR MAZHAR IQBAL 1 Introduction Problems can arise when a single high-degree polynomial is fit to a large number of points High-degree polynomials would obviously pass

More information

8 Project # 2: Bézier curves

8 Project # 2: Bézier curves 8 Project # 2: Bézier curves Let s say that we are given two points, for example the points (1, 1) and (5, 4) shown in Figure 1. The objective of linear interpolation is to define a linear function that

More information

Natural Quartic Spline

Natural Quartic Spline Natural Quartic Spline Rafael E Banchs INTRODUCTION This report describes the natural quartic spline algorithm developed for the enhanced solution of the Time Harmonic Field Electric Logging problem As

More information

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation 1 ME 261: Numerical Analysis Lecture-12: Numerical Interpolation Md. Tanver Hossain Department of Mechanical Engineering, BUET http://tantusher.buet.ac.bd 2 Inverse Interpolation Problem : Given a table

More information

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10 Lecture 25: Bezier Subdivision And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10 1. Divide and Conquer If we are going to build useful

More information

Homework #6 Brief Solutions 2012

Homework #6 Brief Solutions 2012 Homework #6 Brief Solutions %page 95 problem 4 data=[-,;-,;,;4,] data = - - 4 xk=data(:,);yk=data(:,);s=csfit(xk,yk,-,) %Using the program to find the coefficients S =.456 -.456 -.. -.5.9 -.5484. -.58.87.

More information

4.2 and 4.6 filled in notes.notebook. December 08, Integration. Copyright Cengage Learning. All rights reserved.

4.2 and 4.6 filled in notes.notebook. December 08, Integration. Copyright Cengage Learning. All rights reserved. 4 Integration Copyright Cengage Learning. All rights reserved. 1 4.2 Area Copyright Cengage Learning. All rights reserved. 2 Objectives Use sigma notation to write and evaluate a sum. Understand the concept

More information

Numerical Methods with Matlab: Implementations and Applications. Gerald W. Recktenwald. Chapter 10 Interpolation

Numerical Methods with Matlab: Implementations and Applications. Gerald W. Recktenwald. Chapter 10 Interpolation Selected Solutions for Exercises in Numerical Methods with Matlab: Implementations and Applications Gerald W. Recktenwald Chapter 10 Interpolation The following pages contain solutions to selected end-of-chapter

More information

ES 240: Scientific and Engineering Computation. a function f(x) that can be written as a finite series of power functions like

ES 240: Scientific and Engineering Computation. a function f(x) that can be written as a finite series of power functions like Polynomial Deinition a unction () that can be written as a inite series o power unctions like n is a polynomial o order n n ( ) = A polynomial is represented by coeicient vector rom highest power. p=[3-5

More information

February 23 Math 2335 sec 51 Spring 2016

February 23 Math 2335 sec 51 Spring 2016 February 23 Math 2335 sec 51 Spring 2016 Section 4.1: Polynomial Interpolation Interpolation is the process of finding a curve or evaluating a function whose curve passes through a known set of points.

More information

Math 3 Coordinate Geometry Part 2 Graphing Solutions

Math 3 Coordinate Geometry Part 2 Graphing Solutions Math 3 Coordinate Geometry Part 2 Graphing Solutions 1 SOLVING SYSTEMS OF EQUATIONS GRAPHICALLY The solution of two linear equations is the point where the two lines intersect. For example, in the graph

More information

Social Science/Commerce Calculus I: Assignment #6 - Solutions Page 1/14

Social Science/Commerce Calculus I: Assignment #6 - Solutions Page 1/14 Social Science/Commerce Calculus I: Assignment #6 - Solutions Page 1/14 3 1. Let f (x) = -2x - 5x + 1. Use the rules of differentiation to compute: 2 The first derivative of f (x): -6x - 5 The second derivative

More information

Interpolation and Splines

Interpolation and Splines Interpolation and Splines Anna Gryboś October 23, 27 1 Problem setting Many of physical phenomenona are described by the functions that we don t know exactly. Often we can calculate or measure the values

More information

Asymptotic Error Analysis

Asymptotic Error Analysis Asymptotic Error Analysis Brian Wetton Mathematics Department, UBC www.math.ubc.ca/ wetton PIMS YRC, June 3, 2014 Outline Overview Some History Romberg Integration Cubic Splines - Periodic Case More History:

More information

Chapter 3. Numerical Differentiation, Interpolation, and Integration. Instructor: Dr. Ming Ye

Chapter 3. Numerical Differentiation, Interpolation, and Integration. Instructor: Dr. Ming Ye Chapter 3 Numerical Differentiation, Interpolation, and Integration Instructor: Dr. Ming Ye Measuring Flow in Natural Channels Mean-Section Method (1) Divide the stream into a number of rectangular elements

More information

Lecture IV Bézier Curves

Lecture IV Bézier Curves Lecture IV Bézier Curves Why Curves? Why Curves? Why Curves? Why Curves? Why Curves? Linear (flat) Curved Easier More pieces Looks ugly Complicated Fewer pieces Looks smooth What is a curve? Intuitively:

More information

Central issues in modelling

Central issues in modelling Central issues in modelling Construct families of curves, surfaces and volumes that can represent common objects usefully; are easy to interact with; interaction includes: manual modelling; fitting to

More information

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 13: Slide 2 Splines The word spline comes from the ship building trade

More information

Four equations are necessary to evaluate these coefficients. Eqn

Four equations are necessary to evaluate these coefficients. Eqn 1.2 Splines 11 A spline function is a piecewise defined function with certain smoothness conditions [Cheney]. A wide variety of functions is potentially possible; polynomial functions are almost exclusively

More information

Direction Fields; Euler s Method

Direction Fields; Euler s Method Direction Fields; Euler s Method It frequently happens that we cannot solve first order systems dy (, ) dx = f xy or corresponding initial value problems in terms of formulas. Remarkably, however, this

More information

Objectives. Materials

Objectives. Materials Activity 13 Objectives Understand what a slope field represents in terms of Create a slope field for a given differential equation Materials TI-84 Plus / TI-83 Plus Graph paper Introduction One of the

More information

. Tutorial Class V 3-10/10/2012 First Order Partial Derivatives;...

. Tutorial Class V 3-10/10/2012 First Order Partial Derivatives;... Tutorial Class V 3-10/10/2012 1 First Order Partial Derivatives; Tutorial Class V 3-10/10/2012 1 First Order Partial Derivatives; 2 Application of Gradient; Tutorial Class V 3-10/10/2012 1 First Order

More information

CCNY Math Review Chapter 2: Functions

CCNY Math Review Chapter 2: Functions CCN Math Review Chapter : Functions Section.1: Functions.1.1: How functions are used.1.: Methods for defining functions.1.3: The graph of a function.1.: Domain and range.1.5: Relations, functions, and

More information

99 International Journal of Engineering, Science and Mathematics

99 International Journal of Engineering, Science and Mathematics Journal Homepage: Applications of cubic splines in the numerical solution of polynomials Najmuddin Ahmad 1 and Khan Farah Deeba 2 Department of Mathematics Integral University Lucknow Abstract: In this

More information

Know it. Control points. B Spline surfaces. Implicit surfaces

Know it. Control points. B Spline surfaces. Implicit surfaces Know it 15 B Spline Cur 14 13 12 11 Parametric curves Catmull clark subdivision Parametric surfaces Interpolating curves 10 9 8 7 6 5 4 3 2 Control points B Spline surfaces Implicit surfaces Bezier surfaces

More information

Rational Bezier Surface

Rational Bezier Surface Rational Bezier Surface The perspective projection of a 4-dimensional polynomial Bezier surface, S w n ( u, v) B i n i 0 m j 0, u ( ) B j m, v ( ) P w ij ME525x NURBS Curve and Surface Modeling Page 97

More information

Parameterization of triangular meshes

Parameterization of triangular meshes Parameterization of triangular meshes Michael S. Floater November 10, 2009 Triangular meshes are often used to represent surfaces, at least initially, one reason being that meshes are relatively easy to

More information

Cubic Splines and Matlab

Cubic Splines and Matlab Cubic Splines and Matlab October 7, 2006 1 Introduction In this section, we introduce the concept of the cubic spline, and how they are implemented in Matlab. Of particular importance are the new Matlab

More information

Parameterization. Michael S. Floater. November 10, 2011

Parameterization. Michael S. Floater. November 10, 2011 Parameterization Michael S. Floater November 10, 2011 Triangular meshes are often used to represent surfaces, at least initially, one reason being that meshes are relatively easy to generate from point

More information

Numerical Methods in Physics Lecture 2 Interpolation

Numerical Methods in Physics Lecture 2 Interpolation Numerical Methods in Physics Pat Scott Department of Physics, Imperial College November 8, 2016 Slides available from http://astro.ic.ac.uk/pscott/ course-webpage-numerical-methods-201617 Outline The problem

More information

Lecture 2.2 Cubic Splines

Lecture 2.2 Cubic Splines Lecture. Cubic Splines Cubic Spline The equation for a single parametric cubic spline segment is given by 4 i t Bit t t t i (..) where t and t are the parameter values at the beginning and end of the segment.

More information

Lecture VIII. Global Approximation Methods: I

Lecture VIII. Global Approximation Methods: I Lecture VIII Global Approximation Methods: I Gianluca Violante New York University Quantitative Macroeconomics G. Violante, Global Methods p. 1 /29 Global function approximation Global methods: function

More information

Exploring Fractals through Geometry and Algebra. Kelly Deckelman Ben Eggleston Laura Mckenzie Patricia Parker-Davis Deanna Voss

Exploring Fractals through Geometry and Algebra. Kelly Deckelman Ben Eggleston Laura Mckenzie Patricia Parker-Davis Deanna Voss Exploring Fractals through Geometry and Algebra Kelly Deckelman Ben Eggleston Laura Mckenzie Patricia Parker-Davis Deanna Voss Learning Objective and skills practiced Students will: Learn the three criteria

More information

Beginning of Semester To Do List Math 1314

Beginning of Semester To Do List Math 1314 Beginning of Semester To Do List Math 1314 1. Sign up for a CASA account in CourseWare at http://www.casa.uh.edu. Read the "Departmental Policies for Math 13xx Face to Face Classes". You are responsible

More information

5.5 Newton s Approximation Method

5.5 Newton s Approximation Method 498CHAPTER 5. USING DERIVATIVES TO ANALYZE FUNCTIONS; FURTHER APPLICATIONS 4 3 y = x 4 3 f(x) = x cosx y = cosx 3 3 x = cosx x cosx = 0 Figure 5.: Figure showing the existence of a solution of x = cos

More information

Scientific Computing: Interpolation

Scientific Computing: Interpolation Scientific Computing: Interpolation Aleksandar Donev Courant Institute, NYU donev@courant.nyu.edu Course MATH-GA.243 or CSCI-GA.22, Fall 25 October 22nd, 25 A. Donev (Courant Institute) Lecture VIII /22/25

More information

Need for Parametric Equations

Need for Parametric Equations Curves and Surfaces Curves and Surfaces Need for Parametric Equations Affine Combinations Bernstein Polynomials Bezier Curves and Surfaces Continuity when joining curves B Spline Curves and Surfaces Need

More information

Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers

Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers In this section we present Lagrange s method for maximizing or minimizing a general function f(x, y, z) subject to a constraint (or side condition) of the form g(x, y, z) = k. Figure 1 shows this curve

More information

Linear Interpolating Splines

Linear Interpolating Splines Jim Lambers MAT 772 Fall Semester 2010-11 Lecture 17 Notes Tese notes correspond to Sections 112, 11, and 114 in te text Linear Interpolating Splines We ave seen tat ig-degree polynomial interpolation

More information

An interesting related problem is Buffon s Needle which was first proposed in the mid-1700 s.

An interesting related problem is Buffon s Needle which was first proposed in the mid-1700 s. Using Monte Carlo to Estimate π using Buffon s Needle Problem An interesting related problem is Buffon s Needle which was first proposed in the mid-1700 s. Here s the problem (in a simplified form). Suppose

More information

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

COMPUTER AIDED ENGINEERING DESIGN (BFF2612) COMPUTER AIDED ENGINEERING DESIGN (BFF2612) BASIC MATHEMATICAL CONCEPTS IN CAED by Dr. Mohd Nizar Mhd Razali Faculty of Manufacturing Engineering mnizar@ump.edu.my COORDINATE SYSTEM y+ y+ z+ z+ x+ RIGHT

More information

(Refer Slide Time: 00:02:24 min)

(Refer Slide Time: 00:02:24 min) CAD / CAM Prof. Dr. P. V. Madhusudhan Rao Department of Mechanical Engineering Indian Institute of Technology, Delhi Lecture No. # 9 Parametric Surfaces II So these days, we are discussing the subject

More information

MAT 003 Brian Killough s Instructor Notes Saint Leo University

MAT 003 Brian Killough s Instructor Notes Saint Leo University MAT 003 Brian Killough s Instructor Notes Saint Leo University Success in online courses requires self-motivation and discipline. It is anticipated that students will read the textbook and complete sample

More information

Section 18-1: Graphical Representation of Linear Equations and Functions

Section 18-1: Graphical Representation of Linear Equations and Functions Section 18-1: Graphical Representation of Linear Equations and Functions Prepare a table of solutions and locate the solutions on a coordinate system: f(x) = 2x 5 Learning Outcome 2 Write x + 3 = 5 as

More information

Spline Methods Draft. Tom Lyche and Knut Mørken

Spline Methods Draft. Tom Lyche and Knut Mørken Spline Methods Draft Tom Lyche and Knut Mørken 24th May 2002 2 Contents 1 Splines and B-splines an introduction 3 1.1 Convex combinations and convex hulls..................... 3 1.1.1 Stable computations...........................

More information

Euler s Methods (a family of Runge- Ku9a methods)

Euler s Methods (a family of Runge- Ku9a methods) Euler s Methods (a family of Runge- Ku9a methods) ODE IVP An Ordinary Differential Equation (ODE) is an equation that contains a function having one independent variable: The equation is coupled with an

More information

Parametric Surfaces and Surface Area

Parametric Surfaces and Surface Area Parametric Surfaces and Surface Area What to know: 1. Be able to parametrize standard surfaces, like the ones in the handout.. Be able to understand what a parametrized surface looks like (for this class,

More information

Functions. Copyright Cengage Learning. All rights reserved.

Functions. Copyright Cengage Learning. All rights reserved. Functions Copyright Cengage Learning. All rights reserved. 2.2 Graphs Of Functions Copyright Cengage Learning. All rights reserved. Objectives Graphing Functions by Plotting Points Graphing Functions with

More information

Partial Derivatives (Online)

Partial Derivatives (Online) 7in x 10in Felder c04_online.tex V3 - January 21, 2015 9:44 A.M. Page 1 CHAPTER 4 Partial Derivatives (Online) 4.7 Tangent Plane Approximations and Power Series It is often helpful to use a linear approximation

More information

Math Numerical Analysis

Math Numerical Analysis ... Math 541 - Numerical Analysis Interpolation and Polynomial Approximation Piecewise Polynomial Approximation; Joseph M. Mahaffy, jmahaffy@mail.sdsu.edu Department of Mathematics and Statistics Dynamical

More information

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes

Introduction to Programming for Engineers Spring Final Examination. May 10, Questions, 170 minutes Final Examination May 10, 2011 75 Questions, 170 minutes Notes: 1. Before you begin, please check that your exam has 28 pages (including this one). 2. Write your name and student ID number clearly on your

More information

Cubic Spline Questions

Cubic Spline Questions Cubic Spline Questions. Find natural cubic splines which interpolate the following dataset of, points:.0,.,.,.0, 7.0,.,.0,0.; estimate the value for. Solution: Step : Use the n- cubic spline equations

More information

Spline Methods Draft. Tom Lyche and Knut Mørken

Spline Methods Draft. Tom Lyche and Knut Mørken Spline Methods Draft Tom Lyche and Knut Mørken January 5, 2005 2 Contents 1 Splines and B-splines an Introduction 3 1.1 Convex combinations and convex hulls.................... 3 1.1.1 Stable computations...........................

More information

Computational Physics PHYS 420

Computational Physics PHYS 420 Computational Physics PHYS 420 Dr Richard H. Cyburt Assistant Professor of Physics My office: 402c in the Science Building My phone: (304) 384-6006 My email: rcyburt@concord.edu My webpage: www.concord.edu/rcyburt

More information

Positivity Preserving Interpolation of Positive Data by Rational Quadratic Trigonometric Spline

Positivity Preserving Interpolation of Positive Data by Rational Quadratic Trigonometric Spline IOSR Journal of Mathematics (IOSR-JM) e-issn: 2278-5728, p-issn:2319-765x. Volume 10, Issue 2 Ver. IV (Mar-Apr. 2014), PP 42-47 Positivity Preserving Interpolation of Positive Data by Rational Quadratic

More information

NURBS: Non-Uniform Rational B-Splines AUI Course Denbigh Starkey

NURBS: Non-Uniform Rational B-Splines AUI Course Denbigh Starkey NURBS: Non-Uniform Rational B-Splines AUI Course Denbigh Starkey 1. Background 2 2. Definitions 3 3. Using NURBS to define a circle 4 4. Homogeneous coordinates & control points at infinity 9 5. Constructing

More information

Intro to Modeling Modeling in 3D

Intro to Modeling Modeling in 3D Intro to Modeling Modeling in 3D Polygon sets can approximate more complex shapes as discretized surfaces 2 1 2 3 Curve surfaces in 3D Sphere, ellipsoids, etc Curved Surfaces Modeling in 3D ) ( 2 2 2 2

More information

True/False. MATH 1C: SAMPLE EXAM 1 c Jeffrey A. Anderson ANSWER KEY

True/False. MATH 1C: SAMPLE EXAM 1 c Jeffrey A. Anderson ANSWER KEY MATH 1C: SAMPLE EXAM 1 c Jeffrey A. Anderson ANSWER KEY True/False 10 points: points each) For the problems below, circle T if the answer is true and circle F is the answer is false. After you ve chosen

More information

DATA FITTING IN SCILAB

DATA FITTING IN SCILAB powered by DATA FITTING IN SCILAB In this tutorial the reader can learn about data fitting, interpolation and approximation in Scilab. Interpolation is very important in industrial applications for data

More information

2.2 Graphs Of Functions. Copyright Cengage Learning. All rights reserved.

2.2 Graphs Of Functions. Copyright Cengage Learning. All rights reserved. 2.2 Graphs Of Functions Copyright Cengage Learning. All rights reserved. Objectives Graphing Functions by Plotting Points Graphing Functions with a Graphing Calculator Graphing Piecewise Defined Functions

More information

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Fall 2018 Instructor: Dr. Sateesh Mane

Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 361 / 761 Fall 2018 Instructor: Dr. Sateesh Mane Queens College, CUNY, Department of Computer Science Numerical Methods CSCI 36 / 76 Fall 28 Instructor: Dr. Sateesh Mane c Sateesh R. Mane 28 6 Homework lecture 6: numerical integration If you write the

More information

Introduction to C++ Introduction to C++ Week 6 Dr Alex Martin 2013 Slide 1

Introduction to C++ Introduction to C++ Week 6 Dr Alex Martin 2013 Slide 1 Introduction to C++ Introduction to C++ Week 6 Dr Alex Martin 2013 Slide 1 Numerical Integration Methods The Trapezoidal Rule If one has an arbitrary function f(x) to be integrated over the region [a,b]

More information

Cubic Splines By Dave Slomer

Cubic Splines By Dave Slomer Cubic Splines By Dave Slomer [Note: Before starting any example or exercise below, press g on the home screen to Clear a-z.] Curve fitting, the process of finding a function that passes through (or near)

More information

In some applications it may be important that the extrema of the interpolating function are within the extrema of the given data.

In some applications it may be important that the extrema of the interpolating function are within the extrema of the given data. Shape-preserving piecewise poly. interpolation In some applications it may be important that the extrema of the interpolating function are within the extrema of the given data. For example: If you the

More information

Bezier Curves, B-Splines, NURBS

Bezier Curves, B-Splines, NURBS Bezier Curves, B-Splines, NURBS Example Application: Font Design and Display Curved objects are everywhere There is always need for: mathematical fidelity high precision artistic freedom and flexibility

More information

Quadratic Functions CHAPTER. 1.1 Lots and Projectiles Introduction to Quadratic Functions p. 31

Quadratic Functions CHAPTER. 1.1 Lots and Projectiles Introduction to Quadratic Functions p. 31 CHAPTER Quadratic Functions Arches are used to support the weight of walls and ceilings in buildings. Arches were first used in architecture by the Mesopotamians over 4000 years ago. Later, the Romans

More information

The Interpolating Polynomial

The Interpolating Polynomial Math 45 Linear Algebra David Arnold David-Arnold@Eureka.redwoods.cc.ca.us Abstract A polynomial that passes through a given set of data points is called an interpolating polynomial. In this exercise you

More information

Lecture 6: Interpolation

Lecture 6: Interpolation Lecture 6: Interpolation Fatih Guvenen January 10, 2016 Fatih Guvenen ( ) Lecture 6: Interpolation January 10, 2016 1 / 25 General Idea Suppose you are given a grid (x 1, x 2,..., x n ) and the function

More information

Math January, Non-rigid transformations. Parent function New function Scale factor

Math January, Non-rigid transformations. Parent function New function Scale factor Non-rigid transformations In non-rigid transformations, the shape of a function is modified, either stretched or shrunk. We will call the number which tells us how much it is changed the scale factor,

More information

Sung-Eui Yoon ( 윤성의 )

Sung-Eui Yoon ( 윤성의 ) CS480: Computer Graphics Curves and Surfaces Sung-Eui Yoon ( 윤성의 ) Course URL: http://jupiter.kaist.ac.kr/~sungeui/cg Today s Topics Surface representations Smooth curves Subdivision 2 Smooth Curves and

More information

Lecture 34: Curves defined by Parametric equations

Lecture 34: Curves defined by Parametric equations Curves defined by Parametric equations When the path of a particle moving in the plane is not the graph of a function, we cannot describe it using a formula that express y directly in terms of x, or x

More information

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside Blending Functions Blending functions are more convenient basis than monomial basis canonical form (monomial

More information