1. Trang chủ >
  2. Công Nghệ Thông Tin >
  3. Kỹ thuật lập trình >

Chapter 6. Applications Related to Ordinary and Partial Differential Equations

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (25.81 MB, 585 trang )


430



Chapter 6 Differential Equations



EXAMPLE 6.1.1: Solve each of the following equations: (a) y

0; (b) y Αy 1 K1 y , K, Α > 0 constant.



y2 sin t



SOLUTION: (a) The equation is separable:

1

dy

y2

1

dy

y2

1

y

y



sin t dt

sin t dt

cos t



C



1

.

cos t C



We check our result with DSolve.

In[1244]:= sola

Out[1244]=



DSolve y t y t ˆ2 Sin t

1

y t

C 1

Cos t



0, y t , t



6.1 First-Order Differential Equations



431



1



0.8



0.6



0.4



0.2



1



2



3



4



5



Figure 6-1 Several solutions of y



y2 sin t



6



0



Observe that the result is given as a list. The formula for the solution is

the second part of the first part of the first part of sola.

In[1245]:= sola



1, 1, 2



Out[1245]=



1

Cos t



C 1



We then graph the solution for various values of C with Plot in Figure 6-1.

In[1246]:= toplota Table sola

i, 2, 10



Out[1246]=



1, 1 , 2



/.C 1



> i,



1

1

1

1

,

,

,

,

Cos t

3 Cos t

4 Cos t

5 Cos t

1

1

1

1

,

,

,

,

6 Cos t

7 Cos t

8 Cos t

9 Cos t

1

10 Cos t



2



In[1247]:= Plot Evaluate toplota , t, 0, 2Π ,

PlotRange > 0, 1 , AxesOrigin > 0, 0



expression /. x->y

replaces all occurrences of x

in expression by y.

Table[a[k],{k,n,m}]

generates the list an , an 1 ,

. . . , am 1 , am .



To graph the list of functions

list for a x b, enter

Plot[Evaluate[list],{x,a,b}]



432



Chapter 6 Differential Equations



(b) After separating variables, we use partial fractions to integrate:

y

1

dy

Αy 1 K1 y

1 1

1

Α y K y

1

ln y

Α



ln K



y

y

y



1

y

K



dt

dt

C1



y

K



Αy 1



t



CeΑt

CKeΑt .

CeΑt 1



We check the calculations with Mathematica. First, we use Apart to

1

.

find the partial fraction decomposition of

Αy 1 K1 y

In[1248]:= s1 Apart 1/ Α y

1

1

Out[1248]=

y Α

k y Α



1



1/ k y



,y



Then, we use Integrate to check the integration.

In[1249]:= s2 Integrate s1, y

Log k y

Log y

Out[1249]=

Α

Α



Last, we use use Solve to solve



1

Α



ln y



ln K



y



ct for y.



In[1250]:= Solve s2

c t, y

ec t Α k

y

Out[1250]=

1 ec t Α



We can use DSolve to find a general solution of the equation

In[1251]:= solb DSolve y t

y t ,t

et Α k

y t

Out[1251]=

et Α eC 1



Α y t



1



1/ k y t



as well as find the solution that satisfies the initial condition y 0

In[1252]:= solc DSolve y t

y 0

y0 , y t , t

et y0

y t

Out[1252]=

1 y0 et y0



y t



1



y t



,



y0 .

,



The equation y

Αy 1 K1 y is called the logistic equation (or Verhulst equation) and is used to model the size of a population that is



6.1 First-Order Differential Equations



433



1.4

1.2

1

0.8

0.6

0.4

0.2

1



2



3



4



5



Figure 6-2 A typical direction field for the logistic equation



not allowed to grow in an unbounded manner. Assuming that y 0 > 0,

K.

then all solutions of the equation have the property that limt y t

To see this, we set Α

K

1 and use PlotVectorField, which

is contained in the PlotField package that is located in the Graphics

directory to graph the direction field associated with the equation in

Figure 6-2.



In[1253]:= << Graphics‘PlotField‘

pvf PlotVectorField 1, y 1 y , t, 0, 5 ,

y, 0, 5/2 , HeadLength > 0, Axes > Automatic



The property is more easily seen when we graph various solutions

along with the direction field as done next in Figure 6-3.



434



Chapter 6 Differential Equations



2.5

2

1.5

1

0.5



1



2



4



3



5



Figure 6-3 A typical direction field for the logistic equation along with several solutions



In[1254]:= toplot Table solc 1, 1, 2 /.y0 > i/5, i, 1, 12

sols Plot Evaluate toplot ,

t, 0, 5 , DisplayFunction > Identity

Show pvf, sols



6.1.2 Linear Equations

Definition 3 (First-Order Linear Equation). A differential equation of the form

a1 t



dy

dt



a0 t y



f t,



(6.2)



where a1 t is not identically the zero function, is a first-order linear differential

equation.

Assuming that a1 t is not identically the zero function, dividing equation (6.2) by

a1 t gives us the standard form of the first-order linear equation:

dy

dt



pt y



qt .



(6.3)



If q t is identically the zero function, we say that the equation is homogeneous.

The corresponding homogeneous equation of equation (6.3) is

dy

dt



pt y



0.



(6.4)



6.1 First-Order Differential Equations



435



Observe that equation (6.4) is separable:

dy

dt



pt y



0



1

dy

y



p t dt



ln y



p t dt



y



p t dt



Ce



C



.



Notice that any constant multiple of a solution to a linear homogeneous equation

is also a solution. Now suppose that y is any solution of equation (6.3) and y p is a

particular solution of equation (6.3). Then,

y



yp



pt y



yp



y



pt y



yp



qt



0.



qt



p t yp



Thus, y y p is a solution to the corresponding homogeneous equation of equation

(6.3). Hence,

y



where yh



Ce



p t dt



yp



Ce



p t dt



y



Ce



p t dt



y



yh



yp



yp,



. That is, a general solution of equation (6.3) is

y



yh



yp,



where y p is a particular solution to the nonhomogeneous equation and yh is a general solution to the corresponding homogeneous equation. Thus, to solve equation

(6.3), we need to first find a general solution to the corresponding homogeneous

equation, yh , which we can accomplish through separation of variables, and then

find a particular solution, y p , to the nonhomogeneous equation.

If yh is a solution to the corresponding homogeneous equation of equation (6.3)

then for any constant C, Cyh is also a solution to the corresponding homogeneous

equation. Hence, it is impossible to find a particular solution to equation (6.3) of

this form. Instead, we search for a particular solution of the form y p u t yh , where

u t is not a constant function. Assuming that a particular solution, y p , to equation

(6.3) has the form y p u t yh , differentiating gives us

yp



u yh



uyh



and substituting into equation (6.3) results in

yp



p t yp



u yh



uyh



p t uyh



qt .



A particular solution is a

specific solution to the

equation that does not

contain any arbitrary

constants.



436



yh is a solution to the

corresponding homogeneous

equation so yh

p t yh 0.



Chapter 6 Differential Equations



Because uyh



p t uyh



u yh



p t yh

u yh



0, we obtain



u 0



qt

1

qt

yh



u



p t dt



e



u

u



e



qt



p t dt



q t dt



so

yp



u t yh



p t dt



Ce



p t dt



e



q t dt.



Because we can include an arbitrary constant of integration when evaluating

e p t dt q t dt, it follows that we can write a general solution of equation (6.3)

as

y



p t dt



e



e



p t dt



(6.5)



q t dt.



Alternatively, multiplying equation (6.3) by the integrating factor Μ t

gives us the same result:

e



p t dt



dy

dt



p t dt



pt e

d

e

dt



p t dt



e



y



y



p t dt



qt e



p t dt



qt e



p t dt



y



qt e



y



e



p t dt



p t dt



e



p t dt



dt



qt e



p t dt



dt.



Thus, first-order linear equations can always be solved, although the resulting

integrals may be difficult or impossible to evaluate exactly.

Mathematica is able to solve the general form of the first-order equation, the

y0 ,

initial-value problem y p t y q t , y 0

In[1255]:= DSolve y t

Out[1255]=



y t



e



q t ,y t ,t



p t y t



t

p

0



t



DSolve‘t

DSolve‘t



e0



DSolve‘t



p DSolve‘t



C 1



e



DSolve‘t



t

p

0



DSolve‘t



q DSolve‘t



DSolve‘t



DSolve‘t



0



In[1256]:= DSolve

Out[1256]=



y t



y t

t

p

0



e

t



e

0



q t ,y 0



p t y t

DSolve‘t



DSolve‘t

0



DSolve‘t



p DSolve‘t



y0 , y t , t



y0



DSolve‘t



q DSolve‘t



DSolve‘t



6.1 First-Order Differential Equations



437



as well as the corresponding homogeneous equation,

In[1257]:= DSolve y t

p t y t

0, y t , t

t

Out[1257]=

y t

e 0 p DSolve‘t DSolve‘t C 1

In[1258]:= DSolve

y t

Out[1258]=



y t

t

e 0p



p t y t

DSolve‘t



DSolve‘t



0, y 0

y0



y0 , y t , t



although the results contain unevaluated integrals.



EXAMPLE 6.1.2 (Exponential Growth): Let y y t denote the size of

a population at time t. If y grows at a rate proportional to the amount

present, y satisfies

dy

Αy,

(6.6)

dt

where Α is the growth constant. If y 0

y0 , using equation (6.5) results

Αt

in y y0 e . We use DSolve to confirm this result.

In[1259]:= DSolve

Out[1259]=

y t



y t

Α y t ,y 0

t Α

e

y0



y0 , y t , t



EXAMPLE 6.1.3: Solve each of the following equations: (a) dy/ dt

y0 , k and ys constant (b) y

2ty

t (c) ty

y

k y ys , y 0

4t cos 4t sin 4t



SOLUTION: By hand, we rewrite the equation and obtain

dy

dt



ky



kys .



dy/ dt k y ys models

Newton’s Law of Cooling: the

rate at which the

temperature, y t , changes in

a heating/cooling body is

proportional to the

difference between the

temperature of the body and

the constant temperature, ys ,

of the surroundings.



A general solution of the corresponding homogeneous equation

dy

dt



ky



0



is yh ekt . Because k and kys are constants, we suppose that a particular solution of the nonhomogeneous equation, y p , has the form y p A,

where A is a constant.

A, we have y p

0 and substitution into the

Assuming that y p

nonhomogeneous equation gives us

dy p

dt



ky p



KA



kys



so



A



ys .



This will turn out to be a

lucky guess. If there is not a

solution of this form, we

would not find one of this

form.



438



Chapter 6 Differential Equations



300



250



200



150



100

4



2



6



10



8



Figure 6-4 The temperature of the body approaches the temperature of its surroundings



Thus, a general solution is y yh y p Cekt ys . Applying the initial

condition y 0

y0 results in y ys y0 ys ekt .

We obtain the same result with DSolve. We graph the solution satisfing y 0

75 assuming that k

1/ 2 and ys 300 in Figure 6-4. Notice

.

that y t

ys as t

In[1260]:= sola



DSolve y t

k y t

y 0

y0 , y t , t

y t

ek t y0 ys

ys



Out[1260]=

In[1261]:= tp



ys ,



sola 1, 1, 2 /. k > 1/2, ys > 300,

y0 > 75 Plot tp, t, 0, 10



(b) The equation is in standard form and we identify p t

2t. Then,

p t dt

t2

the integrating factor is Μ t

e

e . Multiplying the equation

by the integrating factor, Μ t , results in

e



t2



y



2ty



te



t2



or



d

ye

dt



C



or



y



t2



te



t2



.



Integrating gives us

ye



t2



1

e

2



t2



1

2



2



Cet .



We confirm the result with DSolve.

In[1262]:= DSolve y t

1

Out[1262]=

y t

2



t, y t , t



2t y t

et



2



C 1



(c) In standard form, the equation is y

pt

1/t. The integrating factor is Μ t



y/t

e



4t cos 4t sin 4t /t so

e ln t

1/t and



p t dt



6.1 First-Order Differential Equations



439



multiplying the equation by the integrating factor and then integrating

gives us

1 dy 1

y

t dt t 2

d 1

y

dt t

1

y

t

y



1

4t cos 4t

t2

1

4t cos 4t

t2

sin 4t

C

t

sin 4t Ct,



sin 4t

sin 4t



where we use the Integrate function to evaluate

sin 4t

C.

t

In[1263]:= Integrate

Sin 4 t

Out[1263]=

t



4 t Cos 4t



1

4t cos 4t sin 4t dt

t2



Sin 4t



/tˆ2, t



We confirm this result with DSolve.

In[1264]:= sol

Out[1264]=



DSolve y t

y t /t

Sin 4t /t, y t , t

y t

t C 1

Sin 4 t



4 t Cos 4t



In the general solution, observe that every solution satisfies y 0

That is, the initial-value problem

dy

dt



1

y

t



1

4t cos 4t

t2



sin 4t ,



y0



0.



0



has infinitely many solutions. We see this in the plot of several solutions

that is generated with Plot in Figure 6-5.

In[1265]:= toplot



Table sol 1, 1, 2 /.C 1 > i,

i, 5, 5

Plot Evaluate toplot , t, 2Π, 2Π ,

PlotRange > 2Π, 2Π , AspectRatio > 1



6.1.2.1 Application: Free-Falling Bodies

The motion of objects can be determined through the solution of first-order initialvalue problems. We begin by explaining some of the theory that is needed to set

up the differential equation that models the situation.



440



Chapter 6 Differential Equations



6



4



2



-6



-4



-2



4



2



6



-2



-4



-6



Figure 6-5



Every solution satisfies y 0



0



Newton’s Second Law of Motion: The rate at which the momentum of a body changes with respect to time is equal to the resultant force acting on the body.

Because the body’s momentum is defined as the product of its mass and velocity,

this statement is modeled as

d

mv

F,

dt

where m and v represent the body’s mass and velocity, respectively, and F is the

sum of the forces (the resultant force) acting on the body. Because m is constant,

differentiation leads to the well-known equation

m



dv

dt



F.



If the body is subjected only to the force due to gravity, then its velocity is determined by solving the differential equation

m



dv

dt



mg



or



dv

dt



g,



where g 32ft / s2 (English system) and g 9.8m / s2 (metric system). This differential equation is applicable only when the resistive force due to the medium (such



Xem Thêm
Tải bản đầy đủ (.pdf) (585 trang)

×