Class PartialDerivativesByCenteredDifferencing
- java.lang.Object
-
- dev.nm.analysis.curvefit.interpolation.bivariate.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 Summary
Constructors Constructor Description PartialDerivativesByCenteredDifferencing()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
dx(BivariateGrid grid, int i, int j)
Get the partial derivative \(\frac{\partial z}{\partial x}\), at the given position in the grid.double
dxdy(BivariateGrid grid, int i, int j)
Get the cross derivative \(\frac{\partial^2 z}{\partial x \partial y}\), at the given position in the grid.double
dy(BivariateGrid grid, int i, int j)
Get the partial derivative \(\frac{\partial z}{\partial y}\), at the given position in the grid.
-
-
-
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 interfaceBicubicInterpolation.PartialDerivatives
- Parameters:
grid
- the grid for which to get the partial derivativei
- the index along the x-axisj
- 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 interfaceBicubicInterpolation.PartialDerivatives
- Parameters:
grid
- the grid for which to get the partial derivativei
- the index along the x-axisj
- 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 interfaceBicubicInterpolation.PartialDerivatives
- Parameters:
grid
- the grid for which to get the partial derivativei
- the index along the x-axisj
- the index along the y-axis- Returns:
- \(\frac{\partial^2 z}{\partial x \partial y}\) at the given point
-
-