ftsurf

ftsurf calculates an interpolatory surface passing through a rectangular grid of function values. The surface computed is a tensor product of splines under tension. ftsurf is in the Fitgrid package -- a package containing 1D and 2D interpolators using cubic splines under tension.


Synopsis

    function ftsurf(
        xi[*]    : float,
        yi[*]    : float,
        zi[*][*] : float,
        xo[*]    : float,
        yo[*]    : float
    )


Arguments

xi
A 1D array of arbitrary length (say mi) containing X coordinates for grid lines in the X direction.
yi
A 1D array of arbitrary length (say ni) containing Y coordinates for grid lines in the X direction.
zi
An array of size mi x ni which contains the functional values at the grid points defined by xi and yi.
xo
A 1D array specifying the X (say mo in number) coordinates for the output interpolation grid.
yo
A 1D array specifying the Y (say no in number) coordinates for the output interpolation grid.

Return value

ftsurf returns a 2D array of interpolated values defined on the specified output grid. ftsurf is of size mo x no , where mo is the size of xo and no is the size of yo.

ftsurf does not recognize missing values.


Description

There are some parameters that can alter the behavior of ftstep. These parameters all have reasonable default values. However, users may change any of these parameters by invoking ftsetp prior to calling ftsurf. ftsurf is called after all of the desired values for control parameters have been set.

Control parameters that apply to ftsurf are: sig, zx1, zxm, zy1, zyn, z11, zm1, z1n, zmn, df1, df2, df3, df4, df5, df6, df7, df8.

The value for the parameter sig specifies the tension factor. Values near zero result in a cubic spline; large values (e.g. 50) result in nearly a polygonal line. A typical value is 1. (the default).

zx1 is an array containing mi X-partial derivatives of the function along the line xi[0], that is zx1[j] is the X-partial derivative at point (x[0],y[j]) for j=0,ni-1. This parameter may be defaulted by setting the value for df1 appropriately. The default is to compute zx1 internally. Values for zx1 can be set using the procedure ftsetp.

zxm is an array containing n X-partial derivatives of the function along the line xi[mi-1], that is zxm[j] is the X-partial derivative at point (xi[mi-1],yi[j]) for j=0,ni-1. This parameter may be defaulted by setting the value for df2 appropriately. The default is to compute zx2 internally. Values for zxm can be set using the procedure ftsetp.

zy1 is an array containing m Y-partial derivatives of the function along the line yi[0], that is zy1[j] is the Y-partial derivative at point (x[i],y[0]) for i=0,mi-1. This parameter may be defaulted by setting the value for df3 appropriately. The default is to compute zy1 internally. Values for zy1 can be set using the procedure ftsetp.

zyn is an array containing m Y-partial derivatives of the function along the line yi[ni-1], that is zyn[j] is the Y-partial derivative at point (x[i],y[ni-1]) for i=0,mi-1. This parameter may be defaulted by setting the value for df4 appropriately. The default is to compute zyn internally. Values for zyn can be set using the procedure ftsetp.

z11, zm1, z1n, zmn specify X-Y-partial derivatives of the function at the four corners (xi[0],yi[0]), (xi[mi-1],yi[0]), (xi[0],yi[ni-1]), (xi[mi-1],yi[ni-1]), These parameters may be defaulted by setting the values for df5, df6, df7, df8, appropriately. The default is to compute z11, zm1, z1n, zmn internally.

You can extrapolate values with ftsurv (that is calculate interpolated values for coordinates outside of the scope of the input grid), but these values are, in general, unreliable.


Example

begin
  nxi = 11
  nyi = 17
  xi = fspan(0.,1.,nxi)
  yi = fspan(0.,1.,nyi)
  zi = new((/nxi,nyi/),float)
  do i=0,nxi-1
    do j=0,nyi-1
      zi(i,j) = 0.5 + 0.25*sin(-7.*xi(i)) + 0.25*cos(5.*yi(j))
    end do
  end do
  nxo = 31
  nyo = 21
  xo = fspan(0.,1.,nxo)
  yo = fspan(0.,1.,nyo)
  zo = ftsurf(xi,yi,zi,xo,yo)
end

Reference Manual Control Panel

NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?


$ $