MÉTODOS NUMÉRICOS
2018
Página 1|9
Método de Runge Kutta - Fehlberg
Índice:
Página 2|9
Método de Runge Kutta - Fehlberg
Método De Runge-Kutta-Fehlberg
1. Marco teórico:
2. Método Runge-Kutta-Fehlberg:
𝒌𝟏 = 𝒉𝒇(𝒙𝒊 , 𝒘𝒊 )
𝒉 𝟏
𝒌𝟐 = 𝒉𝒇 (𝒙𝒊 + , 𝒘𝒊 + 𝒌𝟏 )
𝟒 𝟒
𝟑 𝟑 𝟗
𝒌𝟑 = 𝒉𝒇 (𝒙𝒊 + 𝒉, 𝒘𝒊 + 𝒌𝟏 + 𝒌 )
𝟖 𝟑𝟐 𝟑𝟐 𝟐
𝟏𝟐 𝟏𝟗𝟑𝟐 𝟕𝟐𝟎𝟎 𝟕𝟐𝟗𝟔
𝒌𝟒 = 𝒉𝒇 (𝒙𝒊 + 𝒉, 𝒘𝒊 + 𝒌𝟏 − 𝒌𝟐 + 𝒌 )
𝟏𝟑 𝟐𝟏𝟗𝟕 𝟐𝟏𝟗𝟕 𝟐𝟏𝟗𝟕 𝟑
Página 3|9
Método de Runge Kutta - Fehlberg
𝟏
𝑹= |𝒘
̅ − 𝒘𝒊+𝟏 |
𝒉 𝒊+𝟏
𝟏⁄
𝜹 = 𝟎. 𝟖𝟒(Ɛ⁄𝑹) 𝟒
16 6656 28561 9 2
𝑤
̅ 𝑖+1 = 𝑤𝑖 + 𝑘1 + 𝑘3 + 𝑘4 − 𝑘5 + 𝑘6
135 12825 56430 50 55
1 1 128 2197 1 2
ii. Tome 𝑅 = | 𝑘 − 𝑘3 − 𝑘4 − 𝑘5 + 𝑘6 |
ℎ 360 1 4275 75240 50 55
1
𝑅= |𝑤
̅ − 𝑤𝑖+1 |
ℎ 𝑖+1
1
𝛿 = 0.84(Ɛ⁄𝑅 ) ⁄4
iii. Si 𝑅 ≤ Ɛ entonces
a. Hacer 𝑥 = 𝑥 + ℎ
25 1408 2197 1
𝑤=𝑤+ 𝑘1 + 𝑘3 + 𝑘4 − 𝑘5
216 2565 4104 5
b. Hacer hδ
iv. Si 𝑅 > Ɛ entonces
a. Hacer hδ
Parar mientras
3. Mostrar: 𝑤
4. Fin
function rkf(f,a,b,y0,h,err)
fprintf('\n\t\t METODO DE RUNGE-KUTTA-FEHLBERG\n')
f=inline(f,'x','y');
x = a;
w = y0;
i = 0;
fprintf('\n\tPaso %d: x = %6.12f, w =%18.15f\n', i, x, w);
while x<b
h = min(h, 2-x);
k1 = h*f(x,w);
k2 = h*f(x+h/4, w+k1/4);
k3 = h*f(x+3*h/8, w+3*k1/32+9*k2/32);
k4 = h*f(x+12*h/13, w+1932*k1/2197-7200*k2/2197+7296*k3/2197);
k5 = h*f(x+h, w+439*k1/216-8*k2+3680*k3/513-845*k4/4104);
k6 = h*f(x+h/2, w-8*k1/27+2*k2-3544*k3/2565+1859*k4/4104-11*k5/40);
w1 = w + 25*k1/216+1408*k3/2565+2197*k4/4104-k5/5;
w2 = w + 16*k1/135+6656*k3/12825+28561*k4/56430-9*k5/50+2*k6/55;
R = abs(w1-w2)/h;
delta = 0.84*(err/R)^(1/4);
if R<=err %Se mantiene el paso "h" y se continua iterando
x = x+h;
w = w1;
i = i+1;
fprintf('\tPaso %d: x = %6.12f, w =%18.15f\n', i, x, w);
h = delta*h;
Página 5|9
Método de Runge Kutta - Fehlberg
4. Ejemplos ilustrativos:
4.1 Ejemplo:
Con h=0.2:
𝒚′ = 𝒚 − 𝒙 𝟐 + 𝟏
{
𝒚(𝟎) = 𝟎. 𝟓
𝟏
La solución exacta es 𝒚 = 𝒙𝟐 + 𝟐𝒙 + 𝟏 − 𝟐 𝒆𝒙 , y estamos interesados en el
valor de 𝒚(𝟐)
RESULTADO:
>> rkf('y-x^2+1',0,2,0.5,0.2,0.00001)
METODO DE RUNGE-KUTTA-FEHLBERG:
𝟏
𝒚(𝟐) = 𝒙𝟐 + 𝟐𝒙 + 𝟏 − 𝟐 𝒆𝒙 = 5.305471950534677
Note que el error es: |𝑦(2)−𝑤8 | = 0.0000148660380689947
5. Ejemplos aplicativos:
5.1 Ejemplo:
En cuanto al lazo 1:
𝟏 𝒅𝒊𝟏
+ 𝟐(𝒊𝟏 − 𝒊𝟐 ) = 𝟎
𝟐 𝒅𝒕
O sea
𝒅𝒊𝟏
+ 𝟒𝒊𝟏 − 𝟒𝒊𝟐 = 𝟎 … … … (𝟏)
𝒅𝒕
En cuanto al lazo 2:
𝟓
𝟔𝒊𝟐 − 𝟐𝒊𝟏 − 𝟑𝒊𝟏 = 𝟎 → 𝒊𝟐 = 𝒊 … … … (𝟐)
𝟔 𝟏
Entonces sustituyendo (2) en (1):
𝒅𝒊𝟏 𝟐
+ 𝒊 =𝟎
𝒅𝒕 𝟑 𝟏
Puesto que 𝒊𝟏 = 𝒊:
𝒅𝒊 𝟐
+ 𝒊=𝟎
𝒅𝒕 𝟑
𝒅𝒊 𝟐
𝒇(𝒊, 𝒕) = =− 𝒊
𝒅𝒕 𝟑
Entonces:
>> rkf('(-2)*y/3',0,2,10,0.02,0.0000001)
METODO DE RUNGE-KUTTA-FEHLBERG
𝒅𝒊 𝟐
=− 𝒊
𝒅𝒕 𝟑
Obtenemos:
𝒊(𝒕) = 𝟏𝟎𝒆−(𝟐⁄𝟑)𝒕 ; para 𝒕 > 𝟎
Entonces:
𝒊(𝟐) = 𝟏𝟎𝒆−(𝟐⁄𝟑)𝟐 = 𝟐. 𝟔𝟑𝟓𝟗𝟕𝟏𝟑𝟖𝟏𝟏𝟓𝟕𝟐𝟕
5.2 Ejemplo:
6. Bibliografía:
https://www.youtube.com/watch?v=Rs_dx8UnrP4&feature=youtu.be
http://www.frsn.utn.edu.ar/gie/an/mnedo/34_RK.html
Página 8|9
Método de Runge Kutta - Fehlberg
https://unac.edu.pe/images/documentos/organizacion/vri/cdcitra/Informes_Final
es_Investigacion/2011/Junio/IF_COLLANTE_HUANTO_FIME.pdf
https://es.wikipedia.org/wiki/M%C3%A9todo_de_Runge-Kutta-Fehlberg
https://www.youtube.com/watch?v=9g_geBN08IY
https://es.slideshare.net/teresacr71/runge-kutta-fehlberg
https://web.archive.org/web/20061209105041/http://math.fullerton.edu/mathews
/n2003/RungeKuttaFehlbergMod.html
http://metodosmatlab.blogspot.com/
Página 9|9