From 2e63769e84d9773228d7013764cfc6d40523edbe Mon Sep 17 00:00:00 2001 From: Richard Murray Date: Wed, 27 Nov 2024 17:46:58 -0800 Subject: [PATCH 1/2] sort loci in PoleZeroData --- control/pzmap.py | 12 +++++++++--- control/rlocus.py | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/control/pzmap.py b/control/pzmap.py index 400db2807..42fdaeb0e 100644 --- a/control/pzmap.py +++ b/control/pzmap.py @@ -79,11 +79,13 @@ class PoleZeroData: System name. sys : StateSpace or TransferFunction System corresponding to the data. + sort_loci : bool, optional) + Set to False to turn off sorting of loci into unique branches. """ def __init__( self, poles, zeros, gains=None, loci=None, dt=None, sysname=None, - sys=None): + sys=None, sort_loci=True): """Create a pole/zero map object. Parameters @@ -102,10 +104,14 @@ def __init__( System corresponding to the data. """ + from .rlocus import _RLSortRoots self.poles = poles self.zeros = zeros self.gains = gains - self.loci = loci + if loci is not None and sort_loci: + self.loci = _RLSortRoots(loci) + else: + self.loci = loci self.dt = dt self.sysname = sysname self.sys = sys @@ -187,7 +193,7 @@ def pole_zero_plot( ---------- data : List of PoleZeroData objects or LTI systems List of pole/zero response data objects generated by pzmap_response() - or rootlocus_response() that are to be plotted. If a list of systems + or root_locus_map() that are to be plotted. If a list of systems is given, the poles and zeros of those systems will be plotted. grid : bool or str, optional If `True` plot omega-damping grid, if `False` show imaginary axis diff --git a/control/rlocus.py b/control/rlocus.py index 54c672997..c14d1e315 100644 --- a/control/rlocus.py +++ b/control/rlocus.py @@ -88,7 +88,7 @@ def root_locus_map(sysdata, gains=None): root_array = _RLSortRoots(root_array) responses.append(PoleZeroData( - sys.poles(), sys.zeros(), kvect, root_array, + sys.poles(), sys.zeros(), kvect, root_array, sort_loci=False, dt=sys.dt, sysname=sys.name, sys=sys)) if isinstance(sysdata, (list, tuple)): From d220068f61fc94345119eb0a2279567e9ec910c5 Mon Sep 17 00:00:00 2001 From: Richard Murray Date: Mon, 2 Dec 2024 07:34:09 -0800 Subject: [PATCH 2/2] fix small typo in docstring --- control/pzmap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/control/pzmap.py b/control/pzmap.py index 42fdaeb0e..f1d0ecae9 100644 --- a/control/pzmap.py +++ b/control/pzmap.py @@ -79,7 +79,7 @@ class PoleZeroData: System name. sys : StateSpace or TransferFunction System corresponding to the data. - sort_loci : bool, optional) + sort_loci : bool, optional Set to False to turn off sorting of loci into unique branches. """ pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy