Grids, interpolation, and calculus

Find Numeric contracts for grids, interpolation, and numerical calculus, including array shapes, units, and options.

Numerical computing, models, statistics, and Datasets with Python

Sampled data

Align each Y column with the X axis and check that X is increasing. Choose interpolation within the domain or one of the available extrapolation policies. A spline retains its data and knots for evaluation and integration. The numerical integral of Y with respect to X has units Y·X, while the derivative has units Y/X. Use a straight line with a known slope as a simple check.

Operation reference

Jump to an operation

uniform_grid

Access
Registered in the Python Job
Arguments
minimum, maximum, count or step, optional mode
Units
Units follow NUMERIC_API_v1 operation contract
Result
grid and actual spacing metadata
Effect
Build a uniform numeric grid
Types
scalar
Declared shape
scalar_parameters
Options
mode=count,step
Nonfinite values
caller_owned
Units rule
caller_owned
Catalog token
uniform_grid
gxtxt_api_call("NUMERIC_API_v1", "uniform_grid", args)
Recorded result · uniform_grid

Download the example script (ZIP).

Example operands, preview

[
  0.0,
  5.0,
  6,
  {
    "mode": "count"
  }
]

Result, preview

{
  "x": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  "n": 6.0,
  "step": 1.0,
  "start": 0.0,
  "stop_requested": 5.0,
  "stop_actual": 5.0,
  "mode": "count"
}
Contract query · expression-name:uniform_grid

Download the example script (ZIP).

Example operands, preview

[
  "uniform_grid"
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/operationByExpressionName: math.numeric API v1: unknown or ambiguous expression operation 'uniform_grid'"

interpolate

Access
Registered in the Python Job
Arguments
[{“name”: “X”, “kind”: “numeric array or options”, “required”: true}, {“name”: “Y”, “kind”: “numeric array or options”, “required”: true}, {“name”: “query”, “kind”: “numeric array or options”, “required”: true}, {“name”: “options”, “kind”: “numeric array or options”, “required”: false}]
Result
xq/yq with kernel and extrapolation receipt
Effect
Interpolate a series on explicit target coordinates
Types
vector
Declared shape
same_length_xy
Options
method=nearest,linear,cubic,spline,pchip;extrapolation=error,nan,constant,linear
Nonfinite values
error,omit
Units rule
preserve_y
Expression function
interpolate
gxtxt_api_call("NUMERIC_API_v1", "interpolate", args)
Recorded result · interpolate

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      5.0,
      7.0,
      9.0,
      11.0
    ]
  },
  {
    "shape": [
      3
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  }
]

Result, preview

{
  "xq": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  },
  "yq": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      4.0,
      6.0,
      8.0
    ]
  },
  "method": "linear",
  "extrapolation": "error",
  "n_source": 6.0,
  "n_query": 3.0,
  "kernel": "octave.interp1"
}

resample

Access
Registered in the Python Job
Arguments
x y targetX {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Effect
Resample a series on explicit target coordinates
Types
vector
Declared shape
same_length_xy
Options
method=nearest,linear,cubic,spline,pchip;extrapolation=error,nan,constant,linear
Nonfinite values
error,omit
Units rule
preserve_y
Expression function
resample
gxtxt_api_call("NUMERIC_API_v1", "resample", args)
Recorded result · resample

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      5.0,
      7.0,
      9.0,
      11.0
    ]
  },
  {
    "shape": [
      3
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  }
]

Result, preview

{
  "x": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  },
  "y": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      4.0,
      6.0,
      8.0
    ]
  },
  "method": "linear",
  "extrapolation": "error",
  "n_source": 6.0,
  "n_output": 3.0,
  "grid_kind": "explicit"
}

resampleUniform

Access
Registered in the Python Job
Arguments
x y step {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric resampleUniform
gxtxt_api_call("NUMERIC_API_v1", "resampleUniform", args)
Recorded result · resampleUniform

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      5.0,
      7.0,
      9.0,
      11.0
    ]
  },
  0.5
]

Result, preview

{
  "x": {
    "shape": [
      11,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.5,
      1.0,
      1.5,
      2.0,
      2.5,
      3.0,
      3.5,
      4.0,
      4.5,
      5.0
    ]
  },
  "y": {
    "shape": [
      11,
      1
    ],
    "dtype": "float64",
    "values": [
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  },
  "step": 0.5,
  "start": 0.0,
  "stop_requested": 5.0,
  "stop_actual": 5.0,
  "n_source": 6.0,
  "n_output": 11.0,
  "method": "linear",
  "extrapolation": "error",
  "grid_kind": "uniform"
}

splineCreate

Access
Registered in the Python Job
Arguments
x y {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric splineCreate
gxtxt_api_call("NUMERIC_API_v1", "splineCreate", args)
Recorded result · splineCreate

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      5.0,
      7.0,
      9.0,
      11.0
    ]
  }
]

Result, preview

{
  "model_type": "piecewise_polynomial",
  "method": "spline",
  "breaks": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  "coefficients": {
    "shape": [
      5,
      4
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      2.0,
      2.0
    ]
  },
  "pieces": 5.0,
  "order": 4.0,
  "dimension": 1.0,
  "x_min": 0.0,
  "x_max": 5.0
}

splineEvaluate

Access
Registered in the Python Job
Arguments
model xq {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric splineEvaluate
gxtxt_api_call("NUMERIC_API_v1", "splineEvaluate", args)
Recorded result · splineEvaluate

Download the example script (ZIP).

Example operands, preview

[
  {
    "model_type": "piecewise_polynomial",
    "method": "spline",
    "breaks": {
      "shape": [
        6,
        1
      ],
      "dtype": "float64",
      "values": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    },
    "coefficients": {
      "shape": [
        5,
        4
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        2.0,
        2.0
      ]
    },
    "pieces": 5.0,
    "order": 4.0,
    "dimension": 1.0,
    "x_min": 0.0,
    "x_max": 5.0
  },
  {
    "shape": [
      3
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  }
]

Result, preview

{
  "xq": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  },
  "values": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      4.0,
      6.0,
      8.0
    ]
  },
  "derivative_order": 0.0,
  "method": "spline",
  "extrapolation": "error"
}

splineIntegral

Access
Registered in the Python Job
Arguments
model a b {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric splineIntegral
gxtxt_api_call("NUMERIC_API_v1", "splineIntegral", args)
Recorded result · splineIntegral

Download the example script (ZIP).

Example operands, preview

[
  {
    "model_type": "piecewise_polynomial",
    "method": "spline",
    "breaks": {
      "shape": [
        6,
        1
      ],
      "dtype": "float64",
      "values": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    },
    "coefficients": {
      "shape": [
        5,
        4
      ],
      "dtype": "float64",
      "values": [
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        0.0,
        2.0,
        2.0
      ]
    },
    "pieces": 5.0,
    "order": 4.0,
    "dimension": 1.0,
    "x_min": 0.0,
    "x_max": 5.0
  },
  1.0,
  3.0
]

Result, preview

{
  "value": 10.0,
  "a": 1.0,
  "b": 3.0,
  "method": "analytic_piecewise_polynomial"
}

integrate

Access
Registered in the Python Job
Arguments
x y {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Effect
Integrate a sampled series
Types
vector
Declared shape
same_length_xy
Options
nonfinite=error,omit
Nonfinite values
error,omit
Units rule
multiply
Expression function
integrate
gxtxt_api_call("NUMERIC_API_v1", "integrate", args)
Recorded result · integrate

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      5.0,
      7.0,
      9.0,
      11.0
    ]
  }
]

Result, preview

{
  "value": 30.0,
  "n": 6.0,
  "x_min": 0.0,
  "x_max": 5.0,
  "method": "trapezoidal",
  "kernel": "octave.trapz"
}

cumulativeIntegrate

Access
Registered in the Python Job
Arguments
x y {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric cumulativeIntegrate
gxtxt_api_call("NUMERIC_API_v1", "cumulativeIntegrate", args)
Recorded result · cumulativeIntegrate

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      5.0,
      7.0,
      9.0,
      11.0
    ]
  }
]

Result, preview

{
  "x": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  "integral": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      2.0,
      6.0,
      12.0,
      20.0,
      30.0
    ]
  },
  "n": 6.0,
  "method": "cumulative_trapezoidal"
}

differentiate

Access
Registered in the Python Job
Arguments
x y {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Effect
Differentiate a sampled series
Types
vector
Declared shape
same_length_xy
Options
nonfinite=error,omit
Nonfinite values
error,omit
Units rule
differentiate
Expression function
differentiate
gxtxt_api_call("NUMERIC_API_v1", "differentiate", args)
Recorded result · differentiate

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      5.0,
      7.0,
      9.0,
      11.0
    ]
  }
]

Result, preview

{
  "x": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  "dy_dx": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      2.0,
      2.0,
      2.0,
      2.0,
      2.0,
      2.0
    ]
  },
  "n": 6.0,
  "method": "centered_secant_with_endpoint_secants",
  "kernel": "octave.gradient"
}

gridInfo

Access
Registered in the Python Job
Arguments
x {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric gridInfo
gxtxt_api_call("NUMERIC_API_v1", "gridInfo", args)
Recorded result · gridInfo

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  }
]

Result, preview

{
  "n": 6.0,
  "uniform": true,
  "step": 1.0,
  "step_mean": 1.0,
  "step_median": 1.0,
  "step_min": 1.0,
  "step_max": 1.0,
  "step_std": 0.0,
  "direction": "increasing",
  "monotonic": true,
  "strict_monotonic": true,
  "duplicate_count": 0.0,
  "max_step_deviation": 0.0,
  "relative_max_step_deviation": 0.0,
  "rtol": 1e-09,
  "atol": 0.0
}

validateMonotonic

Access
Registered in the Python Job
Arguments
x {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric validateMonotonic
gxtxt_api_call("NUMERIC_API_v1", "validateMonotonic", args)
Recorded result · validateMonotonic

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  }
]

Result, preview

{
  "n": 6.0,
  "monotonic": true,
  "strict_monotonic": true,
  "direction": "increasing",
  "duplicate_count": 0.0
}

uniformGrid

Access
Registered in the Python Job
Arguments
start stop spacing {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric uniformGrid
gxtxt_api_call("NUMERIC_API_v1", "uniformGrid", args)
Recorded result · uniformGrid

Download the example script (ZIP).

Example operands, preview

[
  0.0,
  5.0,
  1.0
]

Result, preview

{
  "x": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  "n": 6.0,
  "step": 1.0,
  "start": 0.0,
  "stop_requested": 5.0,
  "stop_actual": 5.0,
  "mode": "step"
}

commonRange

Access
Registered in the Python Job
Arguments
x1 x2 {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric commonRange
gxtxt_api_call("NUMERIC_API_v1", "commonRange", args)
Recorded result · commonRange

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      6
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  {
    "shape": [
      3
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  }
]

Result, preview

{
  "overlap": true,
  "min": 1.5,
  "max": 3.5,
  "width": 2.0,
  "x1_min": 0.0,
  "x1_max": 5.0,
  "x2_min": 1.5,
  "x2_max": 3.5
}

cumulativeSum

Access
Registered in the Python Job
Arguments
values {options {}}
Units
Exact original owner units and interpretation; no relabelling
Result
Complete original result with number/boolean/string/vector/matrix/tensor/struct/cell types from owner resultTypes immediately after call
Function
Exact original Numeric cumulativeSum
gxtxt_api_call("NUMERIC_API_v1", "cumulativeSum", args)
Recorded result · cumulativeSum

Download the example script (ZIP).

Example operands, preview

[
  {
    "shape": [
      4
    ],
    "dtype": "float64",
    "values": [
      1.0,
      2.0,
      3.0,
      4.0
    ]
  }
]

Result, preview

{
  "values": {
    "shape": [
      4,
      1
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      6.0,
      10.0
    ]
  },
  "total": 10.0,
  "n": 4.0,
  "method": "cumulative_sum"
}

resample_uniform

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
x,y,step
Shape
same_length_xy
Units
preserve_y
Result
generated_vector
Effect
Resample a series on a uniform grid
Types
vector,vector,scalar
Declared shape
same_length_xy
Options
method=nearest,linear,cubic,spline,pchip
Nonfinite values
error,omit
Units rule
preserve_y
Expression function
resample_uniform
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["resample_uniform", operands])
Recorded result · call:resample_uniform

Download the example script (ZIP).

Example operands, preview

[
  "resample_uniform",
  [
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    },
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        1.0,
        3.0,
        5.0,
        7.0,
        9.0,
        11.0
      ]
    },
    {
      "kind": "array",
      "shape": [
        1,
        1
      ],
      "real": [
        0.5
      ]
    }
  ]
]

Result, preview

{
  "x": {
    "shape": [
      11,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.5,
      1.0,
      1.5,
      2.0,
      2.5,
      3.0,
      3.5,
      4.0,
      4.5,
      5.0
    ]
  },
  "y": {
    "shape": [
      11,
      1
    ],
    "dtype": "float64",
    "values": [
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  },
  "step": 0.5,
  "start": 0.0,
  "stop_requested": 5.0,
  "stop_actual": 5.0,
  "n_source": 6.0,
  "n_output": 11.0,
  "method": "linear",
  "extrapolation": "error",
  "grid_kind": "uniform"
}

spline_create

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
x,y
Shape
same_length_xy
Units
caller_owned
Result
model
Effect
Build a piecewise-polynomial model
Types
vector
Declared shape
same_length_xy
Options
method=spline,pchip
Nonfinite values
error,omit
Units rule
caller_owned
Catalog token
spline_create
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["spline_create", operands])
Recorded result · call:spline_create

Download the example script (ZIP).

Example operands, preview

[
  "spline_create",
  [
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    },
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        1.0,
        3.0,
        5.0,
        7.0,
        9.0,
        11.0
      ]
    }
  ]
]

Result, preview

{
  "model_type": "piecewise_polynomial",
  "method": "spline",
  "breaks": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  "coefficients": {
    "shape": [
      5,
      4
    ],
    "dtype": "float64",
    "values": [
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      2.0,
      2.0
    ]
  },
  "pieces": 5.0,
  "order": 4.0,
  "dimension": 1.0,
  "x_min": 0.0,
  "x_max": 5.0
}
Contract query · expression-name:spline_create

Download the example script (ZIP).

Example operands, preview

[
  "spline_create"
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/operationByExpressionName: math.numeric API v1: unknown or ambiguous expression operation 'spline_create'"

spline_evaluate

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
model,target_x
Shape
model_evaluation
Units
caller_owned
Result
target_vector
Effect
Evaluate a spline model
Types
model,vector
Declared shape
model_evaluation
Options
derivative_order=0..12
Nonfinite values
caller_owned
Units rule
caller_owned
Catalog token
spline_evaluate
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["spline_evaluate", operands])
Recorded result · call:spline_evaluate

Download the example script (ZIP).

Example operands, preview

[
  "spline_evaluate",
  [
    {
      "kind": "struct",
      "fields": {
        "model_type": {
          "kind": "text",
          "value": "piecewise_polynomial"
        },
        "method": {
          "kind": "text",
          "value": "spline"
        },
        "breaks": {
          "kind": "array",
          "shape": [
            6,
            1
          ],
          "real": [
            0.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0
          ]
        },
        "coefficients": {
          "kind": "array",
          "shape": [
            5,
            4
          ],
          "real": [
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            2.0,
            2.0
          ]
        },
        "pieces": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            5.0
          ]
        },
        "order": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            4.0
          ]
        },
        "dimension": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            1.0
          ]
        },
        "x_min": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            0.0
          ]
        },
        "x_max": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            5.0
          ]
        }
      }
    },
    {
      "kind": "array",
      "shape": [
        3,
        1
      ],
      "real": [
        1.5,
        2.5,
        3.5
      ]
    }
  ]
]

Result, preview

{
  "xq": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      1.5,
      2.5,
      3.5
    ]
  },
  "values": {
    "shape": [
      3,
      1
    ],
    "dtype": "float64",
    "values": [
      4.0,
      6.0,
      8.0
    ]
  },
  "derivative_order": 0.0,
  "method": "spline",
  "extrapolation": "error"
}
Contract query · expression-name:spline_evaluate

Download the example script (ZIP).

Example operands, preview

[
  "spline_evaluate"
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/operationByExpressionName: math.numeric API v1: unknown or ambiguous expression operation 'spline_evaluate'"

spline_integral

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
model,lower,upper
Shape
scalar
Units
multiply
Result
scalar
Effect
Integrate a spline model
Types
model,scalar,scalar
Declared shape
scalar
Nonfinite values
caller_owned
Units rule
multiply
Catalog token
spline_integral
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["spline_integral", operands])
Recorded result · call:spline_integral

Download the example script (ZIP).

Example operands, preview

[
  "spline_integral",
  [
    {
      "kind": "struct",
      "fields": {
        "model_type": {
          "kind": "text",
          "value": "piecewise_polynomial"
        },
        "method": {
          "kind": "text",
          "value": "spline"
        },
        "breaks": {
          "kind": "array",
          "shape": [
            6,
            1
          ],
          "real": [
            0.0,
            1.0,
            2.0,
            3.0,
            4.0,
            5.0
          ]
        },
        "coefficients": {
          "kind": "array",
          "shape": [
            5,
            4
          ],
          "real": [
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            0.0,
            2.0,
            2.0
          ]
        },
        "pieces": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            5.0
          ]
        },
        "order": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            4.0
          ]
        },
        "dimension": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            1.0
          ]
        },
        "x_min": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            0.0
          ]
        },
        "x_max": {
          "kind": "array",
          "shape": [
            1,
            1
          ],
          "real": [
            5.0
          ]
        }
      }
    },
    {
      "kind": "array",
      "shape": [
        1,
        1
      ],
      "real": [
        1.0
      ]
    },
    {
      "kind": "array",
      "shape": [
        1,
        1
      ],
      "real": [
        3.0
      ]
    }
  ]
]

Result, preview

{
  "value": 10.0,
  "a": 1.0,
  "b": 3.0,
  "method": "analytic_piecewise_polynomial"
}
Contract query · expression-name:spline_integral

Download the example script (ZIP).

Example operands, preview

[
  "spline_integral"
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/operationByExpressionName: math.numeric API v1: unknown or ambiguous expression operation 'spline_integral'"

cumulative_integrate

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
x,y
Shape
same_length_xy
Units
multiply
Result
vector
Effect
Cumulative integral of a sampled series
Types
vector
Declared shape
same_length_xy
Options
nonfinite=error,omit
Nonfinite values
error,omit
Units rule
multiply
Expression function
cumulative_integral
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["cumulative_integrate", operands])
Recorded result · call:cumulative_integrate

Download the example script (ZIP).

Example operands, preview

[
  "cumulative_integrate",
  [
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    },
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        1.0,
        3.0,
        5.0,
        7.0,
        9.0,
        11.0
      ]
    }
  ]
]

Result, preview

{
  "x": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0
    ]
  },
  "integral": {
    "shape": [
      6,
      1
    ],
    "dtype": "float64",
    "values": [
      0.0,
      2.0,
      6.0,
      12.0,
      20.0,
      30.0
    ]
  },
  "n": 6.0,
  "method": "cumulative_trapezoidal"
}

grid_info

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
x
Shape
vector
Units
caller_owned
Result
scalar
Effect
Inspect a numeric coordinate grid
Types
vector
Declared shape
vector
Options
rtol=number;atol=number
Nonfinite values
error,omit
Units rule
caller_owned
Catalog token
grid_info
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["grid_info", operands])
Recorded result · call:grid_info

Download the example script (ZIP).

Example operands, preview

[
  "grid_info",
  [
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    }
  ]
]

Result, preview

{
  "n": 6.0,
  "uniform": true,
  "step": 1.0,
  "step_mean": 1.0,
  "step_median": 1.0,
  "step_min": 1.0,
  "step_max": 1.0,
  "step_std": 0.0,
  "direction": "increasing",
  "monotonic": true,
  "strict_monotonic": true,
  "duplicate_count": 0.0,
  "max_step_deviation": 0.0,
  "relative_max_step_deviation": 0.0,
  "rtol": 1e-09,
  "atol": 0.0
}
Contract query · expression-name:grid_info

Download the example script (ZIP).

Example operands, preview

[
  "grid_info"
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/operationByExpressionName: math.numeric API v1: unknown or ambiguous expression operation 'grid_info'"

validate_monotonic

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
x
Shape
vector
Units
caller_owned
Result
scalar
Effect
Inspect a numeric coordinate grid
Types
vector
Declared shape
vector
Options
rtol=number;atol=number
Nonfinite values
error,omit
Units rule
caller_owned
Catalog token
validate_monotonic
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["validate_monotonic", operands])
Recorded result · call:validate_monotonic

Download the example script (ZIP).

Example operands, preview

[
  "validate_monotonic",
  [
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    }
  ]
]

Result, preview

{
  "n": 6.0,
  "monotonic": true,
  "strict_monotonic": true,
  "direction": "increasing",
  "duplicate_count": 0.0
}
Contract query · expression-name:validate_monotonic

Download the example script (ZIP).

Example operands, preview

[
  "validate_monotonic"
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/operationByExpressionName: math.numeric API v1: unknown or ambiguous expression operation 'validate_monotonic'"

common_range

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
x1,x2
Shape
two_vectors
Units
compatible
Result
scalar
Effect
Find the overlapping numeric range
Types
vector
Declared shape
two_vectors
Nonfinite values
error,omit
Units rule
compatible
Catalog token
common_range
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["common_range", operands])
Recorded result · call:common_range

Download the example script (ZIP).

Example operands, preview

[
  "common_range",
  [
    {
      "kind": "array",
      "shape": [
        6,
        1
      ],
      "real": [
        0.0,
        1.0,
        2.0,
        3.0,
        4.0,
        5.0
      ]
    },
    {
      "kind": "array",
      "shape": [
        3,
        1
      ],
      "real": [
        1.5,
        2.5,
        3.5
      ]
    }
  ]
]

Result, preview

{
  "overlap": true,
  "min": 1.5,
  "max": 3.5,
  "width": 2.0,
  "x1_min": 0.0,
  "x1_max": 5.0,
  "x2_min": 1.5,
  "x2_max": 3.5
}
Contract query · expression-name:common_range

Download the example script (ZIP).

Example operands, preview

[
  "common_range"
]

Result, preview

"GXTXT:ScriptBridge:RemoteError: NUMERIC_API_v1/operationByExpressionName: math.numeric API v1: unknown or ambiguous expression operation 'common_range'"

cumulative_sum

Access
Listed in the service catalog. Check the selector and whether the call matches or is rejected.
Arguments
values
Shape
vector
Units
preserve
Result
vector
Effect
Cumulative numeric sum
Types
vector
Declared shape
vector
Options
nonfinite=error,omit
Nonfinite values
error,omit
Units rule
preserve
Expression function
cumulative_sum
gxtxt_api_call("NUMERIC_API_v1", "callOperation", ["cumulative_sum", operands])
Recorded result · call:cumulative_sum

Download the example script (ZIP).

Example operands, preview

[
  "cumulative_sum",
  [
    {
      "kind": "array",
      "shape": [
        4,
        1
      ],
      "real": [
        1.0,
        2.0,
        3.0,
        4.0
      ]
    }
  ]
]

Result, preview

{
  "values": {
    "shape": [
      4,
      1
    ],
    "dtype": "float64",
    "values": [
      1.0,
      3.0,
      6.0,
      10.0
    ]
  },
  "total": 10.0,
  "n": 4.0,
  "method": "cumulative_sum"
}