560 C H A P T E R 9: The Z-Transform
and the second derivative as
d^2 vc(t)
dt^2
=
ddvdtc(t)
dt
≈
d(vc(t)−vc(t−Ts))/Ts)
dt
≈
vc(t)− 2 vc(t−Ts)+vc(t− 2 Ts)
Ts^2
which when replaced in the differential equation, and computing the resulting equation fort=
nTs, gives
(
1
T^2 s
+
1
Ts
+ 1
)
vc(nTs)−
(
2
Ts^2
+
1
Ts
)
vc((n− 1 )Ts)+
(
1
T^2 s
)
vc((n− 2 )Ts)=vs(nTs)
Although we know that we need to choose a very small value forTsto get a good approx-
imation to the exact result, for simplicity let us first set Ts=1, so that the difference
equation is
3 vc[n]− 3 vc[n−1]+vc[n−2]=vs[n] n≥ 0
For zero initial conditions and unit-step input, we can recursively compute this equation to get
vc[0]= 1 / 3
vc[n]= 1 n→∞
A closed-form solution can be obtained using the Z-transform, giving (assuming zero initial
conditions)
[3− 3 z−^1 +z−^2 ]Vc(z)=
1
1 −z−^1
so that
Vc(z)=
z^3
(z− 1 )( 3 z^2 − 3 z+ 1 )
from which we obtain that there is a triple zero atz=0, and poles at 1 and−0.5±j
√
3 /6. The
partial fraction expansion will be of the form
Vc(z)=
A
1 −z−^1
+
B
1 +(0.5+j
√
3 / 6 )z−^1
+
B∗
1 +(0.5−j
√
3 / 6 )z−^1
Since the complex poles are inside the unit circle, the steady-state response is due to the input that
has a single pole at 1 (i.e., the steady state is limn→∞vc[n]=A=1).
We first use the symbolic MATLAB functionsilaplaceandezplotto find the exact solution of the dif-
ferential equation. We then sample the input signal using a sampling periodTs=0.1 sec and
use the approximations of the first and second derivatives to obtain the difference equation,
which is computed usingfilter. The results are shown in Figure 9.12. The exact solution of the