control.flatsys.flatsys

control.flatsys.flatsys(forward, reverse[, updfcn, outfcn])     flatsys(linsys)[source]

Create a differentially flat I/O system.

The flatsys() function is used to create an input/output system object that also represents a differentially flat system. It can be used in a variety of forms:

fs.flatsys(forward, reverse)

Create a flat system with mappings to/from flat flag.

fs.flatsys(forward, reverse, updfcn[, outfcn])

Create a flat system that is also a nonlinear I/O system.

fs.flatsys(linsys)

Create a flat system from a linear (StateSpace) system.

Parameters
forwardcallable

A function to compute the flat flag given the states and input.

reversecallable

A function to compute the states and input given the flat flag.

updfcncallable, optional

Function returning the state update function

updfcn(t, x, u[, params]) -> array

where x is a 1-D array with shape (nstates,), u is a 1-D array with shape (ninputs,), t is a float representing the current time, and params is an optional dict containing the values of parameters used by the function. If not specified, the state space update will be computed using the flat system coordinates.

outfcncallable, optional

Function returning the output at the given state

outfcn(t, x, u[, params]) -> array

where the arguments are the same as for updfcn. If not specified, the output will be the flat outputs.

inputsint, list of str, or None

Description of the system inputs. This can be given as an integer count or as a list of strings that name the individual signals. If an integer count is specified, the names of the signal will be of the form ‘s[i]’ (where ‘s’ is one of ‘u’, ‘y’, or ‘x’). If this parameter is not given or given as None, the relevant quantity will be determined when possible based on other information provided to functions using the system.

outputsint, list of str, or None

Description of the system outputs. Same format as inputs.

statesint, list of str, or None

Description of the system states. Same format as inputs.

dtNone, True or float, optional

System timebase. None (default) indicates continuous time, True indicates discrete time with undefined sampling time, positive number is discrete time with specified sampling time.

paramsdict, optional

Parameter values for the systems. Passed to the evaluation functions for the system as default values, overriding internal defaults.

namestring, optional

System name (used for specifying signals).

Returns
sysFlatSystem

Flat system.

Other Parameters
input_prefix, output_prefix, state_prefixstring, optional

Set the prefix for input, output, and state signals. Defaults = ‘u’, ‘y’, ‘x’.