|
22 | 22 | Input/output systems can be simulated and also used to compute equilibrium |
23 | 23 | points and linearizations. |
24 | 24 |
|
25 | | -An input/output system is defined as a dynamical system that has a system |
26 | | -state as well as inputs and outputs (either inputs or states can be empty). |
27 | | -The dynamics of the system can be in continuous or discrete time. To simulate |
28 | | -an input/output system, use the :func:`~control.input_output_response` |
29 | | -function:: |
30 | | -
|
31 | | - t, y = input_output_response(io_sys, T, U, X0, params) |
32 | | -
|
33 | | -An input/output system can be linearized around an equilibrium point to obtain |
34 | | -a :class:`~control.StateSpace` linear system. Use the |
35 | | -:func:`~control.find_eqpts` function to obtain an equilibrium point and the |
36 | | -:func:`~control.linearize` function to linearize about that equilibrium point:: |
37 | | -
|
38 | | - xeq, ueq = find_eqpt(io_sys, X0, U0) |
39 | | - ss_sys = linearize(io_sys, xeq, ueq) |
40 | | -
|
41 | | -Input/output systems can be created from state space LTI systems by using the |
42 | | -:class:`~control.LinearIOSystem` class`:: |
43 | | -
|
44 | | - io_sys = LinearIOSystem(ss_sys) |
45 | | -
|
46 | | -Nonlinear input/output systems can be created using the |
47 | | -:class:`~control.NonlinearIoSystem` class, which requires the definition of an |
48 | | -update function (for the right hand side of the differential or different |
49 | | -equation) and and output function (computes the outputs from the state):: |
50 | | -
|
51 | | - io_sys = NonlinearIOSystem(updfcn, outfcn, inputs=M, outputs=P, states=N) |
52 | | -
|
53 | | -More complex input/output systems can be constructed by using the |
54 | | -:class:`~control.InterconnectedSystem` class, which allows a collection of |
55 | | -input/output subsystems to be combined with internal connections between the |
56 | | -subsystems and a set of overall system inputs and outputs that link to the |
57 | | -subsystems:: |
58 | | -
|
59 | | - steering = ct.InterconnectedSystem( |
60 | | - (plant, controller), name='system', |
61 | | - connections=(('controller.e', '-plant.y')), |
62 | | - inplist=('controller.e'), inputs='r', |
63 | | - outlist=('plant.y'), outputs='y') |
64 | | -
|
65 | | -Interconnected systems can also be created using block diagram manipulations |
66 | | -such as the :func:`~control.series`, :func:`~control.parallel`, and |
67 | | -:func:`~control.feedback` functions. The :class:`~control.InputOutputSystem` |
68 | | -class also supports various algebraic operations such as `*` (series |
69 | | -interconnection) and `+` (parallel interconnection). |
70 | | -
|
71 | 25 | """ |
72 | 26 |
|
73 | 27 | __author__ = "Richard Murray" |
@@ -1585,6 +1539,11 @@ def find_eqpt(sys, x0, u0=[], y0=None, t=0, params={}, |
1585 | 1539 | ninputs = _find_size(sys.ninputs, u0) |
1586 | 1540 | noutputs = _find_size(sys.noutputs, y0) |
1587 | 1541 |
|
| 1542 | + # Convert x0, u0, y0 to arrays, if needed |
| 1543 | + if np.isscalar(x0): x0 = np.ones((nstates,)) * x0 |
| 1544 | + if np.isscalar(u0): u0 = np.ones((ninputs,)) * u0 |
| 1545 | + if np.isscalar(y0): y0 = np.ones((ninputs,)) * y0 |
| 1546 | + |
1588 | 1547 | # Discrete-time not yet supported |
1589 | 1548 | if isdtime(sys, strict=True): |
1590 | 1549 | raise NotImplementedError( |
@@ -1680,7 +1639,7 @@ def rootfun(z): |
1680 | 1639 | # * output_vars: indices of outputs that must be constrained |
1681 | 1640 | # |
1682 | 1641 | # This index lists can all be precomputed based on the `iu`, `iy`, |
1683 | | - # `ix`, and `idx` lists that were passed as arguments to `find_eqpts` |
| 1642 | + # `ix`, and `idx` lists that were passed as arguments to `find_eqpt` |
1684 | 1643 | # and were processed above. |
1685 | 1644 |
|
1686 | 1645 | # Get the states and inputs that were not listed as fixed |
|
0 commit comments