Abstract

In signal processing, a pulse means a rapid change in the amplitude of a signal from a baseline value to a higher or lower value, followed by a rapid return to the baseline value. A square wave function may be viewed as a pulse that repeats its occurrence periodically but the return to the baseline value takes some time to happen. When these periodic functions act as inputs in dynamic systems, the standard tool commonly used to solve the associated initial value problem (IVP) is Laplace transform and its inverse. We show how a computer algebra system may also provide the solution of these IVP straight forwardly by adequately introducing the periodic input.

1. Introduction

Linear differential equations where is a known input and is the -order linear differential operator, are easily solved when it has got constant coefficients , the roots of the homogeneous associated equation are known, and the input is an adequate combination of exponential, cosine, sine, and polynomial functions.

A different situation arises when, even the coefficients being constants, the input is a periodic function which may fail to be continuous or may be formed by a sequence of pulses. In this case, two widely used methods to handle the problem are Fourier series and Laplace transforms [1, 2]. Both methods require to know their properties which on the other hand are highly rewarding since they can help to solve some partial differential equations, too.

The proliferation in the use of computer algebra systems has facilitated and fastened obtaining some of these solutions. In this note, we show how some of them, namely DERIVE [3], may directly provide the solution of first- and second-order differential equations in the presence of periodic inputs.

2. Generating Periodic Functions

Let us recall that a function is called periodic with period if for all in the domain of the function . Geometrically, this means that the graph of repeats itself every units. Periodic functions do appear in a number of real-life situations such as alternating currents, the motion of a pendulum, vibrations of a spring, and sound waves, just to mention a few of them.

Computer algebra systems allow an easy representation of periodic functions since they have usually got an implemented command which enables to find the remainder on an integer division of two real numbers. With this goal, assume that we have a given function defined in and is to generate a -periodic function, which repeats the values of in successive intervals of length . Then, if DERIVE is the handy program, it will generate by just substituting the variable of by [4] MATHEMATICA [5] and MATLAB [6] programs enjoy similar capabilities by means of their corresponding commands (cf. [7]).

Example 2.1. Represent the -periodic function generated as a full-wave rectified sinusoid such that

Solution 1. The DERIVE program enables to introduce by writing Simplifying the above expression and plotting the generated function, we obtain the graph that appears in Figure 1.

A similar graph is obtained with MATHEMATICA by introducing Plot(Sin(Mod(Pi, 0)), , PlotRange ), and with MATLAB by setting, ezplot.

From now on, we will focus on DERIVE which has also got a useful CHI function that is equally to in and vanishes outside this interval.

Example 2.2. Represent the -periodic function such that

Solution 2. Having in mind the above, we just have to introduce Simplifying the above expression and plotting the generated function, we obtain the graph that appears in Figure 2.

Finally and for the sake of completeness, let us recall the following result which justifies that ext is a -periodic function which coincides with on . Its easy proof follows immediately noting that if for each real number denotes integer part function, that is, equals the integer number such that then for .

Lemma 2.3. If is a real-valued function defined over , then is a -periodic function defined over that coincides with in .

3. Initial Value Problems with Periodic Inputs

Let us now recall some DERIVE commands that enable to solve first- and second-order linear differential equations. Given a linear differential equation written in the form the command LINEAR1_GEN provides the general solution in terms of the symbolic constant The command LINEAR1 simplifies to the explicit solution for the initial condition at , there being other available commands for other specific kinds of differential equations (cf. [8]).

Let us also recall that DSOLVE2 provides the general solution of the second-order linear differential equation in terms of the symbolic constants and Analogously, is simplified to the explicit solution for the boundary value conditions at , and at , and to the explicit solution for the initial value conditions at , and at .

Next, we provide an example of a first- (and another of a second-) order linear differential equation with periodic inputs and show how the aforementioned commands can cope with periodic inputs.

Example 3.1. Considering as input the function of Example 2.2, solve

Solution 3. Let us combine the aforementioned implemented functions with the function defined in Example 2.2 by The general integral is obtained by simplifying Hence, we obtain the solution (note that the following expression giving is not corrupted. It is included exactly in the way provided by the computer algebra system since it has got a long fraction and its terms are continuously written throughout different lines), graph001(3.7) Making take a finite set of values, we get the corresponding particular solutions, for example, with the integer values between and 10, we obtain 21 particular solutions whose graphs are depicted in Figure 3.

In what concerns second-order differential equations, let us recall that the forced motion of a mass attached to a vibrating spring with damping constant and spring constant is modeled by where is an external force acting upon When the external force is identically equal to zero, the motion is called a free motion and it is well known that its solution (underdamped, critically damped, or overdamped) depends very heavily upon the nature of the characteristic roots. Next, we solve a problem where the external force is a wave square function (see [9, pages 336–341]).

Example 3.2. A mass of  g is attached to the end of a spring with  dyn/cm and the air resistance acts upon the mass with a force that is times its velocity at time . The mass has got no motion at its equilibrium position when it is subjected to an external periodic force equal to a square wave function of amplitude cm. Find the position of the mass.

Solution 4. In this case, the position is set by the initial value problem where is the -periodic depicted in Example 2.2. Thus the position is obtained by simplifying The solution provided by the computer algebra system (remember that long fraction terms are continuously written throughout different lines) is the following one, graph002(3.11) Its graph is plotted in Figure 4.

4. Conclusion

Laplace transform is an important tool classically used to solve initial value problems in the presence of a periodic external force. For its adequate use, properties of direct and inverse Laplace transforms are required and they are extensively studied in many textbooks.

In this paper, we have seen how DERIVE enables to avoid this in a very simple way. This is achieved by using its standard routines that provide the general solution of a differential equation and the exact solution of a given initial value problem, along with the possibility of handling periodic functions by means of its MOD command.

Finally, DERIVE facilitates to plot the solution and its evaluation at a given point if desired.

Acknowledgments

This work is supported by Spanish Ministry of Education projects MTM2005-01182 and DPI2005-08732-C02-01, with FEDER funds. The authors are grateful to the reviewers for their useful suggestions.