11.. _flatsys-module :
22
3- ***************************
43Differentially flat systems
5- ***************************
4+ ===========================
65
76.. automodule :: control.flatsys
7+ :noindex:
88 :no-members:
99 :no-inherited-members:
1010 :no-special-members:
1111
12+ .. currentmodule :: control
13+
14+
1215Overview of differential flatness
13- =================================
16+ ---------------------------------
1417
1518A nonlinear differential equation of the form
1619
1720.. math ::
21+
1822 \dot x = f(x, u), \qquad x \in R^n, u \in R^m
1923
2024 is *differentially flat * if there exists a function :math: `\alpha ` such that
2125
2226.. math ::
27+
2328 z = \alpha (x, u, \dot u\, \dots , u^{(p)})
2429
2530 and we can write the solutions of the nonlinear system as functions of
2631:math: `z` and a finite number of derivatives
2732
2833.. math ::
34+ :label: flat2 state
35+
2936 x &= \beta (z, \dot z, \dots , z^{(q)}) \\
3037 u &= \gamma (z, \dot z, \dots , z^{(q)}).
31- :label: flat2 state
3238
3339 For a differentially flat system, all of the feasible trajectories for
3440the system can be written as functions of a flat output :math: `z(\cdot )` and
@@ -42,11 +48,13 @@ space, and then map these to appropriate inputs. Suppose we wish to
4248generate a feasible trajectory for the nonlinear system
4349
4450.. math ::
51+
4552 \dot x = f(x, u), \qquad x(0 ) = x_0 ,\, x(T) = x_f.
4653
4754 If the system is differentially flat then
4855
4956.. math ::
57+
5058 x(0 ) &= \beta \bigl (z(0 ), \dot z(0 ), \dots , z^{(q)}(0 ) \bigr ) = x_0 , \\
5159 x(T) &= \gamma \bigl (z(T), \dot z(T), \dots , z^{(q)}(T) \bigr ) = x_f,
5260
@@ -64,6 +72,7 @@ trajectory of the system. We can parameterize the flat output trajectory
6472using a set of smooth basis functions :math: `\psi _i(t)`:
6573
6674.. math ::
75+
6776 z(t) = \sum _{i=1 }^N c_i \psi _i(t), \qquad c_i \in R
6877
6978 We seek a set of coefficients :math: `c_i`, :math: `i = 1 , \dots , N` such
@@ -72,6 +81,7 @@ that :math:`z(t)` satisfies the boundary conditions for :math:`x(0)` and
7281the derivatives of the basis functions:
7382
7483.. math ::
84+
7585 \dot z(t) &= \sum _{i=1 }^N c_i \dot \psi _i(t) \\
7686 &\,\vdots \\
7787 \dot z^{(q)}(t) &= \sum _{i=1 }^N c_i \psi ^{(q)}_i(t).
@@ -80,6 +90,7 @@ We can thus write the conditions on the flat outputs and their
8090derivatives as
8191
8292.. math ::
93+
8394 \begin {bmatrix}
8495 \psi _1 (0 ) & \psi _2 (0 ) & \dots & \psi _N(0 ) \\
8596 \dot \psi _1 (0 ) & \dot \psi _2 (0 ) & \dots & \dot \psi _N(0 ) \\
@@ -99,6 +110,7 @@ derivatives as
99110 This equation is a *linear * equation of the form
100111
101112.. math ::
113+
102114 M c = \begin {bmatrix} \bar z(0 ) \\ \bar z(T) \end {bmatrix}
103115
104116 where :math: `\bar z` is called the *flat flag * for the system.
@@ -107,7 +119,7 @@ column rank, we can solve for a (possibly non-unique) :math:`\alpha` that
107119solves the trajectory generation problem.
108120
109121Module usage
110- ============
122+ ------------
111123
112124To create a trajectory for a differentially flat system, a
113125:class: `~flatsys.FlatSystem ` object must be created. This is done
@@ -138,7 +150,7 @@ and their derivatives up to order :math:`q_i`:
138150The number of flat outputs must match the number of system inputs.
139151
140152For a linear system, a flat system representation can be generated by
141- passing a :class: `~control. StateSpace ` system to the
153+ passing a :class: `StateSpace ` system to the
142154:func: `~flatsys.flatsys ` factory function::
143155
144156 sys = fs.flatsys(linsys)
@@ -180,7 +192,7 @@ where `T` is a list of times on which the trajectory should be evaluated
180192
181193The :func: `~flatsys.point_to_point ` function also allows the
182194specification of a cost function and/or constraints, in the same
183- format as :func: `~control. optimal.solve_ocp `.
195+ format as :func: `optimal.solve_ocp `.
184196
185197The :func: `~flatsys.solve_flat_ocp ` function can be used to
186198solve an optimal control problem without a final state::
@@ -195,7 +207,7 @@ vector. The `terminal_cost` parameter can be used to specify a cost
195207function for the final point in the trajectory.
196208
197209Example
198- =======
210+ -------
199211
200212To illustrate how we can use a two degree-of-freedom design to improve the
201213performance of the system, consider the problem of steering a car to change
@@ -309,9 +321,7 @@ cost:`
309321 x, u = traj.eval(t)
310322
311323Module classes and functions
312- ============================
313-
314- .. currentmodule:: control
324+ ----------------------------
315325
316326.. autosummary::
317327 :template: custom-class-template.rst
0 commit comments