EDITOR: B. SOMANATHAN
NAIR
1. INTRODUCTION
In
many of the engineering problems, we come across first and second order differential
and difference equations. Hence, we must have a thorough knowledge of how to
solve them. This blog deals with the method of solving first-order differential
and difference equations.
Consider Fig. 1, which shows a straight line passing
through the origin. The slope of this
line is given by the equation
m =
tan α = y/t (1)
The
slope m can be found to be a constant
in this case since both y and t are constants. Once we know the value
of m, we can get the function y
back from Eq. (1) as
y =mt (2)
Next consider Fig. 2, which shows a
slowly (or, gradually) varying curve. In this case, as shown in the figure, the
slope is varying in short segments of straight lines. Hence the value of m is constant during these small
segments only. It can be seen that the value of m varies from segment to segment. In this condition, we can express
the function as a difference equation
in the form
m = Δy/Δt
(3)
where
Δt is a small interval of time over which the
slope remains constant and Δy is the
change in the function y over this
interval. From Eq. (3), we can get the function Δy back by using the equation
Δy
= m Δt (4)
Equation
(4) gives the value Δy of one segment
only. For finding out the total value of y,
we have to add (or sum up) the values of Δy’s
of all the individual segments. Thus, we obtain
y = m1 Δt
+ m2 Δt + ···+ mn Δt = ∑I =1n
mi Δt (5)
where
m1, m2, …, mn
represent the slopes of the individual segments. Equation (5) is the
general form of difference equation.
As a final step in this discussion, let us consider
Fig. 3, which shows a continuously varying curve exhibiting a continuously
varying slope m. We can express this
type of continuous variation in the form of a differential equation:
m
= dy/dt (6)
where
dt represents an infinitesimally
small (tending to zero) interval of time and dy represents the corresponding change in amplitude y. From Eq. (6), we can get back the
elemental function dy as
dy = m
dt (7)
From
Eq. (7), we get the function y back
from dy using the integral
y
= ∫m dt (8)
We know that the dynamic behavior of an analog system
is governed by one or more differential equations. By dynamic behavior of a
system, we mean the behavior of the system under actual loading or operating
conditions.
The purpose of this blog is to
introduce a few typical methods by which differential and difference equations
can be solved systematically. For this, we first discuss the methods of solving
differential equations, and then extend the principles evolved therein for the
solution of difference equations. In this text, we shall be dealing with the
first- and second-order differential and difference equations only.
2. DIRECT
SOLUTION OF FIRST-ORDER DIFFERENTIAL EQUATIONS
Consider the first-order
differential equation
dy/dt
+ py = q (9)
where
y = y(t) is a function of
time and p and q are constants.
The solution of Eq. (9) has two parts. One part of
the solution is known as the transient solution
(also known as complementary function), and the other part is known
as the steady-state solution (also known as
particular integral). The
transient part is governed by the differential equation
dy/dt
+ py = 0 (10)
using the variable-separable
method, we find
dy/y = ‒pdt (11)
Integrating both sides of
Eq. (2.11) produces the result
ln y
= ‒pt + ln A (12)
where
ln A is the constant of integration.
Rearranging Eq. (12), we get
ln (y/A)=
‒pt (13)
Taking
antilog of Eq. (13) yields the transient solution as
ytrans
= A exp(‒pt) (14)
The solution given by Eq. (14) represents the
functioning of the system immediately after it has been switched-on.
After the transient situation dies
out, the system enters into its steady-state condition. The second part of the
solution shows this condition. This solution can be obtained from the knowledge
of the steady-state condition of the system. We can also find the solution
using an expression, which can be derived as follows.
Consider Eq. (9) again. Multiply both sides of this
equation by exp (At), which yields
exp
(pt) (dy/dt) + py[exp (pt)] = q [exp (pt)] (15)
We find that the LHS can be
represented as d[y exp (pt)]/dt, because
d[y exp (pt)]/dt = exp (pt)(dy/dt) + py [exp (pt)] (16)
Using
the LHS of Eq. (16), we replace the expression on the LHS of Eq. (15) yields
d[y exp (pt)]/dt = q exp (pt) (17)
Integrating both sides of Eq. (17) gives
y exp (pt) =
∫q exp (pt) dt + A (18)
where
A is a constant of integration.
Multiplying both sides of Eq. (18) with the expression exp (‒pt)], we get
y = exp (‒pt)∫q
exp (pt) dt + A exp (‒pt) (19)
Equation
(19) gives the complete solution of a first-order differential equation. The
complete solution can be seen to contain two parts. The first part on the RHS,
viz., exp (‒pt)∫q exp (pt) dt,
gives the steady-state solution and the second part, viz., A exp (‒pt), gives the transient solution.
Example 1: Obtain the solution of the equation
dy/dt + 3y = 5 (i)
Solution: Comparing Eqs. (9) and (i), we find p = 3 and q = 5. Therefore, using the solution given in Eq. (19), we obtain
y = exp (‒3t)∫5 exp (3t) dt + A exp (‒3t) (ii)
Solving Eq. (ii) yields
y = 5/3 + A
exp (‒3t) = 5/3 + Ae‒3t (iii)
where
5/3 is the steady-state solution and Ae‒3t is the transient solution. and By knowing the initial conditions, we can
evaluate the constant A. A similar
method may be used for the solution of first-order difference equations.
3. DIRECT SOLUTION OF
FIRST-ORDER DIFFERENCE EQUATIONS
Consider the first-order difference
equation
y(n)
‒ ay(n‒1) = x(n), a
< 1 (20)
In
Eq. (20), y(n) represents the output function, y(n‒1) represents y(n)
delayed by one unit time interval, and x(n) represents the input function. It may
be noted that y(n‒1) is equivalent to dy/dt, since differentiation of the function
y(n)
means delaying it by one unit of time. Similarly, we find that y(n‒2)
is equivalent to d2y/dt2,
y(n‒3)
is equivalent to d3y/dt3,
and so on. The term a is an arbitrary
constant whose value is chosen to be less than unity in Eq. (20).
Now, to get the transient part of
the solution of Eq. (20) we assume that at n
= 0, ay(n‒1) = 0. we also assume that the input at n = 0 is an impulse function and it is this impulse that produces
transient in the system. Thus, x(0) =
d(0) = 1, where d(0) is an impulse function at t = 0. Using these
assumptions, we find from Eq. (20) that
y(0)
= 1 (21)
Now,
when n = 1, using Eqs. (20) and (21),
we obtain
y(1)
= ay(1‒1) = ay(0) = a (22)
Following
the procedure given above, when n =
2, we have
y(2)
= ay(2‒1) = ay(1) = a2 (23)
and
when n = 3,
y(3)
= ay(2‒1) = ay(1) = a3 (24)
This
may be generalized to yield the transient solution
y(n) = ay(n‒1) = anu(n) (25)
where
u(n)
is unit step function. Multiplication of an
by u(n) indicates that an varies
from 0 to ∞ (i.e., only positive values). Incorporating the constant of
integration in the solution, we find the transient solution as
ytr(n) = Aanu(n)
(26)
We
find that the solution given by Eq.(26) is similar to the transient solution
given in Eq. (iii) of Example 1, where we have replaced an with e‒3t. In mathematics this is called homogeneous solution. The particular
(steady-state) solution is obtained depending on the applied forcing function.
The following example illustrates this idea.
Example 2: Obtain the solution of the difference
equation
y(n) ‒ (½)y(n‒1) = u(n)
(i)
Solution: The transient part of the solution is
ytr(n) = A(½)nu(n) (ii)
To get the steady-state solution, we
find that the forcing function on the right-hand side of Eq. (i) is the constant
u(n)
= 1. So, assuming that in the steady-state condition the system will reach a
constant or fixed value, let us choose y(n) = K,
another constant. Then, from Eq. (i), we find
K‒ (1/2) K = u(n)
= 1 (iii)
where we have used y(n
– 1) also equal to K. Equation (iii)
gives the value of K as
K
= 2 = yss(n)
(iv)
Using this, we get the total
solution as
y(n)
= yss(n) + ytr(n) = A(½)nu(n) + 2 (v)
(5)
To evaluate A,
from Eq. (i) we find y(0) = 1, since
at n = 0, u(0) = 1. Using this in Eq. (v), we get
y(0)
= 1 = A+2 (vi)
From Eq. (vi), we find
A
= ‒1 (vii)
Thus the complete solution
is
y(n) =2 ‒ (½)nu(n) (viii)
In the next blog, we shall discuss the
solutions of second-order differential equations.