0.3 Analog or Discrete? 19
bevi(t)=1 fort≥0, we have
vc(nT)=
{
0 n= 0
2 T
2 +T+
2 −T
2 +Tvc((n−^1 )T) n≥^1
(0.13)
The advantage of the difference equation is that it can be solved for increasing values ofnusing
previously computed values ofvc(nT), which is called arecursive solution. For instance, lettingT=
10 −^3 ,vi(t)=1, and definingM= 2 T/( 2 +T),K=( 2 −T)/( 2 +T), we obtain
n= 0 vc( 0 )= 0
n= 1 vc(T)=M
n= 2 vc( 2 T)=M+KM=M( 1 +K)
n= 3 vc( 3 T)=M+K(M+KM)=M( 1 +K+K^2 )
n= 4 vc( 4 T)=M+KM( 1 +K+K^2 )=M( 1 +K+K^2 +K^3 )
···
The values areM= 2 T/( 2 +T)≈T= 10 −^3 ,K=( 2 −T)/( 2 +T) <1, and 1−K=M. The response
increases from the zero initial condition to a constant value, which is the effect of the dc source—the
capacitor eventually acts as an open circuit, so that the voltage across the capacitor equals that of
the input. Extrapolating from the above results it seems that in the steady-state (i.e., whennT→∞)
we have^5
vc(nT)=M
∑∞
m= 0
Km=
M
1 −K
= 1
Even though this is a very simple example, it clearly illustrates that very good approximations to the
solution of differential equations can be obtained using numerical methods that are appropriate for
implementation in digital computers.
The above example shows how to solve a differential equation using integration and approximation of the
integrals to obtain a difference equation that a computer can easily solve. The integral approximation used
above is thetrapezoidal rulemethod, which is one among many numerical methods used to solve differential
equations. Also we will see later that the above results in thebilinear transformation, which connects the
Laplacesvariable with thezvariable of the Z-transform, and that will be used in Chapter 11 in the design of
discrete filters.
(^5) The infinite sum converges if|K|<1, which is satisfied in this case. If we multiply the sum by( 1 −K)we get
( 1 −K)
∑∞
m= 0
Km=
∑∞
m= 0
Km−
∑∞
m= 0
Km+^1
= 1 +
∑∞
m= 1
Km−
∑∞
= 1 K
= 1
where we changed the variable in the second equation to`=m+1. This explains why the sum is equal to 1/( 1 −K).