Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am having some trouble to understand how the RootLocusPlot works (options, drawing and etc.)

Here is an example

 TransferFunctionModel[-((k(s-5/2)(s-2)))/((s-4)(s-1)),s], {k, 0, 10},
 PlotRange-> {{-10, 15}, {-5, 5}}, AxesOrigin->{0, 0}

enter image description here

I have no problem to draw the RL by hand despite the negative gain (note that there is a problem with $k=1$ when closing the loop). When I use Mathematica to do the same thing, the output does not seem right even when I increase/decrease the range of k, the number of PlotPoints, the scale and etc.

Any help will be greatly appreciated.

share|improve this question

1 Answer 1

I can explain what is happening with RootLocusPlot, and it will also be useful for you to show the result you obtained by hand and why the result of RLPlot does not seem right compared to that.

(My explanation is based on the plot shown in the question.)

The charactersistic equation of the system is -k (-(5/2)+s) (-2+s)+(-4+s) (-1+s)==0.

  • At k==0 the roots are 1 and 4.

  • As k increases the root at 1 moves to the left and the root at 4 moves to the right.

  • At k==1.02944 there is a double root at -6.24264. The root that started at 1 reaches there in a straightforward manner, but the root that started from 4 has to go all the way to infinity and back because of the discontinuity at k==1. On the plot the red loci starts at -4 goes all the way to infinity and then gets back to -6.24264. (With ListPlot I think we can see the entire real axis covered by red loci.) It also obscures the blue loci that started at 1 and reached -6.24264.

  • From k==1.02944 onwards there are two loci which start from -6.24264 and proceed in a manner symmetric about the real axis till they eventually wind up at the two zeros.

(Adding this based on comment below)

p1 = RootLocusPlot[
   TransferFunctionModel[-((k (s - 5/2) (s - 2)))/((s - 4) (s - 1)), 
    s], {k, 0, 0.99}, PlotRange -> {{-10, 15}, {-5, 5}}, 
   AxesOrigin -> {0, 0}];

p2 = RootLocusPlot[
   TransferFunctionModel[-((k (s - 5/2) (s - 2)))/((s - 4) (s - 1)), 
    s], {k, 1.01, 10}, PlotRange -> {{-10, 15}, {-5, 5}}, 
   AxesOrigin -> {0, 0}];

Show[p1, p2]

enter image description here

(Update for v10)

In v10, the handling of loci which go to infinity and back has been improved. The default plot points still need to be tweaked to get ParametricPlot to give a smooth plot, but it is much cleaner that the earlier iteration.

TransferFunctionModel[-((k (s - 5/2) (s - 2)))/((s - 4) (s -    1)), 
s], {k, 0, 10}, PlotRange -> {{-10, 15}, {-5, 5}}, 
PlotPoints -> 90, MaxRecursion -> 10]

enter image description here

share|improve this answer
Many thanks. What you wrote it is what I got by hand but I cannot see that on the result of RootLocusPlot. a) There is no blue loci coming from -infty (I have tried changing the range of k and etc but no show) and b) There seems to be a loci between pole at 1 and zero at 2, and between zero at 2.5 and pole at 4 (it should not be there). Another point: how to use ListPlot in this case? –  Ed Mendes May 20 '13 at 22:23
a) RootLocusPlot[TransferFunctionModel[-((k (s - 5/2) (s - 2)))/((s - 4) (s - 1)), s], {k, 0, 10}, PlotRange -> {{-10, 15}, {-5, 5}}, AxesOrigin -> {0, 0}, PlotPoints -> 300, MaxRecursion -> 10, Method -> "GenericSolve"] –  Suba Thomas May 20 '13 at 22:58
b) That is because the loci goes to infinity and come back. It is noise. We can split the process into two. I will post it along with the answer above. Regarding ListPlot, I did Table[Solve[-k (-(5/2)+s) (-2+s)+(-4+s) (-1+s)==0,s], {k, range of values}], obtained the real and imaginary parts and got a 'back of the envelope' kind of result with ListPlot. –  Suba Thomas May 20 '13 at 23:00
Many thanks. It worked but I am not happy with the noise (I used thickness[0.02] to see that the entire real axis is covered by the loci - that is not true unless we have negative gains - which we don't). How to get rid of this noise? As for a) p2 gives me a distorted circle that does not seem right. –  Ed Mendes May 20 '13 at 23:39
Just a comment - if you change the limit of k from 0.99 to 0.99999, and from 1.01 to 1.00001, the entire real axis is covered by the loci. –  Ed Mendes May 21 '13 at 12:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.