Type: Object Data: Input (x,y) vectors and output matrix (z) Inputs: b-spline data or knots / coefficients Outputs: b-spline appoximation z Description: Basis spline for 2D nonlinear approximation
A basis spline is a nonlinear function constructed of flexible bands that pass through control points to create a smooth curve. The b-spline has continuous first and second derivatives everywhere. The prediction area should be constrained to avoid extrapolation error.
Example Usage
Create a b-spline from the a meshgrid of 50 points in the x-direction and y-direction between -1 and 1 of the function `z=x y`.
When creating a bspline object, there are two ways to define the bspline. The first is to define the knots and coefficients directly. Three variables are created as part of the object including:
The x and y are the independent parameters and the z is the dependent variable that is the result of the b-spline evaluation.
Three files are required including for an APMonitor implementation including:
The knots and coefficients can be generated from packages such as Python or MATLAB.
The second method is to feed in the raw data and let APMonitor or GEKKO generate the knots and coefficients.
Three files are required for the APMonitor implementation including:
See also C-Spline Object for 1D function approximations from data