Visualize performance and robustness requirements

We illustrate how performance and robustness specifications can be visualized by creating instances of objective types for which plot recipes are available.

using JuliaSimControls, Plots
G = tf(2, [1, 0.3, 2])           # An example system
w = exp10.(LinRange(-2, 2, 200)) # A frequency vector

W = tf([2, 0], [1, 1]) # A weight specifying the maximum allowed sensitivity
S = feedback(1, G)     # The sensitivity function
bodeplot(S, w, plotphase=false)
plot!(MaximumSensitivityObjective(W), w, title="MaximumSensitivityObjective")
plot(step(G, 15))
plot!(OvershootObjective(1.2), title="OvershootObjective")
plot(step(G, 15))
plot!(RiseTimeObjective(0.6, 1), title="RiseTimeObjective")
plot(step(G, 15))
plot!(SettlingTimeObjective(1, 5, 0.2), title="SettlingTimeObjective")
plot(step(G, 15))
o = StepTrackingObjective(tf(1, [1,2,1])) # Takes a reference model
plot!(o, title="StepTrackingObjective")
plot(step(G*feedback(1, G), 15))
o = StepRejectionObjective(tf([1, 0], [1,2,1])) # Takes a reference model
plot!(o, title="StepRejectionObjective")
dm = diskmargin(G, 0, w)
plot(dm)
plot!(GainMarginObjective(2),   title="GainMarginObjective")
plot!(PhaseMarginObjective(45), title="PhaseMarginObjective")