Runge Kutta 4to Orden
1
Metodo numérico Runge Kutta de cuarto orden Algoritmo en Matlab Esto se crea en otra pestaña con el nombre de f1 function ye=f1(x,y) ye=x*y+1; Esto también se crea en una diferente pestaña a la de arriba: clear x,y; x0=0; y0=21; xf=10; n=20; h=(xf-x0)/n; i=1; x(i)=x0; y(i)=y0; while i<=n k1=h*f1(x0,y0); k2=h*f1(x0+h/2,y0+k1/2); k3=h*f1(x0+h/2,y0+k2/2); k4=h*f1(x0+h,y0+k3); km=(k1+2*k2+2*k3+k4)/6; y1=y0+km; x1=x0+h; i=i+1; x(i)=x1; y(i)=y1; x0=x1; y0=y1; disp([y1]) end plot(x,y) grid on %disp([x1]) %disp([y1]) title('Método de Runge Kutta de cuarto orden')
-
Upload
davismoody -
Category
Documents
-
view
221 -
download
3
description
Algoritmo en Matlab
Transcript of Runge Kutta 4to Orden
![Page 1: Runge Kutta 4to Orden](https://reader036.fdocuments.ec/reader036/viewer/2022082516/563db960550346aa9a9cc0d3/html5/thumbnails/1.jpg)
Metodo numérico Runge Kutta de cuarto ordenAlgoritmo en Matlab
Esto se crea en otra pestaña con el nombre de f1
function ye=f1(x,y)ye=x*y+1;
Esto también se crea en una diferente pestaña a la de arriba:
clear x,y;x0=0;y0=21;xf=10;n=20;h=(xf-x0)/n;i=1;x(i)=x0;y(i)=y0;while i<=n k1=h*f1(x0,y0); k2=h*f1(x0+h/2,y0+k1/2); k3=h*f1(x0+h/2,y0+k2/2); k4=h*f1(x0+h,y0+k3); km=(k1+2*k2+2*k3+k4)/6; y1=y0+km; x1=x0+h; i=i+1; x(i)=x1; y(i)=y1; x0=x1; y0=y1; disp([y1])endplot(x,y)grid on%disp([x1])%disp([y1])title('Método de Runge Kutta de cuarto orden')