Está en la página 1de 3

MÉTODOS NUMÉRICOS AVANZADOS

Método de la secante

𝐹(𝑡𝑘 )(𝑡𝑘 − 𝑡𝑘−1 )


𝑡𝑘+1 = 𝑡𝑘 −
𝐹(𝑡𝑘 ) − 𝐹(𝑡𝑘−1 )
Ejercicio
Consideremos el siguiente problema de frontera
𝑟𝑢′′ + 𝑢′ = −4𝑟 𝑟 ∈ [1,3]
1
𝑢(1) = 𝐼𝑛 ( ) − 1, 𝑢(3) − 𝑢′ (3) = 0.5(𝐼𝑛(3) − 7)
3
a) Aproxima la solución del problema mediante el método de disparo con secante, tomando 10
subintervalos y una tolerancia de 10−7
b) Teniendo en cuenta que la solución exacta es:
𝑟 1
𝑢(𝑟) = ln ( ) + 𝐼𝑛(𝑟) − 𝑟 2
3 2
Solución:
Condiciones:
𝑢(3) − 𝑢′ (3) − 0.5(𝐼𝑛(3) − 7) = 0 → 𝑦(𝑏) − 𝑦 ′ (𝑏) − 𝛽 = 0
Lo que es lo mismo:
𝑦(𝑏) − 𝑦 ′ (𝑏) − 𝛽 = 𝐹(𝑡𝑘 )
Adaptamos al método de la secante:
(𝑦𝑘 (𝑏) − 𝑦𝑘′ (𝑏) − 𝛽)(𝑡𝑘 − 𝑡𝑘−1 )
𝑡𝑘+1 = 𝑡𝑘 −
(𝑦𝑘 (𝑏) − 𝑦𝑘′ (𝑏) − 𝛽) − (𝑦𝑘−1 (𝑏) − 𝑦𝑘−1
′ (𝑏) − 𝛽)
El 𝛽 se elimina, por lo tanto:
(𝑦𝑘 (𝑏) − 𝑦𝑘′ (𝑏) − 𝛽)(𝑡𝑘 − 𝑡𝑘−1 )
𝑡𝑘+1 = 𝑡𝑘 −
𝑦𝑘 (𝑏) − 𝑦𝑘′ (𝑏) − 𝑦𝑘−1 (𝑏) + 𝑦𝑘−1
′ (𝑏)
Método de diferencias finitas
𝑦 ′′ = 𝑝(𝑥)𝑦 ′ + 𝑞(𝑥)𝑦 + 𝑟(𝑥)
El método consiste en transformar nuestro problema en un sistema de ecuaciones lineales, cuyas
incógnitas son los valores aproximados de y(x) en los nodos elegidos del intervalo [a, b].

Transformación del problema utilizando diferencias centrales:


𝑓(𝑥 + ℎ) − 2𝑓(𝑥) + 𝑓(𝑥 − ℎ)
𝑦 ′′ ≈
ℎ2
𝑓(𝑥 + ℎ) − 𝑓(𝑥 − ℎ)
𝑦′ ≈
2ℎ
𝑦(𝑥 + ℎ) − 2𝑦(𝑥) + 𝑦(𝑥 − ℎ) 𝑦(𝑥 + ℎ) − 𝑦(𝑥 − ℎ)
2
= 𝑝(𝑥) + 𝑞(𝑥)𝑦 + 𝑟(𝑥)
ℎ 2ℎ
Discretizamos y aproximamos:
𝑏−𝑎
ℎ= , 𝑥𝑖 = 𝑎 + 𝑖ℎ, 𝑖 = 0,1,2, … , 𝑁 + 1 𝑦𝑖 ≈ 𝑦(𝑥𝑖 )
𝑁+1

𝑦𝑖+1 − 2𝑦𝑖 + 𝑦𝑖−1 𝑦𝑖+1 − 𝑦𝑖−1


2
= 𝑝(𝑥𝑖 ) + 𝑞(𝑥𝑖 )𝑦𝑖 + 𝑟(𝑥𝑖 ), 𝑖 = 1,2, … , 𝑁
ℎ 2ℎ
Resolviendo tenemos lo siguiente:
𝑦𝑖+1 − 2𝑦𝑖 + 𝑦𝑖−1 𝑦𝑖+1 − 𝑦𝑖−1
ℎ2 2
= ℎ2 𝑝(𝑥𝑖 ) + ℎ2 𝑞(𝑥𝑖 )𝑦𝑖 + ℎ2 𝑟(𝑥𝑖 ), 𝑖 = 1,2, … , 𝑁
ℎ 2ℎ
ℎ𝑝(𝑥𝑖 ) ℎ𝑝(𝑥𝑖 )
𝑦𝑖+1 − 2𝑦𝑖 + 𝑦𝑖−1 = 𝑦𝑖+1 − 𝑦𝑖−1 + ℎ2 𝑞(𝑥𝑖 )𝑦𝑖 + ℎ2 𝑟(𝑥𝑖 ), 𝑖 = 1,2, … , 𝑁
2 2
ℎ𝑝(𝑥𝑖 ) ℎ𝑝(𝑥𝑖 )
𝑦𝑖−1 + 𝑦𝑖−1 − 2𝑦𝑖 − ℎ2 𝑞(𝑥𝑖 )𝑦𝑖 + 𝑦𝑖+1 − 𝑦𝑖+1 = ℎ2 𝑟(𝑥𝑖 ), 𝑖 = 1,2, … , 𝑁
2 2
ℎ𝑝(𝑥𝑖 ) ℎ𝑝(𝑥𝑖 )
𝑦𝑖−1 (1 + ) − 𝑦𝑖 (2 + ℎ2 𝑞(𝑥𝑖 )) + 𝑦𝑖+1 (1 − ) = ℎ2 𝑟(𝑥𝑖 ), 𝑖 = 1,2, … , 𝑁
2 2

Finalmente:

ℎ𝑝(𝑥𝑖 ) ℎ𝑝(𝑥𝑖 )
− (1 + ) 𝑦𝑖−1 + (2 + ℎ2 𝑞(𝑥𝑖 ))𝑦𝑖 − (1 − ) 𝑦𝑖+1 = −ℎ2 𝑟(𝑥𝑖 ), 𝑖 = 1,2, … , 𝑁
2 2

Forma matricial y resolución


𝐴𝑦 = 𝑑
ℎ𝑝(𝑥1 ) ℎ𝑝(𝑥1 )
𝑖 = 1, → − (1 + ) 𝑦0 + (2 + ℎ2 𝑞(𝑥1 ))𝑦1 − (1 − ) 𝑦2 = −ℎ2 𝑟(𝑥1 )
2 2

ℎ𝑝(𝑥2 ) ℎ𝑝(𝑥2 )
𝑖 = 2, → − (1 + ) 𝑦1 + (2 + ℎ2 𝑞(𝑥2 ))𝑦2 − (1 − ) 𝑦3 = −ℎ2 𝑟(𝑥2 )
2 2

ℎ𝑝(𝑥3 ) ℎ𝑝(𝑥3 )
𝑖 = 3, → − (1 + ) 𝑦2 + (2 + ℎ2 𝑞(𝑥3 ))𝑦3 − (1 − ) 𝑦4 = −ℎ2 𝑟(𝑥3 )
2 2
.
.
.
ℎ𝑝(𝑥𝑛−1 ) ℎ𝑝(𝑥𝑛 )
𝑖 = 𝑛 − 1, → − (1 + ) 𝑦𝑛−2 + (2 + ℎ2 𝑞(𝑥𝑛 ))𝑦𝑛−1 − (1 − ) 𝑦𝑛 = −ℎ2 𝑟(𝑥𝑛−1 )
2 2

ℎ𝑝(𝑥𝑛 ) ℎ𝑝(𝑥𝑛 )
𝑖 = 𝑛, → − (1 + ) 𝑦𝑛−1 + (2 + ℎ2 𝑞(𝑥𝑛 ))𝑦𝑛 − (1 − ) 𝑦𝑛+1 = −ℎ2 𝑟(𝑥𝑛 )
2 2

Matriz de coeficientes
ℎ𝑝(𝑥1 )
(2 + ℎ2 𝑞(𝑥1 )) − (1 − ) 0 … 0 0
2
ℎ𝑝(𝑥2 ) ℎ𝑝(𝑥3 )
− (1 + ) (2 + ℎ2 𝑞(𝑥2 )) − (1 + ) … 0 0
2 2
ℎ𝑝(𝑥3 )
0 − (1 + ) +(2 + ℎ2 𝑞(𝑥3 )) … 0 0
2
. . . … . .
. . . … . .
. . . … . .
ℎ𝑝(𝑥𝑛 )
0 0 0 … (2 + ℎ2 𝑞(𝑥𝑛 )) − (1 − )
2
ℎ𝑝(𝑥𝑛 )
0 0 0 … − (1 + ) (2 + ℎ2 𝑞(𝑥𝑛 ))
( 2 )

Términos independientes e incógnitas


ℎ𝑝(𝑥1 )
−ℎ2 𝑟(𝑥1 ) + (1 + )
2
−ℎ2 𝑟(𝑥2 ) 𝑦1
. 𝑦2
. , ..
.
. 𝑦𝑛−1
−ℎ2 𝑟(𝑥𝑛−1 ) ( 𝑦𝑛 )
ℎ𝑝(𝑥𝑛 )
−ℎ2 𝑟(𝑥𝑛 ) + (1 − )
( 2 )

También podría gustarte