Re: Re: Why the Interpolation function cannot make a serious of points be linked smoothly?

*To*: mathgroup at smc.vnet.net*Subject*: [mg28410] Re: [mg28374] Re: [mg28350] Why the Interpolation function cannot make a serious of points be linked smoothly?*From*: "Sherman Reed" <sherman.reed at worldnet.att.net>*Date*: Mon, 16 Apr 2001 03:29:06 -0400 (EDT)*References*: <200104120618.CAA03179@smc.vnet.net> <200104140528.BAA07462@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Earlier I had posted a reply that reduced the order of the Interpolation function. Today I show the use of the Spline function (<<Graphics`Spline`) right out of the Help Browser. Show[Graphics[{Hue[0], Line[data1], GrayLevel[0], Spline[data1, Cubic]}], PlotRange -> All] for both data1 and data2 (not shown). The advantage of the spline function is that the derivatives are controlled at the data points. The difference between the two sets of data appear to be very small. Sherman C. Reed sherman.reed at att.net ----- Original Message ----- From: "Sherman Reed" <sherman.reed at worldnet.att.net> To: mathgroup at smc.vnet.net Subject: [mg28410] [mg28374] Re: [mg28350] Why the Interpolation function cannot make a serious of points be linked smoothly? > In my view the data is basically linear. The default InterpolationOrder is > 3, which means a third order poly is used to connect the points. This is > overkill. Even a second order poly has some wild swings. I tried an > InterpolationOrder of 1, which did a better job. > > You might want to try using Fit for a linear curve. It appears to be pretty > good, but does not go through the data points. > > Sherman C. Reed > sherman.reed at att.net > ----- Original Message ----- > From: "liwen liwen" <gzgear at yahoo.com> To: mathgroup at smc.vnet.net > To: mathgroup at smc.vnet.net > Subject: [mg28410] [mg28374] [mg28350] Why the Interpolation function cannot make a serious of > points be linked smoothly? > > > > Dear friends; > > > > How are you! > > Interpolation function is able to make a serious of > > points to be linked smoothly, > > but now I find the following Interpolation function is > > not able to be linked > > smoothly, what is the matter? > > > > data1 = {{0, 0}, {1.3, 1}, {2, 3}, {2.3, 5}, {5.678, > > 7}, {7, 9}, {8, 12}, {12, > > 18}}; > > data2 = {{0, 0}, {1.3, 1}, {2, 3}, {2.7, 5}, {5.678, > > 7}, {7, 9}, {8, 12}, {12, > > 18}}; > > f1 = Interpolation[data1]; > > f2 = Interpolation[data2]; > > g1 = Plot[f1[x], {x, 0, 12}]; > > g2 = Plot[f2[x], {x, 0, 12}]; > > Show[g1, g2] > > > > the data2 can be linked smoothly, but data1 not. I > > just change the {2.7,5} to > > {2.3,5}. > > > > Thank you very much! > > > > E-mail: gzgear at yahoo.com > > > > __________________________________________________ > > Do You Yahoo!? > > Get email at your own domain with Yahoo! Mail. > > http://personal.mail.yahoo.com/ > > > > > > >

**References**:**Why the Interpolation function cannot make a serious of points be linked smoothly?***From:*liwen liwen <gzgear@yahoo.com>