using ControlSystemsBase , PlutoUI , Plots
Bode primitives demo
md"""# Bode primitives demo"""
Type 2 terms
Recall that the Type 2 terms look like:
$$\left( 1 + j \omega \tau \right)^{ \pm 1} $$
The slider below allows you to change $\tau$ while the checkbox lets you change the sign of the exponent.
Change $\tau$:
Flip sign:
md"""## Type 2 terms
Recall that the Type 2 terms look like:
```math
\left( 1 + j \omega \tau \right)^{ \pm 1}
```
The slider below allows you to change $\tau$ while the checkbox lets you change the sign of the exponent.
Change $\tau$: $(@bind τ_2 Slider(0.01:0.01:10, show_value=true))
Flip sign: $(@bind inv_typ2 CheckBox(default=true))
"""
begin
type2_numerator = [1]
w = 10 .^ range(-2,3,length=1000)
# typ2sys(w) = 1/(1+τ_2*w*im)
# plot(w, angle.(typ2sys.(w)), xaxis=:log)
end
Type 3 terms
Recall that Type 3 terms are of the form:
$$\left[ \left( \dfrac{j\omega}{\omega_n} \right)^2 + 2 \zeta \left( \dfrac{j\omega}{\omega_n} \right) + 1 \right] ^{\pm n}$$
Here we get to vary $\omega_n$ and $\zeta$.
Change $\zeta$:
Change $\omega_n$:
md""" ## Type 3 terms
Recall that Type 3 terms are of the form:
```math
\left[ \left( \dfrac{j\omega}{\omega_n} \right)^2 + 2 \zeta \left( \dfrac{j\omega}{\omega_n} \right) + 1 \right] ^{\pm n}
```
Here we get to vary $\omega_n$ and $\zeta$.
Change $\zeta$: $(@bind ζ Slider(0.01:0.01:0.5, show_value=true))
Change $\omega_n$: $(@bind ω Slider(0.5:0.01:50, show_value=true))
"""
begin
type3_numerator = [1]
end