Sunteți pe pagina 1din 12

EJERCICIOS

EJERCICIO 7
Aplicar el mtodo de Taylor de orden dos a la ecuacin y = Cos(xy), con la condicin
inicial: y(0) = 1. Utilizar h = 0.5
La aproximacin de segundo orden dada por la serie de Taylor es:

y ''i 2
'
y i+1= yi + y h+ h
i donde h=xi +1x i=0,5
2!

Con f ( x , y ) =cos ( xy ) se tiene que:

2
f ' ( xi , yi ) h
y i+1= yi + f ( xi , y i ) h+ (I)
2!

f ' ( x , y ) =sen ( xy ) [ x y ' + y ]

sen ( xy ) [ x cos ( xy ) + y ] Sustituyendo en (I)

1 2
y i+1= yi +cos ( xi y i ) h sen ( x i y i ) [ xi cos ( x i y i ) + y i ] h
2

Cambiando h por 0,5 se tiene:

y i+1= yi +0,5 cos ( xi y i )0,125 sen ( x i y i ) [ xi cos ( x i y i ) + yi ]

Con h=0,5 y la condicin inicial y ( 0 )=1 pueden aproximarse varios valores

y ( x0 ) = y ( 0 )=1

y ( x1 ) = y ( 0,5 )=1+0,5 cos ( 0 )0,125 sen ( 0 ) [ 0 cos ( 0 ) +1 ] =1,5


0,5
() ( 1,5 )
( 0,5 ) cos ( +1,5 ]
y ( x2 ) = y (1 ) =1,5+0,5 cos ( ( 0,5 )( 1,5 ) ) 0,125 sen ( 0,5 ) ( 1,5 )

1,706865

1,706865
1()

1,706865
1()


y ( x3 ) = y (1,5 )=1,706865+0,5 cos

1,5
()

( 1,444453 )

y ( x 4 )= y ( 2 )=1,444453+ 0,5cos

1,101490

EJERCICIO 8
Plantee y solucione paso a paso un ejercicio por el Mtodo de Runge-Kutta de cuarto
orden.

Obtener la aproximacin y (0,8) a la solucin del siguiente problema de valor inicial, con
h=0.2

' 2
y = yx +1

y (0)' =0.52

Solucin
Para la solucin de este problema se debe realizar iteraciones paso a paso para
determinar el siguiente valor de y i por lo que Runge-Kutta debemos aplicar:
1
y i+1= yi + ( k 1 +2 k 2 +2 k 3 +k 4 ) h
6

Dnde:

K 1=f ( xi , y i )

1 1
(
K 2=f x i + h , y i + K 1 h
2 2 )
1 1
(
K 3=f x i + h , yi + K 2 h
2 2 )
K 4 =f ( x i +h , y i+ K 3 h )

Las anteriores funciones podemos reducirla de las siguientes maneras para calcularlas de
una manera ms fcil en cada iteracin:

( k 1+2 k 2 +2 k 3 + k 4 ) h
y i+1= yi +
6

Dnde:

K 1=f ( xi , y i )

K h
( h
K 2=f x i + , y i+ 1
2 2 )
K h
( h
K 3=f x i + , y i+ 2
2 2 )
K 4 =f ( x i +h , y i+ K 3 h )

Ahora definiremos los valores para la primera iteracin a realizar:

i=0 , x i=0 , y i=0.52=0.25 ,h=0.2

Entonces comencemos por la primera iteracin:

K 1=f ( x0 , y 0 )
K 1=f ( 0 ,0.25 )

Remplazamos los valores en la funcin de la derivada para obtener el valor:

K 1= y x2 +1

K 1=0.2502 +1

K 1=0.25+1

K 1=1.25

Ahora continuaremos por cada uno de los valores:

K h
( h
K 2=f x 0 + , y 0 + 1
2 2 )
( 1.25 ) (0.2)
(
K 2=f 0+
0.2
2
,0.25+
2 )
0.25
(
K 2=f 0.1,0 .25+
2 )
K 2=f ( 0.1,0.25+ 0.125 )

K 2=f ( 0.1, 0.375 )

K 2= y x2 +1

K 2=0.3750.12 +1

K 2=0.3750.01+1

K 2=1.365

Continuamos con el siguiente valor:

K h
( h
K 3=f x 0 + , y 0 + 2
2 2 )
(
K 3=f 0+
0.2
2
,0.25+
(1.365)(0.2)
2 )
0.273
(
K 3=f 0.1 , 0.25+
2 )
K 3=f ( 0.1, 0.25+ 0.1365 )

K 3=f ( 0.1, 0.3865 )

K 3= y x2 +1

K 3=0.38650.12 +1

K 3=0.38650.01+1

K 3=1.3765

Y por ltimo con el ltimo valor:

K 4 =f ( x 0 +h , y 0 + K 3 h )

K 4 =f ( 0+ 0.2 ,0.25+ ( 1.3765 )( 0.2 ) )

K 4 =f ( 0.2 , 0.25+0.2753 )

K 4 =f ( 0.2 , 0.5253 )

K 4 = yx 2 +1

K 4 =0.52530.22+1

K 4 =0.52530.04+1

K 4 =1.4853

De esta forma hemos logrado obtener los valores de la primera iteracin:

X Y K1 K2 K3 K4
0 0.25 1.25 1.365 1.3765 1.4853
Para determinar la siguiente iteracin debemos hallar el siguiente valor de x1 y de
y 1 , primero resolveremos el valor para x:

x 1=x 0+ h

x 1=0+0.2

x 1=0.2

Luego el valor para y:

( k 1+ 2k 2+ 2k 3+ k 4 ) h
y 0+1= y 0+
6

( 1.25+2(1.365)+2(1.3765)+ 1.4853 ) 0.2


y 1=0.25+
6

( 1.25+2.73+2.753+1.4853 ) 0.2
y 1=0.25+
6

( 8.2183 ) 0.2
y 1=0.25+
6

1.64366
y 1=0.25+
6

y 1=0.25+0.27394

y 1=0.52394

Como tenemos ya los valores de x1 y de y 1 , procedemos a realizar la segunda


iteracin.

K 1=f ( 0.2, 0. 52394 )

K 1=0.523940.22 +1=0.523940.04+1=1.48394

( 1. 48394 ) (0.2)
(
K 2=f 0.2+
0.2
2
, 0. 52394+
2 ) (
=f 0.2+ 0.1 ,0. 52394+
0.29678
2 )
K 2=f ( 0.3 ,0. 52394+ 0.14839 )=f ( 0.3 , 0.67233 )

K 2=0. 672330.32+ 1=0. 672330.09+ 1=1.58233

(
K 3=f 0.2+
0.2
2
, 0. 52394+
(1. 58233)(0.2)
2 ) (
=f 0.2+0.1 , 0.52394 +
0.31646
2 )
K 3=f ( 0.3 ,0. 52394+ 0.15823 )=f ( 0.3 ,0.68217 )

K 3=0. 682170.32 +1=0. 682170.09+1=1.59217

K 4 =f ( 0.2+0.2 , 0. 52394+ ( 1. 59217 ) ( 0.2 ) ) = f ( 0.4 ,0. 52394+ 0.31843 )

K 4 =f ( 0.4 ,0.84237 )

2
K 4 =0. 842370.4 +1=0. 842370.16+1=1.68237

De esta forma hemos logrado obtener los valores de la segunda iteracin:

X Y K1 K2 K3 K4
0 0.25 1.25 1.365 1.3765 1.4853
0.2 0.52394 1.48394 1.58233 1.59217 1.68237

Para determinar la siguiente iteracin debemos hallar el siguiente valor de x2 y

de y 2 , primero resolveremos el valor para x:

x 2=x 1+ h=0.2+0.2 0.4

Luego el valor para y:

( 1. 48394+2(1.58233)+2(1.59217)+1. 68237 ) 0.2


y 2=0. 52394+
6

( 1. 48394+3.16466+ 3.18434+1. 68237 ) 0.2


y 2=0. 52394+
6
( 9.51531 ) 0.2 1.90306
y 2=0. 52394+ =0.52394 +
6 6

y 2=0. 52394+0.31717=0.84111

Como tenemos ya los valores de x2 y de y 2 , procedemos a realizar la tercera


iteracin.

K 1=f ( 0.4 , 0.84111 )

K 1=0.841110.42 +1=0.841110.16+1=1.68111

( 1.68111 ) (0.2)
(
K 2=f 0.4 +
0.2
2
, 0.84111+
2 ) (
=f 0.4+0.1 , 0. 84111+
0.33622
2 )
K 2=f ( 0.5 ,0. 84111+0.16811 ) =f ( 0.5 , 1.00922 )

2
K 2=1. 009220.5 +1=1.009220.25+1=1.75922

(
K 3=f 0.4 +
0.2
2
, 0. 84111+
(1. 75922)( 0.2)
2 ) (
=f 0.4+0.1 , 0. 84111+
0.35184
2 )
K 3=f ( 0.5 ,0. 84111+0.17592 )=f ( 0.5 ,1.01703 )

K 3=1. 017030.52+ 1=1. 017030.25+1=1.76703

K 4 =f ( 0.4 +0.2 , 0.84111+ ( 1. 76703 )( 0.2 ) ) = f ( 0.6 , 0. 84111+ 0.35340 )

K 4 =f ( 0.6 , 1.19451 )

K 4 =1.194510.62 +1=1. 194510.36+1=1.83451

De esta forma hemos logrado obtener los valores de la tercera iteracin:


X Y K1 K2 K3 K4
0 0.25 1.25 1.365 1.3765 1.4853
0.2 0.52394 1.48394 1.58233 1.59217 1.68237
0.4 0.84111 1.68111 1.75922 1.76703 1.83451

Para determinar la siguiente iteracin debemos hallar el siguiente valor de x3 y de


y 3 , primero resolveremos el valor para x:

x 3=x 2+ h=0.4 +0.2 0.6

Luego el valor para y:

( 1. 68111+2(1.75922)+2(1. 76703)+1. 83451 ) 0.2


y 3=0. 84111+
6

( 1. 68111+ 3.51844+3.53406+1. 83451 ) 0.2


y 3=0. 84111+
6

( 10.56812 ) 0.2 2.11362


y 3=0. 84111+ =0. 84111+
6 6

y 3=0. 84111+0.35227=1.19338

Como tenemos ya los valores de x3 y de y 3 , procedemos a realizar la cuarta


iteracin.

K 1=f ( 0.6 ,1. 19338 )

K 1=1.193380.62 +1=1.193380.36+1=1.83338

(1. 83338 ) ( 0.2)


(
K 2=f 0.6+
0.2
2
,1. 19338+
2 ) (=f 0.6+0.1 , 1.19338+
0.36667
2 )
K 2=f ( 0.7 ,1. 19338+0.18333 ) =f ( 0.7 , 1.37671 )

K 2=1. 376710.7 2+1=1.376710.49+1=1.88671


(
K 3=f 0.6+
0.2
2
,1. 19338+
(1. 88671)(0.2)
2 ) (
=f 0.6+0.1 , 1.19338+
0.37734
2 )
K 3=f ( 0.7 ,1. 19338+0.18867 )=f ( 0.7, 1.38205 )

K 3=1. 382050.72+ 1=1. 382050.49+1=1.89205

K 4 =f ( 0.6+ 0.2 ,1. 19338+ ( 1. 89205 )( 0.2 ) ) = f ( 0.8 , 1.19338+ 0.37841 )

K 4 =f ( 0.8 , 1.57179 )

K 4 =1.571790.82 +1=1. 571790.64 +1=1.93179

De esta forma hemos logrado obtener los valores de la cuarta iteracin:

X Y K1 K2 K3 K4
0 0.25 1.25 1.365 1.3765 1.4853
0.2 0.52394 1.48394 1.58233 1.59217 1.68237
0.4 0.84111 1.68111 1.75922 1.76703 1.83451
0.6 1.19338 1.83338 1.88671 1.89205 1.93179

Para determinar la siguiente iteracin debemos hallar el siguiente valor de x4 y de


y 4 , primero resolveremos el valor para x:

x 4=x 3 +h=0.6+0.2 0.8

Luego el valor para y:

( 1. 83338+2(1. 88671)+2(1. 89205)+ 1.93179 ) 0.2


y 4 =1.19338+
6

( 1. 83338+ 3.77342+ 3.7841+1. 93179 ) 0.2


y 4 =1.19338+
6

( 11.32269 ) 0.2 2.26453


y 4 =1.19338+ =0. 84111+
6 6
y 4 =1.19338+0.37742=1.5708

Como tenemos ya los valores de x4 y de y 4 , procedemos a realizar la ltima

iteracin y obtener los valores de K1 , K2 , K3 y K4 .

K 1=f ( 0.8 ,1. 5708 )

K 1=1.57080.82 +1=1.57080.64+1=1.9308

(1. 9308 ) ( 0.2)


(
K 2=f 0.8+
0.2
2
,1. 5708+
2 ) (
=f 0.8+0.1 , 1.5708+
0.38616
2 )
K 2=f ( 0.9 ,1. 5708+0.19308 )=f ( 0.9 ,1.76388 )

2
K 2=1. 763880.9 +1=1.763880.81+1=1.95388

(
K 3=f 0.8+
0.2
2
,1. 5708+
(1. 95388)(0.2)
2 ) (
=f 0.8+0.1 , 1.5708+
0.39077
2 )
K 3=f ( 0.9 ,1. 5708+0.19538 )=f ( 0.9 , 1.76618 )

K 3=1. 766180.9 2+1=1.766180.81+1=1.95618

K 4 =f ( 0.8+ 0.2 ,1. 5708+ ( 1. 95618 )( 0.2 ) ) = f ( 1, 1.5708+0.39123 )

K 4 =f ( 1 ,1.96203 )

K 4 =1. 9620312 +1=1.96203

Valores de la solucin del ejercicio:

X Y K1 K2 K3 K4
0 0.25 1.25 1.365 1.3765 1.4853
0.2 0.52394 1.48394 1.58233 1.59217 1.68237
0.4 0.84111 1.68111 1.75922 1.76703 1.83451
0.6 1.19338 1.83338 1.88671 1.89205 1.93179
0.8 1.5708 1.9308 1.95388 1.95618 1.96203

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