Professional Documents
Culture Documents
𝑦 ′ = 𝑓1 (𝑥, 𝑦, 𝑧)
𝑧 ′ = 𝑓2 (𝑥, 𝑦, 𝑧)
Donde solo se emplea z como una nueva variable a fin de no usar sub índices dobles
en las ecuaciones
ℎ
𝑦𝑖+1 = 𝑦𝑖 + ∗ (𝑘1 + 2𝑘2 + 2𝑘3 + 𝑘4 )
6
ℎ
𝑧𝑖+1 = 𝑧𝑖 + ∗ (𝑐1 + 2𝑐2 + 2𝑐3 + 𝑐4 )
6
Las cuales se calculan alternadamente, y las 𝑘 y 𝑐 se obtienen de:
𝑘1 = 𝑓1 (𝑥𝑖 , 𝑦𝑖 , 𝑧𝑖 )
𝑐1 = 𝑓2 (𝑥𝑖 , 𝑦𝑖 , 𝑧𝑖 )
Calculando las segundas constantes
ℎ ℎ𝑘1 ℎ𝑐1
𝑘2 = 𝑓1 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + )
2 2 2
ℎ ℎ𝑘1 ℎ𝑐1
𝑐2 = 𝑓2 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + )
2 2 2
Calculando las terceras constantes
ℎ ℎ𝑘2 ℎ𝑐2
𝑘3 = 𝑓1 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + )
2 2 2
ℎ ℎ𝑘2 ℎ𝑐2
𝑐3 = 𝑓2 (𝑥𝑖 + , 𝑦𝑖 + , 𝑧𝑖 + )
2 2 2
Calculando las cuartas constantes
𝑘4 = 𝑓1 (𝑥𝑖 + ℎ, 𝑦𝑖 + ℎ𝑘3 , 𝑧𝑖 + ℎ𝑐3 )
𝑐4 = 𝑓2 (𝑥𝑖 + ℎ, 𝑦𝑖 + ℎ𝑘3 , 𝑧𝑖 + ℎ𝑐3 )
Las cuales son calculadas en ese orden
clc, clear
%METODO DE RANGE KUTTA
disp(' RANGE KUTTA')
syms i1 i2 t
%CONDICIONES INICIAES
i10=0; i20=0; t0=0;
%PRIMERA FUNCION
di1=60-50*i2
%SEGUNDA FUNCION
di2=(i1-i2)/0.005
%MARCA DE PASO
h=0.04;
n=4;
while i<=n
i1=i10; i2=i20; t=t0;
k1=eval(di1); c1=eval(di2);
t=t0+h/2; i1=i10+h/2*k1; i2=i20+h/2*c1;
k2=eval(di1); c2=eval(di2);
t=t0+h/2; i1=i10+h/2*k2; i2=i20+h/2*c2;
k3=eval(di1); c3=eval(di2);
t=t0+h; i1=i10+h*k3; i2=i20+h*c3;
k4=eval(di1); c4=eval(di2);
i10=i10+h/6*(k1+2*k2+2*k3+k4);
i20=120+h/6*(c1+2*c2+2*c3+c4);
t0=t0+h;
i=i+1;
fprintf('%i %4.4f %4.4f %4.4f\n',i,t0,i10,i20)
end
N
m 0,01 kg k 1 2,0
cm
N N
c 2,0 k 2 0,2
cm cm 3
Al inicio el objeto está a 10 cm del objeto en la dirección positiva del eje x, y su
velocidad en cm
Utilizando el algoritmo de Runge Kutta, determinar ambas corrientes después de
t=0,04 s. Realizar mínimo dos iteraciones.
SOLUCION
Se tiene la siguiente ecuación diferencial de segundo orden
𝑑2 𝑥 𝑑𝑥
𝑚∗ 2
+𝑐∗ + 𝑘1 𝑥 − 𝑘2 𝑥 3 = 0
𝑑𝑡 𝑑𝑡
Cambio de notación
𝑚 ∗ 𝑥 ′′ + 𝑥 ′ + 𝑘1 ∗ 𝑥 − 𝑘2 ∗ 𝑥 3 = 0
Tomando un cambio de variable
𝑦 = 𝑥′
𝑥′ = 𝑦
𝑘2 ∗ 𝑥 3 − 𝑐 ∗ 𝑦 − 𝑘1 ∗ 𝑥
𝑦′ =
𝑚
Hallando las condiciones iniciales
𝑡(0) = 0
𝑥(0) = 10
𝑑2 𝑥
Sabemos que la segunda derivada 𝑑𝑡 2
es la aceleración, por lo tanto cuando el tiempo
es cero la aceleración también es 0
𝑦 ′ = 𝑘2 ∗ 𝑥 3 − 𝑦 − 𝑘1 ∗ 𝑥