Incorrect rootlocus plot
See original GitHub issueI’m using the control package in a modified jupyter/scipy docker container. The modification to the container were just to install the controls package (RUN pip3 install control). When i try to plot the root locus of a inverted pendulum with 2 roots at 0, it outputs the wrong rootlocus.
Minimal working example:
import numpy as np
import control
A = np.array([[0,1,0,0],[0,0,-1,0],[0,0,0,1],[0,0,5,0]])
B = np.array([[0],[1],[0],[-2]])
C = np.array([1,0,0,0])
D = 0
sys = control.ss(A,B,C,D)
r = control.root_locus(sys, xlim=[-2,2],ylim=[-7,7])
The above code results in the following plot
When the same system in plotted in octave, it gives the following rlocus

As can be seen there should be no branch immediately to the left of 0
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Which of the following statement is incorrect for root locus ...
The root locus diagram is plotted by using the open-loop poles but not the closed-loop poles. This method is very much useful because...
Read more >Why is the Root Locus Plot Important? - Swarthmore College
As an engineer the problem is typically the reverse. You know what kind of system response you want, and it is your job...
Read more >Root Locus Technique (Problems) - YouTube
Rules to Plot Root Locus - Root Locus Analysis - Control Systems · root locus in control system · Root locus for complex...
Read more >EXAMPLE PROBLEMS AND SOLUTIONS - ResearchGate
The root-locus plot for this system is shown in Figure 6-3Y(h). Note that this system is stable for m y ... This fact...
Read more >Root Locus Analysis & Design
Mechatronics. Root Locus Analysis and Design. K. Craig. 9. Problem: Determine the roots of the characteristic equation for all values of K and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I chased this down a bit more. The difference seems to come from the way that slycot creates the transfer function representation of the system versus the way that SciPy carries out the calculation (via
scipy.signal.ss2tf).Slycot:
SciPy:
Interestingly, SciPy throws a warning when computing the poles:
So it looks like the problem is the (fast, stable) zero at -2.689e+14, which completely throws off the root locus plot. Not sure how to fix without implementing our own transfer function calculation rather than rely on SciPy.
I looked at the source code for the SciPy function and the basic calculation is:
The Slycot computation for
tb04ad(the function that gets calls) says:Doesn’t work without slycot with the pacakage versions you mentioned. Works with the mentioned packages with slycot