::tclinterp::interpolation

Commands

cubicSpline1d

Does piecewise cubic spline interpolation.

cubicSpline1d -t|x list -y list -ti|xi list ?-ibcbeg|begflag value -ybcbeg value? ?-ibcend|endflag value -ybcend value? ?-deriv?

Parameters

-deriv:

Select the alternative output option.

-ibcbeg value:

Left boundary condition flag, -begflag is an alias. Possible values: quad, the cubic spline should be a quadratic over the first interval; der1, the first derivative at the left endpoint should be YBCBEG; der2, the second derivative at the left endpoint should be YBCBEG; notaknot, not-a-knot, the third derivative is continuous at T(2).

-ibcend value:

Right boundary condition flag, -endflag is an alias. Possible values: quad, the cubic spline should be a quadratic over the last interval; der1, the first derivative at the right endpoint should be YBCBEG; der2, the second derivative at the right endpoint should be YBCBEG; notaknot, not-a-knot, the third derivative is continuous at T(2).

-t list:

List of independent variable (t) values, -x is an alias.

-ti list:

List of independent variable interpolation (ti) values, -xi is an alias.

-y list:

List of dependent variable (y) values.

-ybcbeg value:

The values to be used in the boundary conditions if ibcbeg is equal to der1 or der2, default is 0.0.

-ybcend value:

The values to be used in the boundary conditions if ibcend is equal to der1 or der2, default is 0.0.

Return value

list of interpolated dependent variable values under. If -deriv switch is in args, the output is dictionary that contains yi values under yi key, yi derivative under yder1 key, and yi second derivative under yder2 key.

divDif1d

Does divided difference one-dimensional interpolation.

divDif1d -x list -y list -xi list ?-coeffs?

Parameters

-coeffs:

Selects the alternative output option.

-x list:

List of independent variable (x) values.

-xi list:

List of independent variable interpolation (xi) values.

-y list:

List of dependent variable (y) values.

Return value

list of interpolated dependent variable values, yi, at xi. If -coeffs switch is in args, the output is dictionary that contains yi values under yi key, and the values of difference table under the key coeffs.

hermiteSpline1d

Does Hermite polynomial spline interpolation.

hermiteSpline1d -t|x list -y list -yp list -ti|xi list ?-deriv?

Parameters

-deriv:

Select the alternative output option.

-t list:

List of independent variable (t) values, must be strictly increasing, -x is an alias.

-ti list:

List of independent variable interpolation (ti) values, -xi is an alias.

-y list:

List of dependent variable (y) values.

-yp list:

List of dependent variable (y) derivative values.

Return value

list of interpolated dependent variable values. If -deriv switch is in args, the output is dictionary that contains yi values under yi key, yi derivative under yder1 key.

lagr1d

Does Lagrange polynomial one-dimensional interpolation.

lagr1d -x list -y list -xi list

Parameters

-x list:

List of independent variable (x) values.

-xi list:

List of independent variable interpolation (xi) values.

-y list:

List of dependent variable (y) values.

Return value

list of interpolated dependent variable values, yi, at xi

least1d

Does least squares polynomial one-dimensional interpolation.

least1d -x list -y list -xi list ?-w list? ?-nterms value? ?-coeffs?

Parameters

-coeffs:

Selects the alternative output option.

-nterms value:

Number of terms of interpolation polynom, default is 3.

-w list:

List of weights, optional.

-x list:

List of independent variable (x) values.

-xi list:

List of independent variable interpolation (xi) values.

-y list:

List of dependent variable (y) values.

Return value

list of interpolated dependent variable values, yi, at xi. If -coeffs switch is in args, the output is dictionary that contains yi values under yi key, and the values of interpolation polynom coefficients under the keys b, c and d.

least1dDer

Does least squares polynomial one-dimensional interpolation with calculation of its derivative.

least1dDer -x list -y list -xi list ?-w list? ?-nterms value? ?-coeffs?

Parameters

-coeffs:

Selects the alternative output option.

-nterms value:

Number of terms of interpolation polynom, default is 3.

-w list:

List of weights, optional.

-x list:

List of independent variable (x) values.

-xi list:

List of independent variable interpolation (xi) values.

-y list:

List of dependent variable (y) values.

Return value

dict of interpolated dependent variable values and its derivatives under yi and yiDer keys. If -coeffs switch is in args, the output is dictionary that contains yi values under yi key, yi derivatives under yiDer key, and the values of interpolation polynom coefficients under the keys b, c and d.

lin1d

Does linear one-dimensional interpolation.

lin1d -x list -y list -xi list

Parameters

-x list:

List of independent variable (x) values, must be strictly increasing.

-xi list:

List of independent variable interpolation (xi) values.

-y list:

List of dependent variable (y) values.

Return value

list of interpolated dependent variable values, yi, at xi

near1d

Does nearest one-dimensional interpolation.

near1d -x list -y list -xi list

Parameters

-x list:

List of independent variable (x) values.

-xi list:

List of independent variable interpolation (xi) values.

-y list:

List of dependent variable (y) values.

Return value

list of interpolated dependent variable values, yi, at xi

pchip1d

Does piecewise cubic Hermite interpolation (PCHIP).

pchip1d -x list -f|y list -xe|xi list

Parameters

-f list:

List of dependent variable (f) values, -y is an alias.

-x list:

List of independent variable (x) values, must be strictly increasing.

-xe list:

List of independent variable interpolation (xe) values, -xi is an alias.

Return value

list of interpolated dependent variable values.


Copyright (c) George Yashin