Sunteți pe pagina 1din 5

Tema: Integrarea ecuațiilor diferențiale ordinare.

Aplicații

y ' ( x )=xy ( x )
1. (P.C.) : { y ( 0 )=1
, h=0,5 . Să se aproximeze y (1) cu metoda lui Euler.

Soluție: Pentru problema Cauchy considerată, f ( x , y ( x ) )=x ∙ y ( x ) , x 0=0 , y 0=1;


1⇒ ⇒
1= x i= x 0 +i∙ h❑ 1=0+i ∙ ❑ i=2❑ x 2=1
2

 Relația de recurență pentru metoda lui Euler: y i= y i−1 +h ∙ f (x i−1 , y i−1 )


 În cazul nostru, această relatie devine: y i= y i−1 +h ∙ xi−1 ∙ y i−1
 Avem de aproximat y ( 1 )= y ( x 2) ≈ y 2. Vom parcurge 2 pasi

i=1 y , x y ( x1 ) = y ¿) = y ( 12 )
1 1 1 5
y 1= y 0 +h ∙ x 0 y 0 =1+ ∙ ∙1=1+ =
2 2 4 4

4x

{
'
y ( x )= 1⇒
2. (P.C.): y (x) , h=0,25= ❑ y ( 2 ) cu metoda lui Euler.
4
y ( 1 ) =2

4x 1
Soluție: Pentru situația noastra, avem: f ( x , y ( x ) )= , x 0 =1, y 0=2, h=
y (x) 4

 Determinăm al câtelea termen din diviziunea echidistantă îl reprezintă 2:



1⇔ ⇒
2=x 0 +ih ❑ 2=1+i ❑ i=4 ❑ x 4=2
4
 Relația de recurență : y i= y i−1−hf ( x i−1 , y i−1 ) , devine în cazul nostru :
4 x i−1
y i= y i−1 +h
y i−1
 Avem de efectuat 4 pași:

1 5
i=1 : y 1 ≈ y ( x 1) = y ( x 0+ h )= y 1+( ) 4
=y( )
4

4 x0 1 4 ∙1 5
y 1= y 0 +h =2+ ∙ =
y0 4 2 2
1 3
i=2: y 2 ≈ y ( x 2 )= y ( x 0 +2 h )= y 1+2 ( 4 ) ()
=y
2

5
4∙
4 x1 5 1 4
y 2= y 1 +h = + ∙ =3
y1 2 4 5
2

4 x2
i=3 : y 3 ≈ y ( x 3 ) = y ( 24 ); y = y +h
3 2
y2
1 4∙2 4
=3+ ∙
4 3
=
3

7
4∙
4 x 11 1 4 11 21 484+63 547
i=4 : y 4 ≈ y ( x 4 )= y (2); y 4 = y 3 +h 3 = + ∙ = + = =
y3 3 4 11 3 44 132 132
3

2x
3. (P.C.):
{ y ' ( x )= y ( x )−

y ( 0 ) =1

y ( x ) , h=0,2❑ y ( 0,6) cu metoda Taylor de ordinul 2.

Soluție: Relația de recurență pentru metoda Tayler de ordin 2 :


' h2 ' '
y i= y i−1 +h y ( x i−1 ) + y ( xi−1 )
2
' ''
Dar: y ( x i−1 )=f ( x i−1 , y i−1 ) ; y ( x i−1)=¿
2x
 În cazul nostru: f ( x , y ( x ) )= y ( x )− ; x =0 , y 0=1
y (x ) 0

1 ⇔ ⇒
h=0.2= . 0,6=x =0+ih ❑ i=3 ❑ 0,6=x .
5 i 3

Adaptăm relația de recurență pentru situația noastră:

2x
y ' ( x )=f ( x , y ( x )) = y ( x ) −
y(x)

2 [ y ( x )−x y ' ( x ) ] 2x
'' '
y ( x )= y ( x )− 2
y ( x)
= y ( x )−
[
y( x)
−2 ¿ ¿
]
2x 2 2x 4x 2x 4x
¿ y ( x) − − + − 2 = y ( x )− − 2
y (x) y (x) y(x) y (x) y ( x) y ( x )

Deci, relația de recurență devine:


2 x i−1 h 2 2 4 x2
y i= y i−1 +h y i−1−( y i−1
+) (
2
y i−1− − 2i−1
y i−1 y i−1 )
 Avem de executat 3 pași:

i=1 : y 1 ≈ y ( 0+h ) = y ( 15 )
2
2 x 0 h2 2 4x 1 2 ∙0 1 2 4 ∙0
y 1= y 0 +h y 0−( y0) (
+
2
y 0− − 20 =1+ 1−
y0 y0 5 1 )
+
50 (
1− − 2
1 1 ) ( )
1 1 59
¿ 1+ − =
5 50 50

i=2: y 2 ≈ y ( 0+2 h )= y ( 25 )
2
2 x 1 h2 2 4 x1
(
y 2= y 1 +h y 1−
y1
+ ) (
y − − 2 =¿
2 1 y1 y1 )
1 1
2
4
59 1 59
¿ + −
5

50
( ) (
+
1 59 2 25
− − 2 =…
50 5 50 59 50 50 59 59
50 502 )
i=3 : y 3 ≈ y ( 0+3 h )= y ( 35 )= y ( 0,6 )
2
2 x 2 h2 2 4x
y 3= y 2 +h y 2−( y2) (
+
2
y 2− − 22 =…
y2 y2 )
y ' ( x )=x + y ( x )
4. (P.C.): { y ( 0 )=−1

, x ∈[0,2]❑ y (1) cu metoda Taylor de ordinul 2 în 2 pași

Soluție: A executa 2 pași ai algoritmului Taylor este echivalent cu a aproxima valoarea soluției y
a problemei Caucyconsiderate în punctul x 2.
Știind că 1=x 2 , determinăm pasul h al diviziunii astfel :

1
1=x 2=x 0 +2 h=0+2 h❑ h=
2
' h2 ' '
 Adaptăm acum relația de recurentă: y i= y i−1 +h y ( x i−1 ) + y ( xi−1 ) pentru situația
2

f ( x , y ( x ) )=x + y ( x )
1
x 0=0 ; y 0 =−1; h=
dată : 2 , de unde:
'
y x =f ( x , y x )=x + y x
( ) ( ) ( )
y ( x )=1+ y ' ( x )=¿ 1+ x + y ( x )
''

h2
y i= y i−1 +h ( x i−1+ y i−1 ) + (1+ x i−1+ y i−1 ), ( ∀ ) i.
2
1 1
 i=1 : y 1 ≈ y ( 0+h ) = y
2(); x 1=
2
h2 1 1
y 1= y 0 +h ( x 0 + y 0 ) + ( 1+ x 0 + y 0 ) =−1+ [ 0+ (−1 ) ] + [ 1+0+ (−1 ) ]=¿
2 2 8
1 −3
¿−1− =
2 2
 i=2: y 2 ≈ y ( 0+2 h )= y (1 ) ; x 2=1
h2 −3 1 1 3 1 1 3
y 2= y 1 +h ( x 1 + y 1 ) +
2
( 1+ x 1+ y 1 ) = + (
− + 1+ − =¿
2 2 2 2 8 2 2 ) ( )
3 1 ⇒
¿− − =−2❑ y 2=−2
2 2
y ' ( x )=−2 y ( x ) +2 x 2+2 x
5. (P.C.) { y ( 0 )=1

, x ∈[0,1]❑ y (0,4) cu metoda Runge-Kutta de ordinul 2 în 2

pași.
Soluție: Determinăm h, pasul diviziunii, pornind de la faptul că: a executa 2 pași ai algoritmului
este similar cu a obține apoi sumarea în x 2=x 0 +2 h. Dar: x 0=0 și x 2=0,4 . Deci:
x 2−x 0 0,4−0 1⇔ 1
h= = =0,2= ❑ h= .
2 2 5 5
Adaptăm algoritmul Runge-Kutta de ordinul 2 pentru situația dată:
1 1
y i= y i−1 + g1 + g 2 cu g1=hf (x i−1 , y i−1) , g2=hf ( x i−1 +h , y i−1+ g 1) .
2 2

În cazul nostrum avem: f ( x , y ( x ) )=−2 y ( x )+ 2 x 2 +2 x

1
x 0=0 , y 0=1 , h=
5

Deci relația va avea forma:

1 1
y i= y i−1 + g1 + g 2 cu ¿
2 2
i=1

1
2
Calculăm: g1=h ( −2 y 0+ 2 x 0 + 2 x 0 ) = (−2 ∙1+2 ∙ 02+ 2∙ 0 ) =−2
5 5

g2=h¿ (

1 2 1 2 1 1 −6 2 2 1 −18 −18
y 0 + g1 ¿+2 ( x 0+ h ¿ ¿ ¿ 2+2 ( x 0 +h ) ]=
5 [ ( ) ( ) ( )] (
−2 1− +2 0+ ++ 2 0+ =
5 5 5
+ + =
5 5 25 5 5 25
=
125 ) ( )
1 1 1 −2 1 −18 91 ⇔ 91 1
Deci: y 1= y 0 +
2
g1 + g2=1+
2 2 5
+ ( ) ( )
=
2 125 125
❑ y 1= ; x =x +h=
125 1 0 5

1 1
i=2 : y 2= y 1 + g 1+ g 2 cu ¿
2 2

Astfel obținem:

1 91 1 2 −182+10+50 −122
g1=
5(−2
125
+2 +
25 25
=
54 ) = 4
5

1 −122 91 1 1 2 1 1 1 −666 8 4 34 ⇒
g2=
5[ (
−2
54
+
53
+2 +
5 5 ) ( ) ( )] [
+ 2 +
5 5
=
5 54
+ 2+ = 5 ❑
5 5 5 ]
91 1 −122 1 34 3974 1987
y 2= +
125 2 54 (+ ∙ 5=
2 5 ) =
2 ∙55 3125

Obs: Exact în același mod se procedează pentru metoda Runge-kutta de ordinul 2 respectiv 3.

S-ar putea să vă placă și