Vous êtes sur la page 1sur 6

«Año de la diversidad, productividad y del fortalecimiento»

UNIVERSIDAD NACIONAL DEL CENTRO DEL PERÚ


FACULTAD DE INGENIERÍA QUÍMICA

MÉTODOS DIFERENCIACIÓN NUMÉRICA –


NUMÉRICOS INTEGRACIÓN MÚLTIPLE

ALUMNO|SOLIS HUAROC YAMPIER

HUANCAYO - PERÚ
ECUACIONES DFERENCIALES ORDINARIAS

SEA: LA ECUACIÓN DIFERENCIAL


𝑑𝑦 2𝑥
= +𝑥
𝑑𝑥 𝑦

Si y(0)=24
x0=3
x1=7
h=0.5
n=8

MÉTODO DE EULER
f=input('\nIngrese la ecuacion diferencial de la forma:
dy/dx=f(x,y)\n','s');
x0=input('\nIngrese el primer punto x0:\n');
x1=input('\nIngrese el segundo punto x1:\n');
y0=input('\nIngrese la condicion inicial y(x0):\n');
n=input('\nIngrese el numero de pasos n:\n');
h=(x1-x0)/n;
xs=x0:h:x1;
y1=y0;
fprintf('\n''it x0 x1 y1');
for i=1:n
it=i-1;
x0=xs(i);
x=x0;
x1=xs(i+1);
y=y0;
y1=y0+h*eval(f);
fprintf('\n%2.0f%10.6f%10.6f%10.6f\n',it,x0,x1,y1);
y0=y1;
end
fprintf('\n El punto aproximado y(x1) es = %10.6f\n',y1);

>> euler

Ingrese la ecuacion diferencial de la forma: dy/dx=f(x,y)

2.*x./y+x

Ingrese el primer punto x0: 3

Ingrese el segundo punto x1: 7

Ingrese la condicion inicial y(x0): 24

Ingrese el numero de pasos n: 360

356 6.955556 6.966667 44.927166


357 6.966667 6.977778 45.008020

358 6.977778 6.988889 45.088996

359 6.988889 7.000000 45.170095

El punto aproximado y(x1) es = 45.170095

MÉTODO DE EULER MODIFICADO

clear all,clc;
xspan=[3 7];N=8;
f=inline('2*x/y+x','x','y');
h=(xspan(2)-xspan(1))/N;
x=xspan(1)+[0:N]'*h;
y0=24;
y(:,1)=y0(:)';
disp(' f1 f2 ')
for k=1:N
f1=f(x(k),y(:,k));f1=f1(:)';
f2=f(x(k)+h,y(:,k)+h*f1);f2=f2(:)';
y(:,k+1) =y(:,k)+ h*(f1+f2)/2;
fprintf(' %10.5f %10.5f\n',f1,f2)
end
disp(' x y ')
disp([x y(:)])
plot(x,y(:),'-o')
title('Solución de y''=2*x/y+x por el Método de Euler Modificado')
xlabel('x');ylabel('y');

f1 f2

3.25000 3.77317

3.77178 4.28942

4.28807 4.80085

4.79957 5.30823

5.30703 5.81229

5.81117 6.31368

6.31265 6.81297

6.81203 7.31064

xy

3.000000000000000 24.000000000000000
3.500000000000000 25.755792682926831

4.000000000000000 27.771093053669325

4.500000000000000 30.043323167334293

5.000000000000000 32.570272986972512

5.500000000000000 35.350102337059205

6.000000000000000 38.381315314770667

6.500000000000000 41.662720632965964

7.000000000000000 45.193387177665869

Solución de y'=2*x/y+x por el Método de Euler Modificado


50

45

40

35
y

30

25

20
3 3.5 4 4.5 5 5.5 6 6.5 7
x

MÉTODO DE TAYLOR

MÉTODO DE R. KUTTA DE 2° ORDEN

f=input('\n Ingrese la ecuacion diferencial dy/dx=\n','s');


x0=input('\n Ingrese el primer punto x0:\n');
x1=input('\n Ingrese el segundo punto x1:\n');
y0=input('\n Ingrese la condicion inicial y(x0):\n');
n=input('\n Ingrese el numero de pasos n:\n');
h=(x1-x0)/n;
xs=x0:h:x1;
fprintf('\n''it x0 y(x1)');
for i=1:n
it=i-1;
x0=xs(i);
x=x0;
y=y0;
k1=h*eval(f);
x=xs(i+1);
y=y0+k1;
k2=h*eval(f);
y0=y0+(k1+k2)/2;
fprintf('\n%2.0f%10.6f%10.6f\n',it,x0,y0);
end
fprintf('\n El punto aproximado y(x1) es = %8.6f\n',y0);

>> KUTTA

Ingrese la ecuacion diferencial dy/dx=

2.*x./y+x

Ingrese el primer punto x0: 3

Ingrese el segundo punto x1: 7

Ingrese la condicion inicial y(x0): 24

Ingrese el numero de pasos n: 8

'it x0 y(x1)

0 3.000000 25.755793

1 3.500000 27.771093

2 4.000000 30.043323

3 4.500000 32.570273

4 5.000000 35.350102

5 5.500000 38.381315

6 6.000000 41.662721

7 6.500000 45.193387

El punto aproximado y(x1) es = 45.193387


>∆

r1=824000*e^-13700/T*((0.8-x1-x2)*(0.2-x1-x2)/(1-x2)^2);
r2=468*e^-3460/T*((0.8-x1-x2)*(0.2-x1-x2)/(1-x2)^2);
x1=0
x2=0
AT=(3.14*D*ho(Ts-T)-r1(H1+r2*H2)*3.14*D^2/4)/F*Cp

Vous aimerez peut-être aussi