Skip to content

Commit d0aa48a

Browse files
committed
Add full example to create_statefbk_iosystem
1 parent dfc8b73 commit d0aa48a

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

control/statefbk.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,23 @@ def create_statefbk_iosystem(
721721
System name. If unspecified, a generic name <sys[id]> is generated
722722
with a unique integer id.
723723
724+
Examples
725+
--------
726+
>>> import control as ct
727+
>>> import numpy as np
728+
>>>
729+
>>> A = [[0, 1], [-0.5, -0.1]]
730+
>>> B = [[0], [1]]
731+
>>> C = np.eye(2)
732+
>>> D = np.zeros((2, 1))
733+
>>> sys = ct.ss(A, B, C, D)
734+
>>>
735+
>>> Q = np.eye(2)
736+
>>> R = np.eye(1)
737+
>>>
738+
>>> K, _, _ = ct.lqr(sys,Q,R)
739+
>>> ctrl, clsys = ct.create_statefbk_iosystem(sys, K)
740+
724741
"""
725742
# Make sure that we were passed an I/O system as an input
726743
if not isinstance(sys, NonlinearIOSystem):

0 commit comments

Comments
 (0)