|
74 | 74 | except ImportError:
|
75 | 75 | ab13dd = None
|
76 | 76 |
|
77 |
| -__all__ = ['StateSpace', 'LinearICSystem', 'tf2ss', 'ssdata', |
| 77 | +__all__ = ['StateSpace', 'LinearICSystem', 'ss2io', 'tf2io', 'tf2ss', 'ssdata', |
78 | 78 | 'linfnorm', 'ss', 'rss', 'drss', 'summing_junction']
|
79 | 79 |
|
80 | 80 | # Define module default parameter values
|
@@ -1598,7 +1598,7 @@ def ss(*args, **kwargs):
|
1598 | 1598 | and not isinstance(args[0], (InputOutputSystem, LTI)):
|
1599 | 1599 | # Function as first (or second) argument => assume nonlinear IO system
|
1600 | 1600 | warn("using ss to create nonlinear I/O systems is deprecated; "
|
1601 |
| - "use nlsys", DeprecationWarning) |
| 1601 | + "use nlsys()", DeprecationWarning) |
1602 | 1602 | return NonlinearIOSystem(*args, **kwargs)
|
1603 | 1603 |
|
1604 | 1604 | elif len(args) == 4 or len(args) == 5:
|
@@ -1630,6 +1630,99 @@ def ss(*args, **kwargs):
|
1630 | 1630 | return sys
|
1631 | 1631 |
|
1632 | 1632 |
|
| 1633 | +# Convert a state space system into an input/output system (wrapper) |
| 1634 | +def ss2io(*args, **kwargs): |
| 1635 | + """ss2io(sys[, ...]) |
| 1636 | +
|
| 1637 | + Create an I/O system from a state space linear system. |
| 1638 | +
|
| 1639 | + .. deprecated:: 0.10.0 |
| 1640 | + This function will be removed in a future version of python-control. |
| 1641 | + The `ss` function can be used directly to produce an I/O system. |
| 1642 | +
|
| 1643 | + Create an :class:`~control.StateSpace` system with the given signal |
| 1644 | + and system names. See :func:`~control.ss` for more details. |
| 1645 | + """ |
| 1646 | + warn("ss2io is deprecated; use ss()", DeprecationWarning) |
| 1647 | + return StateSpace(*args, **kwargs) |
| 1648 | + |
| 1649 | + |
| 1650 | +# Convert a transfer function into an input/output system (wrapper) |
| 1651 | +def tf2io(*args, **kwargs): |
| 1652 | + """tf2io(sys[, ...]) |
| 1653 | +
|
| 1654 | + Convert a transfer function into an I/O system. |
| 1655 | +
|
| 1656 | + .. deprecated:: 0.10.0 |
| 1657 | + This function will be removed in a future version of python-control. |
| 1658 | + The `tf2ss` function can be used to produce a state space I/O system. |
| 1659 | +
|
| 1660 | + The function accepts either 1 or 2 parameters: |
| 1661 | +
|
| 1662 | + ``tf2io(sys)`` |
| 1663 | + Convert a linear system into space space form. Always creates |
| 1664 | + a new system, even if sys is already a StateSpace object. |
| 1665 | +
|
| 1666 | + ``tf2io(num, den)`` |
| 1667 | + Create a linear I/O system from its numerator and denominator |
| 1668 | + polynomial coefficients. |
| 1669 | +
|
| 1670 | + For details see: :func:`tf` |
| 1671 | +
|
| 1672 | + Parameters |
| 1673 | + ---------- |
| 1674 | + sys : LTI (StateSpace or TransferFunction) |
| 1675 | + A linear system. |
| 1676 | + num : array_like, or list of list of array_like |
| 1677 | + Polynomial coefficients of the numerator. |
| 1678 | + den : array_like, or list of list of array_like |
| 1679 | + Polynomial coefficients of the denominator. |
| 1680 | +
|
| 1681 | + Returns |
| 1682 | + ------- |
| 1683 | + out : StateSpace |
| 1684 | + New I/O system (in state space form). |
| 1685 | +
|
| 1686 | + Other Parameters |
| 1687 | + ---------------- |
| 1688 | + inputs, outputs : str, or list of str, optional |
| 1689 | + List of strings that name the individual signals of the transformed |
| 1690 | + system. If not given, the inputs and outputs are the same as the |
| 1691 | + original system. |
| 1692 | + name : string, optional |
| 1693 | + System name. If unspecified, a generic name <sys[id]> is generated |
| 1694 | + with a unique integer id. |
| 1695 | +
|
| 1696 | + Raises |
| 1697 | + ------ |
| 1698 | + ValueError |
| 1699 | + if `num` and `den` have invalid or unequal dimensions, or if an |
| 1700 | + invalid number of arguments is passed in. |
| 1701 | + TypeError |
| 1702 | + if `num` or `den` are of incorrect type, or if sys is not a |
| 1703 | + TransferFunction object. |
| 1704 | +
|
| 1705 | + See Also |
| 1706 | + -------- |
| 1707 | + ss2io |
| 1708 | + tf2ss |
| 1709 | +
|
| 1710 | + Examples |
| 1711 | + -------- |
| 1712 | + >>> num = [[[1., 2.], [3., 4.]], [[5., 6.], [7., 8.]]] |
| 1713 | + >>> den = [[[9., 8., 7.], [6., 5., 4.]], [[3., 2., 1.], [-1., -2., -3.]]] |
| 1714 | + >>> sys1 = ct.tf2ss(num, den) |
| 1715 | +
|
| 1716 | + >>> sys_tf = ct.tf(num, den) |
| 1717 | + >>> G = ct.tf2ss(sys_tf) |
| 1718 | + >>> G.ninputs, G.noutputs, G.nstates |
| 1719 | + (2, 2, 8) |
| 1720 | +
|
| 1721 | + """ |
| 1722 | + warn("tf2io is deprecated; use tf2ss() or tf()", DeprecationWarning) |
| 1723 | + return tf2ss(*args, **kwargs) |
| 1724 | + |
| 1725 | + |
1633 | 1726 | def tf2ss(*args, **kwargs):
|
1634 | 1727 | """tf2ss(sys)
|
1635 | 1728 |
|
|
0 commit comments