主要内容

构建和使用PPFORM花键

构建PPFORM

一种分段多项式通常是常量ructed by some command, through a process of interpolation or approximation, or conversion from some other form e.g., from the B-form, and is output as a variable. But it is also possible to make one up from scratch, using the statement

pp = ppmak(断裂,COEFS)

例如,如果您输入pp = ppmak(-5:-1,-22:-11),或更明确的,

断裂= -5:-1;COEFS = -22:-11;pp = ppmak(断裂,coefs);

您指定制服休息sequence -5:-1系数序列 -22:-11。由于此断裂序列有5个条目,因此4个断点间隔,而系数序列有12个条目,因此您实际上已经指定了一个分段的顺序。3 (= 12/4). The command

FNBRK(PP)

打印出该分段多项式的所有组成部分,如下:

断裂(1:L+1)-5 -4 -3 -2 -1系数(D*L,K)-22 -21 -21 -20 -19 -18 -17 -17 -16 -15 -15 -14 -14 -13 -12 -12 -11块数量L 4 Order K 3尺寸D的目标1

更远,fnbrk可用于分别提供这些部分。但是,曲线拟合工具箱™样条功能的点是,您通常不必关心这些细节。您只是使用pp作为对评估,区分,集成,转换或绘制分段 - 多项式的命令的论点,其描述包含在pp

使用PPFORM花键

以下是您可以在分段多项式上执行操作的一些功能。

v = fnval(pp,x)

评估

dpp = fnder(pp)

区分

dirpp = fndir(pp,dir)

区分方向dir

ipp = fnint(pp)

集成

fnmin(pp,[a,b])

在给定间隔中找到最小值

fnzeros(pp,[a,b])

Finds the zeros in the given interval

pj = fnbrk(pp,j)

拉出j多项式零件

PC = FNBRK(PP,[A B])

Restricts/extends to the interval [一种。。b这是给予的

po = fnxtr(pp,order)

通过多项式的指定顺序扩展其基本间隔

fnplt(pp,[a,b])

给定间隔的图

sp = fn2fm(pp,'b-')

转换为B形式

pr = fnrfn(pp,more breaks)

插入其他休息

Inserting additional breaks comes in handy when you want to add two piecewise-polynomials with different breaks, as is done in the commandFNCMB

示例PPForm

执行以下命令以创建和绘制特定的分段 - 聚合(PPFORF)构建PPFORM部分。

  1. 使用断裂序列创建分段聚集-5:-1和系数序列-22:-11

    pp = ppmak(-5:-1,-22:-11)
  2. 创建基本图:

    x = linspace(-5.5, - 。5,101);绘图(x,fnval(pp,x),'x')
  3. 将断点线添加到图中:

    breaks = fnbrk(pp,'b');yy =轴;保留j = 1:fnbrk(pp,'l')+1个图(breaks([j j j]),yy(3:4))结束
  4. 叠加多项式的多项式图:提供第三个多项式片段:

    plot(x,fnval(fnbrk(pp,3),x),'linew',1.3) set(gca,'ylim',[-60 -10]), hold off

分段多项式功能,断裂和多项式提供第三件作品

上图是最终图片。它显示了分段多项式作为一系列点的序列,并在其顶部牢固地将其第三个多项式片段从中固定。值得注意的是,休息时分段多项式的价值是其限制, and that the分别在基本间隔之外的分段多项式的值是通过分别扩展其最左侧的最右边的多项式零件来获得的。

While the分段多项式的PPForm有效地评估,construction从某些数据中进行分段 - 多项式通常可以通过首先确定其更有效地处理B形, i.e., its representation as a linear combination of B-splines.

Related Topics