Student[NumericalAnalysis] - Maple Programming Help

Home : Support : Online Help : Education : Student Packages : Numerical Analysis : Computation : Student/NumericalAnalysis/Function

Student[NumericalAnalysis]

 Function
 return the exact function from an interpolation structure

 Calling Sequence Function(p)

Parameters

 p - a POLYINTERP structure

Description

 • The Function command returns the exact function from a POLYINTERP structure.
 • If the Function command is used on a POLYINTERP structure whose exact function was not originally specified, an exception will be raised.
 • The POLYINTERP structure is created using the PolynomialInterpolation command or the CubicSpline command.

Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{NumericalAnalysis}\right]\right):$
 > $\mathrm{xy}≔\left[\left[0,4.0\right],\left[0.5,0\right],\left[1.0,-2.0\right],\left[1.5,0\right],\left[2.0,1.0\right],\left[2.5,0\right],\left[3.0,-0.5\right]\right]$
 ${\mathrm{xy}}{≔}\left[\left[{0}{,}{4.0}\right]{,}\left[{0.5}{,}{0}\right]{,}\left[{1.0}{,}{-2.0}\right]{,}\left[{1.5}{,}{0}\right]{,}\left[{2.0}{,}{1.0}\right]{,}\left[{2.5}{,}{0}\right]{,}\left[{3.0}{,}{-0.5}\right]\right]$ (1)

Note that the function option allows you to specify the exact function, which is then saved in the generated POLYINTERP structure.

 > $\mathrm{p1}≔\mathrm{PolynomialInterpolation}\left(\mathrm{xy},\mathrm{function}={2}^{2-x}\mathrm{cos}\left(\mathrm{\pi }x\right),\mathrm{method}=\mathrm{lagrange},\mathrm{extrapolate}=\left[0.25,0.75,1.25\right],\mathrm{errorboundvar}='\mathrm{\xi }'\right):$

The Function command allows you to retrieve the exact function that was stored in the POLYINTERP structure.

 > $\mathrm{Function}\left(\mathrm{p1}\right)$
 ${{2}}^{{2}{-}{x}}{}{\mathrm{cos}}{}\left({\mathrm{\pi }}{}{x}\right)$ (2)
 > $\mathrm{plot}\left(\mathrm{Function}\left(\mathrm{p1}\right),x=0..3\right)$