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
Not only are sensitivity functions large, they vary a lot under the considered uncertainty. We can also plot a step response of one of the sensitivity functions to check how the system behaves
88
93
```@example satellite
89
94
plot(step(c2d(Tp, 0.01), 10))
95
+
DisplayAs.PNG(Plots.current()) # hide
90
96
```
91
97
This kind of plot is quite useful, it immediately tells you that this transfer function appears stable, and that there is uncertainty in the static gain etc.
Under this uncertainty, the sensitivity could potentially be sky high., note how some of the 100 realizations peak much higher than the others. This is an indication that the system might be unstable.
@@ -111,13 +118,15 @@ With complex entries in the system model, we can't really plot the step response
111
118
```@example satellite
112
119
res = step(c2d(Ts, 0.01), 10)
113
120
plot(res.t, [abs.(res.y)[1,:,1] abs.(res.y)[2,:,2]]) # plot only the diagonal response
121
+
DisplayAs.PNG(Plots.current()) # hide
114
122
```
115
123
Looks unstable to me. The analysis using $M\Delta$ methodology below will also reach this conclusion.
116
124
117
125
118
126
### Example: Distillation Process
119
127
This example comes from section 3.7.2 of Skogestad's book. In this example, we'll explore also complex uncertainties, created using [`δc`](@ref).
120
128
```@example distill
129
+
using DisplayAs # hide
121
130
using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements, Plots, LinearAlgebra
The system is very sensitive to real input uncertainty!
@@ -179,6 +189,7 @@ Gs = G*W
179
189
res = step(c2d(feedback(Gs*Kinv)*F, 0.01), 20)
180
190
mcplot!(res.t, abs.(res.y[:, :, 1]'), alpha=0.3)
181
191
mcplot!(res.t, abs.(res.y[:, :, 2]'), alpha=0.3)
192
+
DisplayAs.PNG(Plots.current()) # hide
182
193
```
183
194
184
195
How about the sensitivity functions?
@@ -187,14 +198,16 @@ Si = input_sensitivity(Gs, Kinv)
187
198
sigmaplot(Si, w, c=1, lab="Si")
188
199
So = output_sensitivity(Gs, Kinv)
189
200
sigmaplot!(So, w, c=2, lab="So")
201
+
DisplayAs.PNG(Plots.current()) # hide
190
202
```
191
203
192
204
The sensitivity at the plant output is enormous. A low sensitivity with the nominal system does not guarantee robustness!
193
205
194
206
## Model-order reduction for uncertain models
195
207
The ``\nu``-gap metric is a measure of distance between models when they are used in a feedback loop. This metric has the nice property that a controller designed for a process ``P`` that achieves a normalized coprime factor margin ([`ncfmargin`](@ref)) of ``m``, will stabilize all models that are within a ``\nu``-gap distance of ``m`` from ``P``. This can be used to reduce the number of uncertain realizations for a model represented with `Particles` like above in a smart way. Say that we have a plant model ``P``
196
208
```@example MCM_NUGAP
197
-
using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements
209
+
using DisplayAs # hide
210
+
using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements, Plots
198
211
ω = with_nominal(0.9 .. 1.1, 1)
199
212
ζ = with_nominal(0.5 ± 0.01, 0.5)
200
213
P = tf([ω^2], [1, 2*ζ*ω, ω^2]) |> ss
@@ -205,6 +218,7 @@ If we plot ``P``, it looks something like this:
We now have only three realizations left, the nominal one and the two extreme cases (in the ``\nu``-gap sense).
240
256
@@ -362,6 +378,7 @@ We can draw samples from this uncertainty representation (sampling of $\Delta$ a
362
378
```@example satellite
363
379
Psamples = rand(Ps, 100)
364
380
sigmaplot(Psamples, w)
381
+
DisplayAs.PNG(Plots.current()) # hide
365
382
```
366
383
367
384
We can extract the nominal model using
@@ -410,6 +427,7 @@ TODO
410
427
411
428
Modeling uncertain time delays can be done in several ways, one approach is to make use of a multiplicative uncertainty weight created using [`neglected_delay`](@ref) multiplied by an uncertain element created using [`δc`](@ref), example:
412
429
```@example uncertain_delay
430
+
using DisplayAs # hide
413
431
using RobustAndOptimalControl, ControlSystemsBase, MonteCarloMeasurements, Plots, LinearAlgebra
414
432
gr(fmt=:png, size=(640,480)) # hide
415
433
a = 10
@@ -421,6 +439,7 @@ Psamples = rand(Ps, 1000) # Sample the uncertain plant for plotting
421
439
w = exp10.(LinRange(-1, 3, 300)) # Frequency vector
bodeplot!(P*[delay(0.005) tf(0); tf(0) delay(0.005)], w) # Compare to the plant with a model of the delay
442
+
DisplayAs.PNG(Plots.current()) # hide
424
443
```
425
444
We see that the uncertain model set includes the model with the delay. Note how this approximation approach imparts some uncertainty also in the gain.
426
445
@@ -440,6 +459,7 @@ plot(
440
459
# plot(step(feedback(P, C), 0:0.0001:0.05), lab="L = " .* string.(P.Tau[].particles'), title="Disturbance response"), # This simulation requires using ControlSystems
441
460
nyquistplot(P*C, w[1:10:end], points=true, xlims=(-3.5, 2.5), ylims=(-5, 1.5), Ms_circles=[1.5, 2], alpha=1) # Note, the nyquistplot with uncertain coefficients requires manual selection of plot limits
442
461
)
462
+
DisplayAs.PNG(Plots.current()) # hide
443
463
```
444
464
Notice how the gain is completely certain, while the phase starts becoming very uncertain for high frequencies.
445
465
@@ -591,6 +611,7 @@ For any of the uncertainty descriptions above, we may plot the total loop gain e
591
611
##### Example: Bode plot
592
612
Below, we perform this procedure for an multiplicative (relative) uncertainty model at the plant output. The uncertainty weight ``W(s)`` is chosen to give 10% uncertainty at low frequencies and 10x uncertainty at high frequencies, indicating that we are absolutely oblivious to the behavior of the plant at high frequencies. This is often the case, either because identification experiments did not contain excitation for high frequencies, or because the plant had nonlinear behavior at higher frequencies.
593
613
```@example UNCERTAIN_VIZ
614
+
using DisplayAs # hide
594
615
using ControlSystemsBase, RobustAndOptimalControl, Plots
If the plots above are created using the `plotly()` backend, each circle is associated with hover information that is accessible by hovering the mouse over the plot. This indicates that the circle that touches the critical point is the one at ``\omega \approx 4.5``, which coincides exactly with the point at thich the Bode plot above touches the inverse weight``W^{-1}``.
Copy file name to clipboardExpand all lines: src/mcm_nugap.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Reduce the number of particles in an uncertain system `G` by removing all partic
33
33
34
34
Note: If `G` has a stochastic interpretation, i.e., the coefficients come from some distribution, this interpretation will be lost after reduction, mean values and standard deviations will not be preserved. The reduced system should instead be interpreted as preserving worst-case uncertainty.
35
35
36
-
If the `gap = nugap(G)` has already been precomputed, it can be supplied as an argument to avoid potentially costly recomputaiton.
36
+
If the `gap = nugap(G)` has already been precomputed, it can be supplied as an argument to avoid potentially costly recomputation.
0 commit comments