You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# More zeros than poles, make sure the vector of roots is of correct length when k = 0
20
19
# When this happens, there are fewer poles for k = 0, these poles can be seen as beeing located somewhere at Inf
21
20
# We get around the problem by not allowing k = 0 for non-proper systems.
@@ -46,25 +45,34 @@ function getpoles(G, K)
46
45
end
47
46
48
47
48
+
"""
49
+
roots, Z, K = rlocus(P::LTISystem; K)
50
+
51
+
Compute the root locus of the SISO LTISystem `P` with a negative feedback loop and feedback gains between 0 and `K`. `rlocus` will use an adaptive step-size algorithm to determine the values of the feedback gains used to generate the plot.
52
+
53
+
`roots` is a complex matrix containig the poles trajectories of the closed-loop `1+k⋅G(s)` as a function of `k`, `Z` contains the zeros of the open-loop system `G(s)` and `K` the values of the feedback gain.
54
+
"""
55
+
functionrlocus(P; K=500)
56
+
K = K isa Number ?range(1e-6,stop=K,length=10000) : K
57
+
Z =tzeros(P)
58
+
roots, K =getpoles(P,K)
59
+
roots, Z, K
60
+
end
61
+
49
62
50
63
"""
51
64
rlocusplot(P::LTISystem; K)
52
65
53
-
Computes and plots the root locus of the SISO LTISystem P with
54
-
a negative feedback loop and feedback gains between 0 and `K`. `rlocusplot` will use an adaptive step-size algorithm to
55
-
determine the values of the feedback gains used to generate the plot.
66
+
Plot the root locus of the SISO LTISystem `P` as computed by `rlocus`.
56
67
"""
57
68
rlocusplot
58
69
@recipefunctionrlocusplot(p::Rlocusplot; K=500)
59
-
P = p.args[1]
60
-
K = K isa Number ?range(1e-6,stop=K,length=10000) : K
0 commit comments