资源预览内容
第1页 / 共17页
第2页 / 共17页
第3页 / 共17页
第4页 / 共17页
第5页 / 共17页
第6页 / 共17页
第7页 / 共17页
第8页 / 共17页
第9页 / 共17页
第10页 / 共17页
亲,该文档总共17页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
2013 届数学与应用数学专业毕业设计(论文)英文文献翻译第 1 页 共 25 页ChapterChapter 3 3InterpolationInterpolationInterpolation is the process of defining a function that takes on specified values at specified points. This chapter concentrates on two closely related interpolants, the piecewise cubic spline and the shape-preserving piecewise cubic named “pchip”.3.1 The Interpolating PolynomialWe all know that two points determine a straight line. More precisely, any two points in the plane, and, with , determine a ),(11yx),(11yx)(21xx unique first degree polynomial in whose graph passes through the two xpoints. There are many different formulas for the polynomial, but they all lead to the same straight line graph.This generalizes to more than two points. Given points in nthe plane, ,, with distinct s, there is a unique ),(kkyxnk, 2 , 1kxpolynomial in of degree less than whose graph passes through the points. xnIt is easiest to remember that , the number of data points, is also the number nof coefficients, although some of the leading coefficients might be zero, so the degree might actually be less than . Again, there are many different 1nformulas for the polynomial, but they all define the same function.This polynomial is called the interpolating polynomial because it exactly 胡鹤:MATLAB 数值计算 (美)Cleve B.Moler 第三章插值第 1 节插值多项式第 2 页 共 13 页re- produces the given data.,nkyxPkk, 2 , 1,)(Later, we examine other polynomials, of lower degree, that only approximate the data. They are not interpolating polynomials.The most compact representation of the interpolating polynomial is the La- grange form. kk kjjkjyxxxxxP)(There are terms in the sum and terms in each product, so this expression n1ndefines a polynomial of degree at most . Ifis evaluated at , all 1n)(xPkxx the products except the th are zero. Furthermore, the th product is equal to kkone, so the sum is equal to and the interpolation conditions are satisfied.kyFor example, consider the following data set:x=0:3;y=-5 -6 -1 16;The commanddisp(x;y)2013 届数学与应用数学专业毕业设计(论文)英文文献翻译第 3 页 共 25 页displays0123-5 -6 -1 16The Lagrangian form of the polynomial interpolating this data is)16()6()2)(1() 1()2()3)(1()6()2()3)(2()5()6()3)(2)(1()(xxxxxxxxxxxxxPWe can see that each term is of degree three, so the entire sum has degree at most three. Because the leading term does not vanish, the degree is actually three. Moreover, if we plug in or 3, three of the terms vanish and the 2 , 1 , 0xfourth produces the corresponding value from the data set.Polynomials are usually not represented in their Lagrangian form. More fre- quently, they are written as something like523 xxThe simple powers of x are called monomials and this form of a polynomial is said to be using the power form.The coefficients of an interpolating polynomial using its power form,nnnncxcxcxcxP 12 21 1)(can, in principle, be computed by solving a system of simultaneous linear equations胡鹤:MATLAB 数值计算 (美)Cleve B.Moler 第三章插值第 1 节插值多项式第 4 页 共 13 页nnnn nn nnnnnyyycccxxxxxxxxx21212122 21 212 11 11111The matrix of this linear system is known as a Vandermonde matrix. VIts elements arejn kjkxv,The columns of a Vandermonde matrix are sometimes written in the opposite order, but polynomial coefficient vectors in Matlab always have the highest power first.The Matlab function vander generates Vandermonde matrices. For our ex- ample data set,V = vander(x)generatesV =00011111842127 931Thenc = Vy2013 届数学与应用数学专业毕业设计(论文)英文文献翻译第 5 页 共 25 页computes the coefficientsc =1.00000.0000-2.0000-5.0000In fact, the example data was generated from the polynomial .523 xxOne of the exercises asks you to show that Vandermonde matrices are nonsin- gular if the points are distinct. But another one of the exercises kxasks you to show that a Vandermonde matrix can be very badly conditioned. Consequently, using the power form and the Vandermonde matrix is a satisfactory technique for problems involving a few well-spaced and well-scaled data points. But as a general-purpose approach, it is dangerous.In this chapter, we describe several Matlab functions that implement various interpolation algorithms. All of them have the calling sequencev = interp(x,y,u)The first two input arguments, and , are vectors of the same length that xydefine the interpolating points. The third input argument, , is a vector of u胡鹤:MATLAB 数值计算 (美)Cleve B.Moler 第三章插值第 1 节插值多项式第 6 页 共 13 页points where the function is to be evaluated. The output, v, is the same length as u and has elements )(,()(kuyxterpinkvOur first such interpolation function, polyinterp, is based on the Lagrange form. The code uses Matlab array operations to evaluate the polynomial at all the components of u simultaneously.function v = polyinterp(x,y,u)n = length(x);v = zeros(size(u);for k = 1:nw = ones(size(u);for j = 1:k-1 k+1:nw = (u-x(j)./(x(k)-x(j).*w;enden
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号