# EDO por Metodos Numericos

```UNIVERSIDAD DE LAS FUERZAS ARMADAS - ESPE
DEPARTAMENTO DE CIENCIAS EXACTAS
ÁREA DE ANÁLISIS FUNCIONAL
MÉTODOS NUMÉRICOS
Integrantes: Gómez Dennis, Jimbo Stephen, Males Hernán
NRC:2802
Fecha:05/04/2021
Tarea Nro.12 y Nro.13
Indicaciones.
las clases Nro. 23
las clases Nro. 24, 25 y 26
Pregunta 1.
Consideremos la siguiente ecuación diferencial de orden 2, resolver
utilizando el método de diferencias finitas, para 8 subintervalos.
 00
2y − y = f (x)



y(0) = 0
y(1) = 1



f (x) = 1 − e−x/2
h=
2(
1−0
= 0.125
8
yk+1 − 2yk + yk−1
) − yk = f (xk )
h2
1
1
yk+1 − 2yk + yk−1
− yk = f (xk )
h2
2
2
yk−1 + yk (−2 −
1 2
1
h ) + yk+1 = h2 f (xk )
2
2
Si k=1
y0 + y1 (−2 −
1
1
(0.125)2 ) + y2 = (0.125)2 f (0.125)
2
2
1
y1 (−2 −
1
1
(0.125)2 ) + y2 = (0.125)2 f (0.125)
2
2
Si k=2
y1 + y2 (−2 −
1
1
(0.125)2 ) + y3 = (0.125)2 f (0.25)
2
2
y2 + y3 (−2 −
1
1
(0.125)2 ) + y4 = (0.125)2 f (0.375)
2
2
y3 + y4 (−2 −
1
1
(0.125)2 ) + y5 = (0.125)2 f (0.50)
2
2
y4 + y5 (−2 −
1
1
(0.125)2 ) + y6 = (0.125)2 f (0.625)
2
2
y5 + y6 (−2 −
1
1
(0.125)2 ) + y7 = (0.125)2 f (0.75)
2
2
y6 + y7 (−2 −
1
1
(0.125)2 ) + y8 = (0.125)2 f (0.875)
2
2
y6 + y7 (−2 −
1
1
(0.125)2 ) = (0.125)2 f (0.875) − 1
2
2
Si k=3
Si k=4
Si k=5
Si k=6
Si k=7









−2.007812
1
0
0
0
0
0
1
−2.007812
1
0
0
0
0
0
1
−2.007812
1
0
0
0
0
0
1
−2.007812
1
0
0
0
0
0
1
−2.007812
1
0







x=












y=





0
0
0
0
1
−2.007812
1
0
0.125
0.25
0.375
0.50
0.625
0.75
0.875
1

0
0.1110
0.2234
0.3384
0.4574
0.5817
0.7127
0.8516
1

0
0
0
0
0
1
−2.007812









y1
y2
y3
y4
y5
y6
y7


 
 
 
 
=
 
 
 
0.000473
0.000918
0.001336
0.001728
0.002097
0.002443
−0.997232

































P = 0.99864x8 − 3.9114x7 + 6.2987x6 − 5.384x5 + 2.626x4 − 0.61319x3 + 0.10463x2 + 0.88051x
2
Pregunta 2.
Consideremos la siguiente ecuación diferencial.

00

y = f (x, y)
y(1) = 0.25

f (x, y) = x − ey
Encontrar:
a) y(2), considerar 8 intervalos;
b) Una solución numérica aproximada utilizando el método de
Euler
Método de Euler
yk+1 = yk + h.f (xk , yk )
yk = f (x, y) = xk − eyk
yk+1 = yk + (xk − eyk )h
• Si k=0
y1 = (0, 25) + (1 − e0.25 )(0.125)
y1 = 0.214497
• Si k=1
y2 = (0.214497) + (1.125 − e0.214497 )(0.125)
3
y2 = 0.200217
• Si k=2
y3 = (0.200217) + (1.25 − e0.200217 )(0.125)
y3 = 0.203759
• Si k=3
y4 = (0.203759) + (1.375 − e0.203759 )(0.125)
y4 = 0.222384
• Si k=4
y5 = (0.222384) + (1.5 − e0.222384 )(0.125)
y5 = 0.253753
• Si k=5
y6 = (0.253753) + (1.625 − e0.253753 )(0.125)
y6 = 0.295771
• Si k=6
y7 = (0.295771) + (1.75 − e0.295771 )(0.125)
y7 = 0.346501
• Si k=7
y8 = (0.346501) + (1.875 − e0.346501 )(0.125)
y8 = 0.404112
k
0
1
2
3
4
5
6
7
8
xk
1
1.125
1.25
1.375
1.5
1.625
1.75
1.875
2
yk
0.25
0.214497
0.200217
0.203759
0.222384
0.253753
0.295771
0.346501
0.404112
Interpolando los nodos formados, obtenemos la siguiente solución:
P (x) = 1.0232e − 12x8 − 0.01498x7 + 0.18277x6 − 0.96693x5 + 2.8925x4 − 5.4689x3 + 7.1117x2 − 5.9237x1 + 2.4376
4
Pregunta 3.
Realizar el mismo proceso de la pregunta 2), pero utilice el
método de Heun.
Metodo Heum
yk0 = f (x, y) = xk − eyk
yk+1 = yk + (xk − eyk )h
yk+1 = yk +
h
[f (xk , yk ) + f (xk+1 , yk + hf (xk , yk )]
2
yk+1 = yk +
yk
h
[xk − eyk + (xk+1 − eyk +(xk +e )h ]
2
• Si k=0
y1 = 0.25 +
0.25
0.125
)0.125
[1 − e0.25 + (1.125 − e0.25+(1+e
]
2
y1 = 0.195792
• Si k=1
y2 = 0.195792 +
0.195792
0.125
)0.125
[1.125 − e0.195792 + (1.25 − e0.195792+(1.125+e
]
2
y2 = 0.166351
• Si k=2
y3 = 0.166351 +
0.166351
0.125
)0.125
[1.25 − e0.166351 + (1.375 − e0.166351+(1.25+e
]
2
y3 = 0.156579
• Si k=3
y4 = 0.156579 +
0.156579
0.125
)0.125
[1.375 − e0.156579 + (1.5 − e0.156579+(1.375+e
]
2
5
y4 = 0.162708
• Si k=4
y5 = 0.162708 +
0.162708
0.125
)0.125
[1.5 − e0.162708 + (1.625 − e0.162708+(1.5+e
]
2
y5 = 0.181711
• Si k=5
y6 = 0.181711 +
0.181711
0.125
)0.125
[1.625 − e0.181711 + (1.75 − e0.181711+(1.625+e
]
2
y6 = 0.211006
• Si k=6
y7 = 0.211006 +
0.211006
0.125
)0.125
[1.75 − e0.211006 + (1.875 − e0.211006+(1.75+e
]
2
y7 = 0.248298
• Si k=7
y8 = 0.248298 +
0.248298
0.125
)0.125
[1.875 − e0.248298 + (2 − e0.248298+(1.875+e
]
2
y8 = 0.291495
k
0
1
2
3
4
5
6
7
8
xk
1
1.125
1.25
1.375
1.5
1.625
1.75
1.875
2
yk
0.25
0.195792
0.166351
0.156579
0.162708
0.181711
0.211006
0.248298
0.291495
Interpolando los nodos formados, obtenemos la siguiente solución:
P (x) = 0.037865x8 − 0.49995x7 + 2.9059x6 − 9.7391x5 + 20.679x4 − 28.848x3 + 26.731x2 − 15.73x1 + 4.7128
6
Comparacion y Error entre Metodo de Euler y Haun:
7
8
```