Page 48 -
P. 48

In-Class Exercise
                                                                               th
                             Pb. 2.5 Write a program to draw the Koch curve at the k  step. (Hint: Start-
                             ing with the farthest left vertex and going clockwise, write a difference equa-
                             tion relating the coordinates of a vertex with those of the preceding vertex,
                             the length of the segment, and the angle that the line connecting the two con-
                             secutive vertices makes with the x-axis.)








                             2.4  Solution of Linear Constant Coefficients Difference
                                  Equations

                             In Section 2.1, we explored the general numerical techniques for solving dif-
                             ference equations. In this section, we consider, some special techniques for
                             obtaining the analytical solutions for the class of linear constant coefficients
                             difference equations. The related physical problem is to determine, for a lin-
                             ear system, the output y(k), k > 0, given a specific input u(k) and a specific set
                             of initial conditions. We discuss, at this stage, the so-called direct method.
                              The general expression for this class of difference equation is given by:

                                                                M
                                                   N
                                                  ∑  ay k( −  j) = ∑ b u k( −  m)          (2.20)
                                                      j
                                                                   m
                                                  j=0          m=0
                             The direct method assumes that the total solution of a linear difference equa-
                             tion is the sum of two parts — the homogeneous solution and the particular
                             solution:

                                                   y(k) = y homog. (k) + y partic. (k)     (2.21)

                             The homogeneous solution is independent of the input u(k), and the RHS of
                             the difference equation is equated to zero; that is,

                                                        N
                                                       ∑   ay k( −  j) = 0                 (2.22)
                                                            j
                                                        j=0


                             2.4.1    Homogeneous Solution
                             Assume that the solution is of the form:




                             © 2001 by CRC Press LLC
   43   44   45   46   47   48   49   50   51   52   53