正在加载图片...
85 Cubic Spline Lab ll Cubic Spline Construct the cubic spline interpolant S for the function f, defined at points o <x <.<xn, satisfying some given boundary conditions. Partition an given interval into m equal-length subintervals, and approximate the function values at the endpoints of these subintervals. np There are several sets of inputs. For each set: The 1st line contains an integer 202n20 which is the number of interpolating points-1. n=-1 signals the end of file. The 2nd line contains n+l distinct real numbers xo, x1,.,xn The 3rd line contains n+l real numbers f(ro),f(x),., f(n) The 4 th line contains an integer Type and three real numbers so, Sn,, and fmax. If Type=l, the clamped boundary condition is given: S(x)=s, and s(x)=s If Type=2, the natural boundary condition is given: S"(xo)=s, and S"(x,)=s No other values of Type will be given. Fmar is the default value that s(x)will assume ifx is out of the range xo, x, The last line of a test case consists of two real numbers to and tm, and an integer m> 1. Here the interval [to, t is partitioned into m equal-lengh subintervals, [to, t, Itm-1,tmI. The numbers are separated by spaces and new lines.§5 Cubic Spline Lab 11. Cubic Spline Construct the cubic spline interpolant S for the function f, defined at points , satisfying some given boundary conditions. Partition an given interval into m equal-length subintervals, and approximate the function values at the endpoints of these subintervals. Input There are several sets of inputs. For each set: The 1st line contains an integer 20  n  0 which is the number of interpolating points  1. n = 1 signals the end of file. The 2 nd line contains n+1 distinct real numbers . The 3 rd line contains n+1 real numbers . The 4th line contains an integer Type and three real numbers s0 , sn , and Fmax. If Type = 1, the clamped boundary condition is given: and . If Type = 2, the natural boundary condition is given: and . No other values of Type will be given. Fmax is the default value that S (x) will assume if x is out of the range [x0 , xn ]. The last line of a test case consists of two real numbers t0 and tm, and an integer m  1. Here the interval is partitioned into m equal-lengh subintervals, … . The numbers are separated by spaces and new lines. n x , x , ... , x 0 1 ( ), ( ), ... , ( ) 0 1 n f x f x f x n x  x  ...  x 0 1 0 0 S(x )  s n n S(x )  s 0 0 S(x )  s n n S(x )  s [ , ] 0 m t t [ , ] 0 1 t t [ , ] m 1 m t t 
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有