11# flatsys.py - trajectory generation for differentially flat systems
22# RMM, 10 Nov 2012
3- #
4- # This file contains routines for computing trajectories for differentially
5- # flat nonlinear systems. It is (very) loosely based on the NTG software
6- # package developed by Mark Milam and Kudah Mushambi, but rewritten from
7- # scratch in python.
8- #
9- # Copyright (c) 2012 by California Institute of Technology
10- # All rights reserved.
11- #
12- # Redistribution and use in source and binary forms, with or without
13- # modification, are permitted provided that the following conditions
14- # are met:
15- #
16- # 1. Redistributions of source code must retain the above copyright
17- # notice, this list of conditions and the following disclaimer.
18- #
19- # 2. Redistributions in binary form must reproduce the above copyright
20- # notice, this list of conditions and the following disclaimer in the
21- # documentation and/or other materials provided with the distribution.
22- #
23- # 3. Neither the name of the California Institute of Technology nor
24- # the names of its contributors may be used to endorse or promote
25- # products derived from this software without specific prior
26- # written permission.
27- #
28- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31- # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CALTECH
32- # OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34- # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
35- # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36- # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37- # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
38- # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39- # SUCH DAMAGE.
403
414import itertools
425import numpy as np
@@ -54,8 +17,30 @@ class FlatSystem(NonlinearIOSystem):
5417 """Base class for representing a differentially flat system.
5518
5619 The FlatSystem class is used as a base class to describe differentially
57- flat systems for trajectory generation. The output of the system does not
58- need to be the differentially flat output.
20+ flat systems for trajectory generation. The output of the system does
21+ not need to be the differentially flat output. Flat systems are
22+ usually created with the :func:`~control.flatsys.flatsys` factory
23+ function.
24+
25+ Parameters
26+ ----------
27+ forward : callable
28+ A function to compute the flat flag given the states and input.
29+ reverse : callable
30+ A function to compute the states and input given the flat flag.
31+ dt : None, True or float, optional
32+ System timebase.
33+
34+ Attributes
35+ ----------
36+ ninputs, noutputs, nstates : int
37+ Number of input, output and state variables.
38+ shape : tuple
39+ 2-tuple of I/O system dimension, (noutputs, ninputs).
40+ input_labels, output_labels, state_labels : list of str
41+ Names for the input, output, and state variables.
42+ name : string, optional
43+ System name.
5944
6045 Notes
6146 -----
@@ -234,10 +219,9 @@ def flatsys(*args, updfcn=None, outfcn=None, **kwargs):
234219 Description of the system states. Same format as `inputs`.
235220
236221 dt : None, True or float, optional
237- System timebase. None (default) indicates continuous
238- time, True indicates discrete time with undefined sampling
239- time, positive number is discrete time with specified
240- sampling time.
222+ System timebase. None (default) indicates continuous time, True
223+ indicates discrete time with undefined sampling time, positive
224+ number is discrete time with specified sampling time.
241225
242226 params : dict, optional
243227 Parameter values for the systems. Passed to the evaluation
@@ -252,6 +236,12 @@ def flatsys(*args, updfcn=None, outfcn=None, **kwargs):
252236 sys: :class:`FlatSystem`
253237 Flat system.
254238
239+ Other Parameters
240+ ----------------
241+ input_prefix, output_prefix, state_prefix : string, optional
242+ Set the prefix for input, output, and state signals. Defaults =
243+ 'u', 'y', 'x'.
244+
255245 """
256246 from .linflat import LinearFlatSystem
257247 from ..statesp import StateSpace
0 commit comments