Class PartialDerivativesByCenteredDifferencing

  • All Implemented Interfaces:
    BicubicInterpolation.PartialDerivatives

    public class PartialDerivativesByCenteredDifferencing
    extends Object
    implements BicubicInterpolation.PartialDerivatives
    This implementation computes the partial derivatives by centered differencing. That is, \[ \frac{\partial z}{\partial x} = \frac{z_{i+1, j} - z_{i-1, j}}{x_{i+1} - x_{i-1}} \\ \frac{\partial z}{\partial y} = \frac{z_{i, j+1} - z_{i, j-1}}{y_{j+1} - y_{j-1}} \\ \frac{\partial^2 z}{\partial x \partial y} = \frac{z_{i+1,j+1}-z_{i+1,j-1}-z_{i-1,j+1}+z_{i-1,j-1}}{(x_{i+1}-x_{i-1})(y_{j+1}-y_{j-1})} \] At the points on the boundaries, one-sided differences are used.
    • Constructor Detail

      • PartialDerivativesByCenteredDifferencing

        public PartialDerivativesByCenteredDifferencing()
    • Method Detail

      • dx

        public double dx​(BivariateGrid grid,
                         int i,
                         int j)
        Description copied from interface: BicubicInterpolation.PartialDerivatives
        Get the partial derivative \(\frac{\partial z}{\partial x}\), at the given position in the grid.
        Specified by:
        dx in interface BicubicInterpolation.PartialDerivatives
        Parameters:
        grid - the grid for which to get the partial derivative
        i - the index along the x-axis
        j - the index along the y-axis
        Returns:
        \(\frac{\partial z}{\partial x}\) at the given point
      • dy

        public double dy​(BivariateGrid grid,
                         int i,
                         int j)
        Description copied from interface: BicubicInterpolation.PartialDerivatives
        Get the partial derivative \(\frac{\partial z}{\partial y}\), at the given position in the grid.
        Specified by:
        dy in interface BicubicInterpolation.PartialDerivatives
        Parameters:
        grid - the grid for which to get the partial derivative
        i - the index along the x-axis
        j - the index along the y-axis
        Returns:
        \(\frac{\partial z}{\partial y}\) at the given point
      • dxdy

        public double dxdy​(BivariateGrid grid,
                           int i,
                           int j)
        Description copied from interface: BicubicInterpolation.PartialDerivatives
        Get the cross derivative \(\frac{\partial^2 z}{\partial x \partial y}\), at the given position in the grid.
        Specified by:
        dxdy in interface BicubicInterpolation.PartialDerivatives
        Parameters:
        grid - the grid for which to get the partial derivative
        i - the index along the x-axis
        j - the index along the y-axis
        Returns:
        \(\frac{\partial^2 z}{\partial x \partial y}\) at the given point