Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ Nonlinear system support

~iosys.find_eqpt
~iosys.linearize
~iosys.input_output_response
~iosys.ss2io
~iosys.tf2io
flatsys.point_to_point

.. _utility-and-conversions:
Expand Down
23 changes: 13 additions & 10 deletions doc/iosys.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ values in FBS2e.

We begin by defining the dynamics of the system

.. code-block::
.. code-block:: python

import control
import numpy as np
Expand Down Expand Up @@ -96,7 +96,7 @@ We begin by defining the dynamics of the system

We now create an input/output system using these dynamics:

.. code-block::
.. code-block:: python

io_predprey = control.NonlinearIOSystem(
predprey_rhs, None, inputs=('u'), outputs=('H', 'L'),
Expand All @@ -108,7 +108,7 @@ will be used as the output of the system.
The `io_predprey` system can now be simulated to obtain the open loop dynamics
of the system:

.. code-block::
.. code-block:: python

X0 = [25, 20] # Initial H, L
T = np.linspace(0, 70, 500) # Simulation 70 years of time
Expand All @@ -127,7 +127,7 @@ We can also create a feedback controller to stabilize a desired population of
the system. We begin by finding the (unstable) equilibrium point for the
system and computing the linearization about that point.

.. code-block::
.. code-block:: python

eqpt = control.find_eqpt(io_predprey, X0, 0)
xeq = eqpt[0] # choose the nonzero equilibrium point
Expand All @@ -137,7 +137,7 @@ We next compute a controller that stabilizes the equilibrium point using
eigenvalue placement and computing the feedforward gain using the number of
lynxes as the desired output (following FBS2e, Example 7.5):

.. code-block::
.. code-block:: python

K = control.place(lin_predprey.A, lin_predprey.B, [-0.1, -0.2])
A, B = lin_predprey.A, lin_predprey.B
Expand All @@ -149,7 +149,7 @@ applies a corrective input based on deviations from the equilibrium point.
This system has no dynamics, since it is a static (affine) map, and can
constructed using the `~control.ios.NonlinearIOSystem` class:

.. code-block::
.. code-block:: python

io_controller = control.NonlinearIOSystem(
None,
Expand All @@ -162,7 +162,7 @@ populations followed by the desired lynx population.
To connect the controller to the predatory-prey model, we create an
`InterconnectedSystem`:

.. code-block::
.. code-block:: python

io_closed = control.InterconnectedSystem(
(io_predprey, io_controller), # systems
Expand All @@ -177,7 +177,7 @@ To connect the controller to the predatory-prey model, we create an

Finally, we simulate the closed loop system:

.. code-block::
.. code-block:: python

# Simulate the system
t, y = control.input_output_response(io_closed, T, 30, [15, 20])
Expand Down Expand Up @@ -205,10 +205,13 @@ Input/output system classes
LinearIOSystem
NonlinearIOSystem

Flat systems functions
----------------------
Input/output system functions
-----------------------------
.. autosummary::

find_eqpt
linearize
input_output_response
ss2io
tf2io