Processing math: 100%

Basis Spline (bspline) Object

 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=xy.

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:

  • object_name.x
  • object_name.y
  • object_name.z

The x and y are the independent parameters and the z is the dependent variable that is the result of the b-spline evaluation.

The second method is to feed in the raw data and let APMonitor or GEKKO generate the knots and coefficients.

See also C-Spline Object for 1D function approximations from data

Streaming Chatbot
💬