An example of obtaining a second-order difference equation. Differential equations for dummies

Systems whose input and output sequences and are connected by a linear difference equation with constant coefficients form a subset of the class of linear systems with constant parameters. The description of LPP systems by difference equations is very important, since it often allows one to find efficient ways to construct such systems. Moreover, many characteristics of the system under consideration can be determined from the difference equation, including natural frequencies and their multiplicity, system order, frequencies corresponding to zero gain, etc.

In the most general case, a linear difference equation of the th order with constant coefficients related to a physically realizable system has the form

(2.18)

where the coefficients and describe a specific system, and . How exactly the order of the system characterizes the mathematical properties of the difference equation will be shown below. Equation (2.18) is written in a form convenient for solving by the direct substitution method. Having a set of initial conditions [for example, , for ] and the input sequence , by formula (2.18) one can directly calculate the output sequence for . For example, the difference equation

(2.19)

with the initial condition and can be solved by substitution, which gives

Although the solution of difference equations by direct substitution is useful in some cases, it is much more useful to obtain the solution of the equation in an explicit form. Methods for finding such solutions are covered in detail in the literature on difference equations, and only a brief overview will be given here. The main idea is to obtain two solutions to the difference equation: homogeneous and partial. A homogeneous solution is obtained by substituting zeros for all terms containing elements of the input sequence and determining the response when the input sequence is zero. It is this class of solutions that describes the main properties of the given system. A particular solution is obtained by selecting the type of output sequence for a given input sequence . Initial conditions are used to determine arbitrary constants of a homogeneous solution. As an example, we solve equation (2.19) by this method. The homogeneous equation has the form

(2.20)

It is known that the characteristic solutions of homogeneous equations corresponding to linear difference equations with constant coefficients are solutions of the form . Therefore, substituting into equation (2.20) instead of , we obtain

(2.21)

We will try to find a particular solution corresponding to the input sequence in the form

(2.22)

From equation (2.19) we get

Since the coefficients at equal powers must match, B, C and D must be equal

(2.24)

Thus, common decision has the form

(2.25)

The coefficient is determined from initial condition, from where and

(2.26)

A selective check of the solution (2.26) for shows its complete coincidence with the direct solution given above. The obvious advantage of solution (2.26) is that it makes it very easy to determine for any particular .

Fig. 2.7. Scheme for the implementation of a simple difference equation of the first order.

The importance of difference equations is that they directly determine the method of constructing digital system. Thus, a first-order difference equation of the most general form

can be implemented using the circuit shown in Fig. 2.7. The "delay" block delays by one sample. The considered form of system construction, in which separate delay elements are used for the input and output sequences, is called direct form 1. Below we will discuss various methods for constructing this and other digital systems.

Difference equation of the second order of the most general form


Fig. 2.8. Scheme for the implementation of the second-order difference equation.

can be implemented using the circuit shown in Fig. 2.8. This scheme also uses separate delay elements for the input and output sequences.

It will become clear from the subsequent presentation of the material in this chapter that first and second order systems can be used in the implementation of higher order systems, since the latter can be represented as first and second order systems connected in series or in parallel.

Solution of ordinary linear difference equations

with constant coefficients

The relationship between the output and input of a linear discrete system can be described by an ordinary linear difference equation with constant coefficients

,

Where y[n]- output signal at the moment n,

x[n]- input signal at the moment n,

a i ,b k are constant coefficients.

Two methods can be used to solve such equations.

  • direct method,
  • Method Z - transformations.

Let us first consider the solution of a linear difference equation using the direct method.

The general solution of an inhomogeneous (with a nonzero right-hand side) linear difference equation is equal to the sum o general solution linear homogeneous difference equation and private decision inhomogeneous equation

The general solution of the homogeneous difference equation ( zero-inputresponse) y h [n]

defined as

.

Substituting this solution into the homogeneous equation, we obtain

Such a polynomial is called characteristic polynomial systems. He has N roots . Roots can be real or complex, and some roots can be coinciding (multiple).

If the roots are real and different, then the solution of the homogeneous equation has the form

where coefficients

If some root, for example, λ1 has multiplicity m, then the corresponding term of the solution takes the form

If all the coefficients of the homogeneous equation and, respectively, of the characteristic polynomial are real, then the two terms of the solution corresponding to simple complex conjugate roots can be represented (written) in the form , while the coefficients A,B determined by the initial conditions.

Type of private decision y p [n] equation depends on the right side (input signal) and is determined according to the table below

Table 1. Type of particular solution for different character of the right side

Input signalx[n]

Private decisionyp[n]

A(constant)

The solution of a linear difference equation by the Z-transformation method consists in applying Z– transformations to the equation using the properties of linearity and time shift. The result is a linear algebraic equation with respect to Z- images of the desired function. Reverse Z– the transformation gives the desired solution in the time domain. To obtain the inverse Z-transformation, the decomposition of a rational expression into simple (elementary) fractions is most often used, since the inverse transformation from a separate elementary fraction has a simple form.

Note that other methods for calculating the inverse Z-transform can also be used to move to the time domain.

Example. Let us determine the response (output signal) of the system described by the linear difference equation , to the input signal

Solution.

1. Direct method for solving the equation.

Homogeneous Equation. Its characteristic polynomial is .

Polynomial roots .

Solution of a homogeneous equation.

Since, then we define a particular solution in the form .

Substitute it into the equation

To find a constant TO accept n=2. Then

Or, K=2.33

Hence the particular solution and the general solution of the difference equation (1)

Let's find constants From 1 And From 2. For this we put n=0, then from the original difference equation we obtain . For this equation

That's why . From expression (1)

Hence,

.

From expression (1) for n=1 we have .
We get the following two equations for C 1 and C 2

.

The solution of this system gives the following values: C 1 =0.486 and C 2 = -0.816.

Therefore, the general solution of this equation

2. Solution by the Z-transformation method.

Take Z - transformation from the original difference equation , taking into account the property (theorem) of the time shift . We get

Control questions:

1. What is the grid function?

2. What equation is called a difference equation?

3. What equations are called difference equations of the 1st order?

4. How is the general solution of the inhomogeneous difference equation of the 1st order found?

5. What solution of the difference equation is called fundamental?

6. Why does the general solution of a homogeneous equation with constant coefficients look like a geometric progression?

Tasks.

1. Write a procedure for solving a first-order difference equation with the initial condition .

2. For a given equation, find the general and particular solutions analytically.

3. Compare the results of calculations by the recursive formula with the analytical solution.

4. Find out how the perturbation of the initial condition, the coefficients of the equation, the right side affects the result.

Directions

Let us find the general solution of the difference equation of the 1st order

. (1)

We obtain a particular solution of the homogeneous equation for using the recursive formula: . Since the value of Y at each next node of the grid is doubled, it turns out geometric progression with denominator q=2:

We find a particular solution of the inhomogeneous equation in the form: , where A is an indefinite coefficient. Then , , and, equating the obtained value to the given right side, we find the indefinite coefficient A=. Finally, the general solution: .

Using the initial condition , we find the constant: . Finally, a particular solution for a given initial condition:

.

To study the stability of the solution to a perturbation of the solution itself and the initial condition, consider the following equation:

with perturbed initial condition

(here is the magnitude of the perturbation). Subtracting the original equation (1), we obtain the difference equation for the perturbation:

with initial condition . The solution to this equation is: , i.e. even a small perturbation at any node grows exponentially with increasing number of the node.

The student needs to illustrate the above: to investigate the influence of perturbations of the initial condition, right-hand sides and coefficients of the equation by changing the recursive formula.

The option, in accordance with the number of the student on the list in the journal, must be solved in the C ++ programming language (the use of the Builder environment is allowed) or Pascal (the use of the Delphi environment is allowed).

  1. Recursive formula for obtaining a numerical solution.
  2. Analytical solution of the difference equation. General solution and a particular solution that satisfies the given initial conditions.
  3. Investigate the stability of the solution to a perturbation of the initial condition and the solution analytically.

b) when the coefficients of the equation are perturbed;

c) when the right side is perturbed.


Topic: 2nd order difference equations

Control questions:

1. What equations are called 2nd order difference equations?

2. What is a characteristic equation?

3. What does a particular solution of a homogeneous 2nd order difference equation with real roots of the characteristic equation look like?

4. What does a particular solution of a homogeneous 2nd order difference equation with complex roots of the characteristic equation look like?

5. How is the general solution of an inhomogeneous difference equation of the 2nd order found?

6. What is the numerical and analytical solution of the 2nd order difference equation?

7. What tasks are called well-conditioned?

Tasks

1. Write a procedure for solving a difference boundary value problem for a second order equation with boundary conditions , .

2. For a given equation, find a general and a particular solution analytically and check the conditionality criterion.

3. Compare the results of calculations by the recursive formula with the analytical solution.

4. Find out how the perturbation of the boundary conditions and the right side affects the result.

Let's find the general solution of the difference equation of the 2nd order can be found by choosing arbitrary constants .

Along with the Cauchy problems, two-point boundary-value problems are also considered for second-order equations, in which the values ​​of the grid function are given at two nodes located not in a row, but at the ends of some finite segment: (border conditions ). An analytical solution of such a problem can be obtained by an appropriate choice of arbitrary constants in the general solution. However, unlike the problem with initial conditions, the boundary value problem will not necessarily be uniquely solvable. That's why great importance has an elucidation of a class of boundary value problems that have unique solvability and weak sensitivity to perturbation (due to rounding errors) of the right-hand sides and boundary conditions. We will call such tasks well conditioned

Consider an example of an ill-conditioned boundary value problem

  1. Formulation of the problem. Initial difference equation and boundary conditions.
  2. Procedure for obtaining a numerical solution.
  3. Analytical solution of a difference boundary value problem. General solution and a particular solution that satisfies the given boundary conditions. Checking the conditionality criterion.
  4. Graphs of the numerical solution and the analytical solution (in the same axes).
  5. Graph of the difference between the numerical and analytical solutions.
  6. Charts perturbed numerical solutions and the difference between the perturbed and unperturbed solutions:

a) when the initial condition is perturbed;

b) when the right side is perturbed.

  1. Conclusion about the conditionality of the boundary value problem.

Introduction

In recent decades mathematical methods more and more insistently penetrate into humanitarian sciences and in particular the economy. Through mathematics and effective application one can hope for economic growth and prosperity of the state. effective, optimal development impossible without the use of mathematics.

The purpose of this work is to study the application of difference equations in the economic sphere of society.

The following tasks are set before this work: definition of the concept of difference equations; consideration of linear difference equations of the first and second order and their application in economics.

When working on a course project, materials available for study were used teaching aids on economics, mathematical analysis, works of leading economists and mathematicians, reference publications, scientific and analytical articles published in Internet publications.

Difference Equations

§1. Basic concepts and examples of difference equations

Difference equations play an important role in economic theory. Many economic laws are proved using precisely these equations. Let us analyze the basic concepts of difference equations.

Let time t be the independent variable, and let the dependent variable be defined for time t, t-1, t-2, etc.

Denote by the value at time t; through - the value of the function at the moment shifted back by one (for example, in the previous hour, in the previous week, etc.); through - the value of the function y at the moment shifted back by two units, etc.

The equation

where are constants, is called an n-th order difference inhomogeneous equation with constant coefficients.

The equation

In which =0, is called a difference homogeneous equation of the n-th order with constant coefficients. To solve an n-th order difference equation means to find a function that turns this equation into a true identity.

A solution in which there is no arbitrary constant is called a particular solution of the difference equation; if the solution contains an arbitrary constant, then it is called a general solution. The following theorems can be proved.

Theorem 1. If the homogeneous difference equation (2) has solutions and, then the solution will also be the function

where and are arbitrary constants.

Theorem 2. If is a particular solution of the inhomogeneous difference equation (1) and is the general solution of the homogeneous equation (2), then the general solution of the inhomogeneous equation (1) will be the function

Arbitrary constants. These theorems are similar to theorems for differential equations. A system of first-order linear difference equations with constant coefficients is a system of the form

where is a vector of unknown functions, is a vector of known functions.

There is a matrix of size nn.

This system can be solved by reducing to an n-th order difference equation by analogy with solving a system of differential equations.

§ 2. Solution of difference equations

Solution of the difference equation of the first order. Consider the inhomogeneous difference equation

The corresponding homogeneous equation is

Let's check if the function

solution of equation (3).

Substituting into equation (4), we obtain

Therefore, there is a solution to equation (4).

The general solution of equation (4) is the function

where C is an arbitrary constant.

Let be a particular solution of the inhomogeneous equation (3). Then the general solution of the difference equation (3) is the function

Let's find a particular solution of the difference equation (3) if f(t)=c, where c is some variable.

We will look for a solution in the form of a constant m. We have

Substituting these constants into the equation

we get

Therefore, the general solution of the difference equation

Example1. Using the difference equation, find the formula for the increase in the monetary deposit A ​​in the Savings Bank, put at p% per annum.

Solution. If a certain amount is deposited in the bank at compound interest p, then by the end of the year t its amount will be

This is a first-order homogeneous difference equation. His decision

where C is some constant that can be calculated from the initial conditions.

If accepted, then C=A, whence

This is a well-known formula for calculating the growth of a cash deposit placed in a savings bank at compound interest.

Solution of a second-order difference equation. Consider the inhomogeneous second-order difference equation

and the corresponding homogeneous equation

If k is the root of the equation

is a solution of the homogeneous equation (6).

Indeed, substituting into the left side of equation (6) and taking into account (7), we obtain

Thus, if k is the root of equation (7), then is the solution of equation (6). Equation (7) is called the characteristic equation for equation (6). If the discriminant characteristic equation (7) is greater than zero, then equation (7) has two different real roots and, and the general solution of the homogeneous equation (6) has the following form.

Often, the mere mention of differential equations makes students feel uncomfortable. Why is this happening? Most often, because when studying the basics of the material, a gap in knowledge arises, due to which the further study of diffurs becomes simply torture. Nothing is clear what to do, how to decide where to start?

However, we will try to show you that diffuses are not as difficult as they seem.

Basic concepts of the theory of differential equations

From school, we know the simplest equations in which we need to find the unknown x. In fact differential equations only slightly different from them - instead of a variable X they need to find a function y(x) , which will turn the equation into an identity.

Differential Equations are of great practical importance. This is not abstract mathematics that has nothing to do with the world around us. With the help of differential equations, many real natural processes are described. For example, string vibrations, the movement of a harmonic oscillator, by means of differential equations in the problems of mechanics, find the speed and acceleration of a body. Also DU are widely used in biology, chemistry, economics and many other sciences.

Differential equation (DU) is an equation containing the derivatives of the function y(x), the function itself, independent variables and other parameters in various combinations.

There are many types of differential equations: ordinary differential equations, linear and non-linear, homogeneous and non-homogeneous, differential equations of the first and higher orders, partial differential equations, and so on.

The solution to a differential equation is a function that turns it into an identity. There are general and particular solutions of remote control.

The general solution of the differential equation is the general set of solutions that turn the equation into an identity. A particular solution of a differential equation is a solution that satisfies additional conditions specified initially.

The order of a differential equation is determined by the highest order of the derivatives included in it.


Ordinary differential equations

Ordinary differential equations are equations containing one independent variable.

Consider the simplest ordinary differential equation of the first order. It looks like:

This equation can be solved by simply integrating its right side.

Examples of such equations:

Separable Variable Equations

IN general view this type of equation looks like this:

Here's an example:

Solving such an equation, you need to separate the variables, bringing it to the form:

After that, it remains to integrate both parts and get a solution.


Linear differential equations of the first order

Such equations take the form:

Here p(x) and q(x) are some functions of the independent variable, and y=y(x) is the required function. Here is an example of such an equation:

When solving such an equation, most often they use the method of variation of an arbitrary constant or represent the desired function as a product of two other functions y(x)=u(x)v(x).

To solve such equations, a certain preparation is required, and it will be quite difficult to take them “on a whim”.

An example of solving a DE with separable variables

So we have considered the simplest types of remote control. Now let's take a look at one of them. Let it be an equation with separable variables.

First, we rewrite the derivative in a more familiar form:

Then we will separate the variables, that is, in one part of the equation we will collect all the “games”, and in the other - the “xes”:

Now it remains to integrate both parts:

We integrate and obtain the general solution of this equation:

Of course, solving differential equations is a kind of art. You need to be able to understand what type an equation belongs to, and also learn to see what transformations you need to make with it in order to bring it to one form or another, not to mention just the ability to differentiate and integrate. And it takes practice (as with everything) to succeed in solving DE. And if you have this moment there is no time to deal with how differential equations are solved or the Cauchy problem has risen like a bone in the throat or you do not know how to properly format a presentation, contact our authors. In a short time, we will provide you with a ready-made and detailed solution, the details of which you can understand at any time convenient for you. In the meantime, we suggest watching a video on the topic "How to solve differential equations":