Documentos de Académico
Documentos de Profesional
Documentos de Cultura
{ x ' =12+
Donde
y '=
3
200
200
x−
y−
3
200
200
y
x
t(0)=0;tf=30
x(0)=0;xf=?
y(0)=280;yf=?
function edoysedo
clc
%PROBLEMA DE VALOR INICIAL
syms x y t
dx=12+(1/100)*y-(7/200)*x;%ECUACION DIFERENCIAL ORDINARIA
dy=(3/200)*x-(3/200)*y;
xi=0;yi=280;ti=0;
tf=30;
n=input('ingrese el numero de intervalos: ');%NUMERO DE INTERVALOS.
INTERVALOS
h=(tf-ti)/n;
i=0;
k=0;
while k<n
t=ti;
x=xi;
y=yi;
k1=eval(dx);
c1=eval(dy);
t=ti+(h/2);
UNIVERSIDAD NACIONAL DEL CENTRO DEL PERU
FACULTAD DE INGENIERIA QUIMICA
ESCUELA PROFESIONAL ACADEMICA DE INGENIERIA QUIMICA
x=xi+(h/2)*k1;
y=yi+(h/2)*c1;
k2=eval(dx);
c2=eval(dy);
x=xi+(h/2)*k2;
y=yi+(h/2)*c2;
k3=eval(dx);
c3=eval(dy);
x=xi+h*k3;
y=yi+h*c3;
k4=eval(dx);
c4=eval(dy);
x1=xi+(h/6)*(k1+2*k2+2*k3+k4);
y1=yi+(h/6)*(c1+2*c2+2*c3+c4);
ti=t;
x=x1;
y=yi;
i=i+1;
k=k+1;
end
fprintf('En %2.0f intervalos hay %2.4f de cantidad de salmuera en A, en B
%2.4f \n',i,x,y)
end
ingrese el numero de intervalos: 5
En 5 intervalos hay 79.4789 de cantidad de salmuera en A, en B
280.0000
>>