Tải bản đầy đủ - 0 (trang)
4 Nonhomogeneous First-Order Systems: Undetermined Coefficients, Variation of Parameters, and the Matrix Exponential

4 Nonhomogeneous First-Order Systems: Undetermined Coefficients, Variation of Parameters, and the Matrix Exponential

Tải bản đầy đủ - 0trang

486



Chapter 6 Systems of Ordinary Differential Equations



x

EXAMPLE 6.4.1: Solve y



2x



y



8x



x0



sin 3t

2y



0, y 0



1.



SOLUTION: In matrix form, the system is equivalent to X



2

8



1

X

2



sin 3t

. We find a general solution of the corresponding homogeneous

0

2 1

X with DSolve.

system X

8 2

+



In[1209]:= homsol

2x t

y t ,

DSolve x t

y t

8x t

2 y t , x t ,y t

t //Simplify

Out[1209]=



x t

y t



,



C 1 Cos 2 t

2C 1

C 2

Cos t Sin t ,

C 2 Cos 2 t

4C 1

C 2

Sin 2 t



These results indicate that a general solution of the corresponding

homogeneous system is

Xh



cos 2t sin 2t sin 2t cos 2t

4 sin 2t

4 cos 2t



In[1210]:= xh t



x t

y t



/.homsol



c1

.

c2



1



Thus, we search for a particular solution of the nonhomogeneous

a1

b1

system of the form X p a sin 3t b cos 3t, where a

and b

.

a2

b2

2 1

and X p a sin 3t b cos 3t, we substitute

After defining A

8 2

X p into the nonhomogeneous system.

In[1211]:= capa



2

8



In[1212]:= xp t



a1

a2



1

2

Sin 3t



b1

b2



Cos 3t



6.4 Nonhomogeneous First-Order Systems: Undetermined Coefficients



In[1213]:= step1



capa.xp t



xp t



Sin 3t

0



//



Simplify

3 Sin 3 t b1 3 Cos 3 t a1 ,

3 Sin 3 t b2

3 Cos 3 t a2

2 Cos 3 t b1 Cos 3 t b2

Sin 3 t 1 2 a1 a2 ,

2 4 Cos 3 t b1 Cos 3 t b2

Sin 3 t 4 a1 a2



Out[1213]=



The result represents a system of equations that is true for all values of

t. In particular, substituting t 0 yields

In[1214]:= eq1

Out[1214]=



3

3



step1 /. t > 0

1, 1 , 4 , 2 1 ,

1, 1 , 4 , 2 2

2 b1 b 2 , 2 4 b 1 b 2



which is equivalent to the system of equations

3a1



2b1



3a2

Similarly, substituting t

In[1215]:= eq2

Out[1215]=



b2



2 4b1



b2 .



Π/ 2 results in

step1 /. t > Π/2



3 b1 , 3 b2

1 2 a1 a 2 ,

2 4 a1 a 2



which is equivalent to the system of equations

1



3b1

3b2



2



2a1

4a1



a2

a2 .



We now use Solve to solve these four equations for a1 , a2 , b1 , and b2

In[1216]:= coeffs

Out[1216]=



b1



Solve eq1, eq2

3

2

, b2 0, a1

, a2

5

5



8

5



and substitute into X p to obtain a particular solution to the nonhomogeneous system.



487



488



Chapter 6 Systems of Ordinary Differential Equations



In[1217]:= xp t

Out[1217]=



xp t /.coeffs 1

3

2

Cos 3 t

Sin 3 t

5

5



,



8

Sin 3 t

5



A general solution to the nonhomogeneous system is then given by

X Xh X p .

In[1218]:= x t

Out[1218]=



xh t



xp t

3

Cos 3 t

C 1 Cos 2 t

5



2C 1



C 2



Cos t Sin t



C 2 Cos 2 t

8

Sin 3 t

5



4C 1



C 2



2

Sin 3 t

5

Sin 2 t



,



To solve the initial-value problem, we apply the initial condition and

solve for the unknown constants.

In[1219]:= x 0

3

5



Out[1219]=



In[1220]:= cvals

Out[1220]=



C 1



C 1



, C 2

0 , 1



Solve x 0

3

,C 2

1

5



We obtain the solution by substituting these values back into the general solution.

In[1221]:= x t

Out[1221]=



x t /. cvals

Simplify



1



//Flatten//



1

3 Cos 2 t

3 Cos 3 t

5

11 Cos t Sin t

2 Sin 3 t ,

8

17

Sin 2 t

Sin 3 t

Cos 2 t

5

5



We confirm this result by graphing x t (in black) and y t (in gray)

together in Figure 6-25 (a) as well as parametrically in (b).

In[1222]:= Plot Evaluate x t , t, 0, 4Π ,

PlotStyle

GrayLevel 0 , GrayLevel 0.5 ,

PlotRange

2 Π, 2Π , AspectRatio

In[1223]:= ParametricPlot x t , t, 0, 4Π ,

PlotRange

6, 5 , 5, 6 ,

AspectRatio 1, Compiled False



1



6.4 Nonhomogeneous First-Order Systems: Undetermined Coefficients



6



6



4



4



2



489



2

2



4



6



8



10



12

-6



-4



-2



2



4



-2

-2

-4

-4



-6

(a)



(b)



Figure 6-25 (a) x t (in black) and y t (in gray). (b) Parametric plot of x t versus y t



Finally, we note that DSolve is able to find a general solution of the

nonhomogeneous system

In[1224]:= Clear x, y, t

gensol

Simplify

2x t

y t

Sin 3 t ,

DSolve x t

y t

8x t

2y t , x t ,

y t ,t

3

x t

C 1 Cos 2 t

Cos 3 t

Out[1224]=

5

C 2 Cos t Sin t

C 1 Sin 2 t

2

Sin 3 t , y t

C 2 Cos 2 t

5

4C 1

C 2

Sin 2 t

8

Sin 3 t

5



as well as solve the initial-value problem.

In[1225]:= partsol

Simplify

2x t

y t

Sin 3 t ,

DSolve x t

y t

8x t

2 y t ,x 0

0,

y 0

1 , x t ,y t ,t



490



Chapter 6 Systems of Ordinary Differential Equations



Out[1225]=



x t



y t



1

6 Cos 2 t

10

6 Cos 3 t

11 Sin 2 t

4 Sin 3 t ,

17

Sin 2 t

Cos 2 t

5

8

Sin 3 t

5



In[1226]:= partsol 1, 1, 2 //ExpToTrig//

Simplify

1

6 Cos 2 t

Out[1226]=

10

6 Cos 3 t

11 Sin 2 t

4 Sin 3 t

In[1227]:= partsol 1, 2, 2 //ExpToTrig//

Simplify

8

17

Sin 2 t

Sin 3 t

Out[1227]= Cos 2 t

5

5



6.4.2 Variation of Parameters

Generally, the method of undetermined coefficients is difficult to implement for

nonhomogeneous linear systems as the choice for the particular solution must be

very carefully made.

Variation of parameters is implemented in much the same way as for first-order

linear equations.

Let Φ be a fundamental matrix for the corresponding homogeneous system.

We assume that a particular solution has the form X p ΦU t . Differentiating X p

gives us

Φ U ΦU .

Xp

Substituting into equation X



AX



ΦU



F t results in



ΦU



AΦU



ΦU



F



U

U

where we have used the fact that Φ U

Xp



Φ



F



Φ 1F

Φ 1 F dt,

AΦU



Φ



Φ 1 F dt.



AΦ U



0. It follows that

(6.15)



6.4 Nonhomogeneous First-Order Systems: Undetermined Coefficients



A general solution is then

X



Xh



Xp



ΦC



Φ



Φ 1 F dt



Φ C



Φ 1 F dt



Φ



Φ 1 F dt,



where we have incorporated the constant vector C into the indefinite integral

Φ 1 F dt.



EXAMPLE 6.4.2: Solve the initial-value problem

1

10



X



1

X

1



t cos 3t

,

t sin t t cos 3t



1

.

1



X0



Remark. In traditional form, the system is equivalent to

x



x



y



y



10x



t cos 3t

y



t sin t



t cos 3t,



x0



1, y 0



1.



1 1

Xh .

10 1

1 1

are

10 1



SOLUTION: The corresponding homogeneous system is Xh

The eigenvalues and corresponding eigenvectors of A

Λ1,2



3i and v1,2



1

10



3

i, respectively.

0



In[1228]:= capa

1, 1 , 10, 1

Eigensystem capa

Out[1228]=



3 i, 3 i ,



1



1

3 cos 3t

1

3 sin 3t



3 i, 10 , 1



3 i, 10



sin 3t

cos 3t

sin 3t 3 cos 3t cos 3t 3 sin 3t

1

sin 3t

3 cos 3t .

1

cos 3t 3 sin 3t



A fundamental matrix is Φ

inverse Φ



1



with



491



492



Chapter 6 Systems of Ordinary Differential Equations



In[1229]:= fm



Sin 3t , Sin 3t

3 Cos 3t ,

Cos 3t , Cos 3t

3 Sin 3t

fminv Inverse fm //Simplify

1

Cos 3 t

Sin 3 t , Cos 3 t

Out[1229]=

3

1

1

Sin 3 t ,

Cos 3 t ,

3

3

1

Sin 3 t

3



//Transpose



We now compute Φ 1 F t

In[1230]:= ft

t Cos 3t , t Sin t

step1 fminv.ft

Out[1230]=



t Cos 3 t



t Sin t



1

Sin 3 t

3

Sin 3 t



,



t Cos 3t

Cos 3 t

1

Cos 3 t

3



t Cos 3 t

1

t Cos 3 t

3



2



1

t Cos 3 t

3

t Sin t Sin 3 t



and



Φ 1 F t dt.

In[1231]:= step2 Integrate step1, t

1

Out[1231]=

288 t2 36 Cos 2 t

864

216 t Cos 2 t

9 Cos 4 t

108 t Cos 4 t

16 Cos 6 t

48 t Cos 6 t

108 Sin 2 t

72 t Sin 2 t

27 Sin 4 t

36 t Sin 4 t

1

864

72 t2 36 Cos 2 t

9 Cos 4 t

4 Cos 6 t

24 t Cos 6 t

72 t Sin 2 t

36 t Sin 4 t



8 Sin 6 t



96 t Sin 6 t



4 Sin 6 t



24 t sin 6 t



,



A general solution of the nonhomogeneous system is then Φ

dt C .

In[1232]:= Simplify fm.step2



Φ 1F t



6.4 Nonhomogeneous First-Order Systems: Undetermined Coefficients



1

27 Cos t

4

1 6 t 18 t2

288

Cos 3 t

27 t Sin t

Sin 3 t



Out[1232]=



,

6 t Sin 3 t

18 t2 Sin 3 t

1

36 t Cos t

4 1 6 t 18 t2

288

Cos 3 t

45 Sin t

4 Sin 3 t

72 t2 Sin 3 t



24 t Sin 3 t



It is easiest to use DSolve to solve the initial-value problem directly as

we do next.

In[1233]:= check



Out[1233]=



DSolve x t

x t

10x t

y t

t Cos 3t , y t

1,

t Sin t

t Cos 3t , x 0

y 0

1 , x t ,y t ,t

1

9 Cos t

297 Cos 3 t

288

2

72 t Cos 3 t

36 t Sin t



x t



192 Sin 3 t

24 t Sin 3 t

1

9 Cos t

36 t Cos t

288

279 Cos 3 t

72 t Cos 3 t

2

72 t Cos 3 t

45 Sin t

36 t Sin t

1107 Sin 3 t



y t



24 t Sin 3 t



y t



,



216 t2 Sin 3 t



After using ?Evaluate to obtain basic information regarding the

Evaluate function, the solutions are graphed with Plot and Para

metricPlot in Figure 6-26.



400



400



200



200



5



10



15



20



-150

-100

-50 50

100



25



-200



-200



-400



-400



(a)



(b)



Figure 6-26 (a) Graph of x t (in black) and y t (in gray). (b) Parametric plot of x t

versus y t



493



494



Chapter 6 Systems of Ordinary Differential Equations



In[1234]:= ?Evaluate

"Evaluate expr causesexprtobeevaluatedeven

ifitappearsastheargumentofafunction

whoseattributesspecifythatitshouldbe

heldunevaluated."



In[1235]:= p1



Plot Evaluate x t , y t /.check ,

t, 0, 8Π , PlotStyle > GrayLevel 0 ,

GrayLevel 0.4 , DisplayFunction >

Identity

p2 ParametricPlot Evaluate x t ,

y t /.check , t, 0, 8Π ,

DisplayFunction > Identity,

AspectRatio > Automatic

Show GraphicsArray p1, p2



3x



x

EXAMPLE 6.4.3: Solve y



10x



x Π/ 4



et sec t



2y

5y



3, y Π/ 4



et csc t,



0 < t < Π.



1



SOLUTION: To implement the method of Variation of Parameters, we

proceed in the same manner as before. First, we find a general solution

of the corresponding homogeneous system.

In[1236]:= Clear x, y, a

a



3 2

10 5



In[1237]:= homsol



DSolve

Thread x t , y t

,

a. x t , y t

x t , y t , t //

FullSimplify



This result means that a general solution of the corresponding homogeneous system is

Xh



et



cos 2t 2 sin 2t

5et sin 2t



et 2 cos 2t sin 2t

5et cos 2t



c1

c2



6.4 Nonhomogeneous First-Order Systems: Undetermined Coefficients



and a fundamental matrix is given by

Φ



et



et 2 cos 2t sin 2t

5et cos 2t



cos 2t 2 sin 2t

5et sin 2t



In[1238]:=

t

Exp t

Cos 2t

2 Sin 2t

5 Exp t Sin 2t



Exp t



.



2 Cos 2t



Sin 2t



5 Exp t Cos 2t



Next, we compute X p t

Φ t Φ 1 t F t dt. The result is very lengthy

so we suppress the resulting output by including a semi-colon at the

end of the command.

In[1239]:= inverse



Inverse



t



//Simplify



MatrixForm inverse

1 t

t

Cos 2 t

2 Cos 2 t

Sin 2 t

5

Out[1239]=

1

t

t

Sin 2 t

Cos 2 t

2 Sin 2 t

5

Exp t Sec t

Exp t Csc t



In[1240]:= f t



xp t

t .Integrate Inverse

Simplify



t



.f t , t //



However, we view abbreviations of x t and y t with Short.

In[1241]:= xp t

Out[1241]=



t



//Short



1



In[1242]:= xp t

Out[1242]=



1



t



2



//Short



1



Finally, we form a general solution of the nonhomogeneous system.

In[1243]:= x t



t .



c1

c2



xp t //Simplify



To solve the initial-value problem, we substitute t

eral solution

In[1244]:= x Π/4 //FullSimplify



Π/ 4 into the gen-



495



496



Chapter 6 Systems of Ordinary Differential Equations



Π/ 4



Out[1244]=



2



2



2 Log Cos

Π

8



Log Tan

Π/ 4



2



2



Π

8



2 c1



c2



y Π/ 4



3

1



c2



,



Π

8



Sin



5 Log Cos



Π

8



3

1



Solve x Π/4

1

5



Π/ 4

Π/ 4



c1



Π

8



for c1 and c2 .



In[1245]:= cvals

Out[1245]=



Π

8



2 Log Sec



Π

8

Π

2 Log Sin

8

Π

Sin

5 c1

8



x Π/ 4



Sin



Sin



Π

8



5 Log Cos



and solve



Π

8



2 Log Cos



1

5



17



Π/ 4



Sin

5



Π/ 4



1



Π/ 4



2

Π

8



Log Sin



Π/ 4



5



6



2



2



Log Cos



Π/ 4



2



Π/ 4



Π

8



Π/ 4



Log Sin

Π

8



Log Cos



Π

8



,



2



Log Cos

Π

8



Π/ 4



Sin



Π

8



Log Cos



Π

8



Π

8



This result is rather complicated so we compute more meaningful

approximations with N.

In[1246]:= numcvals

Out[1246]=



c2 .



N cvals



3.42352, c1.



0.0543264



The solution to the initial-value problem is obtained by substituting

these numbers back into the general solution.

In[1247]:= x t



x t /.cvals



1



//N



Tài liệu bạn tìm kiếm đã sẵn sàng tải về

4 Nonhomogeneous First-Order Systems: Undetermined Coefficients, Variation of Parameters, and the Matrix Exponential

Tải bản đầy đủ ngay(0 tr)

×