Hello again,
Here is a complete numerical example.
We want to look at a system as the gain changes so we can tell if the system will become unstable.
The system block diagram:
Code:
+
Vin >---O--->--S----ZOH----Gs----+--->Vout
|- |
| |
+--------<---------------+
(Note the system has negative feedback as shown by the minus sign)
O = summing junction with one plus and one minus input
S = sampler
ZOH = zero order hold
Gs = G(s) = K/(s*(s+1))
and we want to look at stability as the gain K is varied.
The z transform of G(s) with unit impulse and sampling period of 1 second is:
G(z)=K*(0.36787944025834*z+0.26424111948332)/(z^2-1.367879441171442*z+0.36787944117144)
If the system is stable the roots of 1+G(z)=0 all lie within the unit circle, so
we compute 1+G(z)=0 for various gains.
With K=1 we have:
1+G(z)=0
where G(z) evaluates to:
(0.36787944025834*z+0.26424111948332)/(z^2-1.367879441171442*z+0.36787944117144)+1=0
which simplifies to:
z^2-z+0.63212056394153=0
which has two roots:
z=0.61815901185822*j+0.5, z=0.5-0.61815901185822*j
which have two amplitudes:
0.79506010083611, and 0.79506010083611
which are both less than 1, so the system with gain K=1 is stable.
Now we do the same thing with K=10.
With K=10 we have:
1+G(z)=0
where G(z) now evaluates to:
(3.6787944025834*z+2.6424111948332)/(z^2-1.367879441171442*z+0.36787944117144)+1=0
which simplifies to:
z^2+2.310914925501759*z+3.01029067709018=0
which has two roots:
z=1.294298547037537*j-1.155457462750879, and z=-1.294298547037537*j-1.155457462750879
which have two amplitudes:
1.735018927012089, and 1.735018927012089
which are both greater than 1, so this system has now become unstable.
Since we moved from a system that was stable to a system that was unstable when we varied the gain from K=1 to K=10, we can assume that the system becomes unstable somewhere between K=1 and K=10. We can compute more roots with other values of K such as K=5 and try to determine when we are close to the value of K that causes the system to transition from stable to unstable, or we can plot the roots.
If we were to plot more roots we would find that the system becomes unstable near
the point where K becomes equal to approximately 2.4.
Computing the roots with K=2.39 we get the roots:
z=0.96939239056609*j+0.24432379944186, and z=0.24432379944186-0.96939239056609*j
which have amplitudes:
0.99970782024607, and 0.99970782024607
where we can see they are both pretty close to 1 now so the system is very close to being unstable. If we compute the roots with K=2.40 we would find that the system again becomes unstable. Thus, the roots move outside the unit circle near the point where K=2.4 approximately.
This means there would have to be some way to ensure that the gain of G(s) could not get too close to 2.4 or else this system would go unstable.
We could also go back and try a shorter sampling time period.