@@ -494,7 +494,8 @@ def feedback(self, other=1, sign=-1, params={}):
494
494
# Return the newly created system
495
495
return newsys
496
496
497
- def linearize (self , x0 , u0 , t = 0 , params = {}, eps = 1e-6 ):
497
+ def linearize (self , x0 , u0 , t = 0 , params = {}, eps = 1e-6 ,
498
+ name = None , copy = False , ** kwargs ):
498
499
"""Linearize an input/output system at a given state and input.
499
500
500
501
Return the linearization of an input/output system at a given state
@@ -547,8 +548,20 @@ def linearize(self, x0, u0, t=0, params={}, eps=1e-6):
547
548
D [:, i ] = (self ._out (t , x0 , u0 + du ) - H0 ) / eps
548
549
549
550
# Create the state space system
550
- linsys = StateSpace (A , B , C , D , self .dt , remove_useless = False )
551
- return LinearIOSystem (linsys )
551
+ linsys = LinearIOSystem (
552
+ StateSpace (A , B , C , D , self .dt , remove_useless = False ),
553
+ name = name , ** kwargs )
554
+
555
+ # Set the names the system, inputs, outputs, and states
556
+ if copy :
557
+ linsys .ninputs , linsys .input_index = self .ninputs , \
558
+ self .input_index .copy ()
559
+ linsys .noutputs , linsys .output_index = \
560
+ self .noutputs , self .output_index .copy ()
561
+ linsys .nstates , linsys .state_index = \
562
+ self .nstates , self .state_index .copy ()
563
+
564
+ return linsys
552
565
553
566
def copy (self , newname = None ):
554
567
"""Make a copy of an input/output system."""
@@ -1759,6 +1772,11 @@ def linearize(sys, xeq, ueq=[], t=0, params={}, **kw):
1759
1772
params : dict, optional
1760
1773
Parameter values for the systems. Passed to the evaluation functions
1761
1774
for the system as default values, overriding internal defaults.
1775
+ copy : bool, Optional
1776
+ If `copy` is True, copy the names of the input signals, output signals,
1777
+ and states to the linearized system.
1778
+ name : string, optional
1779
+ Set the name of the linearized system.
1762
1780
1763
1781
Returns
1764
1782
-------
0 commit comments