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
Copy file name to clipboardExpand all lines: lib/ControlSystemsBase/src/analysis.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -73,7 +73,7 @@ end
73
73
74
74
Count the number of integrators in the system by finding the difference between the number of poles in the origin and the number of zeros in the origin. If the number of zeros in the origin is greater than the number of poles in the origin, the count is negative.
75
75
76
-
For discrete-tiem systems, the origin ``s = 0`` is replaced by the point ``z = 1``.
76
+
For discrete-time systems, the origin ``s = 0`` is replaced by the point ``z = 1``.
Copy file name to clipboardExpand all lines: lib/ControlSystemsBase/src/plotting.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -416,7 +416,7 @@ Create a Nyquist plot of the `LTISystem`(s). A frequency vector `w` can be
416
416
optionally provided.
417
417
418
418
- `unit_circle`: if the unit circle should be displayed. The Nyquist curve crosses the unit circle at the gain crossover frequency.
419
-
- `Ms_circles`: draw circles corresponding to given levels of sensitivity (circles around -1 with radii `1/Ms`). `Ms_circles` can be supplied as a number or a vector of numbers. A design staying outside such a circle has a phase margin of at least `2asin(1/(2Ms))` rad and a gain margin of at least `Ms/(Ms-1)`.
419
+
- `Ms_circles`: draw circles corresponding to given levels of sensitivity (circles around -1 with radii `1/Ms`). `Ms_circles` can be supplied as a number or a vector of numbers. A design staying outside such a circle has a phase margin of at least `2asin(1/(2Ms))` rad and a gain margin of at least `Ms/(Ms-1)`. See also [`margin_bounds`](@ref), [`Ms_from_phase_margin`](@ref) and [`Ms_from_gain_margin`](@ref).
420
420
- `Mt_circles`: draw circles corresponding to given levels of complementary sensitivity. `Mt_circles` can be supplied as a number or a vector of numbers.
421
421
- `critical_point`: point on real axis to mark as critical for encirclements
422
422
- If `hz=true`, the hover information will be displayed in Hertz, the input frequency vector is still treated as rad/s.
(see [`margin_bounds`](@ref) for a function that computes these bounds, and [`Ms_from_phase_margin`](@ref) and [`Ms_from_gain_margin`](@ref) for the inverse functions.)
30
31
Generally, bounding ``M_S`` is a better objective than looking at gain and phase margins due to the possibility of combined gain and pahse variations, which may lead to poor robustness despite large gain and pahse margins.
31
32
32
33
$sensdoc
@@ -35,6 +36,39 @@ function sensitivity(args...)# Sensitivity function
35
36
returnoutput_sensitivity(args...)
36
37
end
37
38
39
+
40
+
"""
41
+
g_m, ϕ_m = margin_bounds(M_S)
42
+
43
+
Compute the phase margin lower bound ϕ_m (in radians) and gain margin lower bound g_m given a maximum sensitivity peak ``M_S = ||S||_∞``. These bounds are derived from the fact that the inverse of the sensitivity function is the distance from the open-loop Nyquist curve to the critical point -1.
44
+
45
+
See also [`Ms_from_phase_margin`](@ref) and [`Ms_from_gain_margin`](@ref) for the inverse functions. The circle corresponding to the maximum sensitivity peak ``M_S`` can be plotted in [`nyquistplot`](@ref) by passing the keyword argument `Ms_circles = [Ms]`.
46
+
"""
47
+
functionmargin_bounds(M_S)
48
+
M_S <1&&error("Maximum sensitivity peak M_S must be greater than or equal to 1, got $M_S")
49
+
ϕ_m =2*asin(1/ (2* M_S))
50
+
g_m = M_S / (M_S -1)
51
+
return (; g_m, ϕ_m, ϕ_m_deg =rad2deg(ϕ_m))
52
+
end
53
+
54
+
"""
55
+
Ms_from_phase_margin(ϕ_m)
56
+
57
+
Compute the maximum sensitivity peak ``M_S = ||S||_∞`` such that if respected, gives a phase margin of at least ϕ_m (in radians).
58
+
59
+
See also [`Ms_from_gain_margin`](@ref) and [`margin_bounds`](@ref).
60
+
"""
61
+
Ms_from_phase_margin(ϕ_m) =1/ (2*sin(ϕ_m /2))
62
+
63
+
"""
64
+
Ms_from_gain_margin(g_m)
65
+
66
+
Compute the maximum sensitivity peak ``M_S = ||S||_∞`` such that if respected, gives a gain margin of at least g_m.
67
+
68
+
See also [`Ms_from_phase_margin`](@ref) and [`margin_bounds`](@ref).
0 commit comments