control.flatsys.BasisFamily

class control.flatsys.BasisFamily(N)[source]

Bases: object

Base class for basis functions for flat systems.

A BasisFamily object is used to construct trajectories for a flat system. The class must implement a single function that computes the jth derivative of the ith basis function at a time t:

z_i^{(q)}(t) = basis.eval_deriv(self, i, j, t)

A basis set can either consist of a single variable that is used for each flat output (nvars = None) or a different variable for different flat outputs (nvars > 0).

Parameters
Nint

Order of the basis set.

Attributes
nvarsint or None

Number of variables represented by the basis (possibly of different order/length). Default is None (single variable).

coef_offsetlist

Coefficient offset for each variable.

coef_lengthlist

Coefficient length for each variable.

Methods

__call__

Evaluate the ith basis function at a point in time.

eval

Compute function values given the coefficients and time points.

eval_deriv

Evaluate kth derivative of ith basis function at time t.

var_ncoefs

Get the number of coefficients for a variable.

__call__(i, t, var=None)[source]

Evaluate the ith basis function at a point in time.

eval(coeffs, tlist, var=None)[source]

Compute function values given the coefficients and time points.

Parameters
coeffsarray

Basis function coefficient values.

tlistarray

List of times at which to evaluate the function.

varint or None, optional

Number of independent variables represented using the basis. If None, then basis represents a single variable.

Returns
array

Values of the variable(s) at the times in tlist.

eval_deriv(i, k, t, var=None)[source]

Evaluate kth derivative of ith basis function at time t.

Parameters
iint

Basis function offset.

kint

Derivative order.

tfloat

Time at which to evaluating the derivative.

varint or None, optional

Variable offset.

Returns
float
var_ncoefs(var)[source]

Get the number of coefficients for a variable.

Parameters
varint

Variable offset.

Returns
int