control.flatsys.flatsys
- control.flatsys.flatsys(*args, updfcn=None, outfcn=None, **kwargs)[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 mapings 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
forward (callable) – A function to compute the flat flag given the states and input.
reverse (callable) – A function to compute the states and input given the flat flag.
updfcn (callable, optional) –
Function returning the state update function
updfcn(t, x, u[, param]) -> 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 currrent time, and param 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.
outfcn (callable, optional) –
Function returning the output at the given state
outfcn(t, x, u[, param]) -> array
where the arguments are the same as for upfcn. If not specified, the output will be the flat outputs.
inputs (int, 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.
outputs (int, list of str, or None) – Description of the system outputs. Same format as inputs.
states (int, list of str, or None) – Description of the system states. Same format as inputs.
dt (None, 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.
params (dict, optional) – Parameter values for the systems. Passed to the evaluation functions for the system as default values, overriding internal defaults.
name (string, optional) – System name (used for specifying signals)
- Returns
sys – Flat system.
- Return type