Professional Documents
Culture Documents
GUTIERREZ CHIAPAS
INGENIERIA QUIMICA
METODOS NUMERICOS I
GRUPO: Q4B
1
INDICE
PROCEDIMIENTO ………………………………………………………………………3
RESULTADOS ………………………………………………………………………………6
2
I. PROBLEMA DE APLICACIÓN DE LOS METODOS NUMERICO
Un proyecto de diseño de Ingeniería Química requiere que se calcule exactamente el volumen molar
(v) del Bióxido de Carbono y el Oxígeno para diferentes combinaciones de temperatura y presión,
de tal forma que los recipientes que contengan dichos gases se puedan seleccionar
apropiadamente. También es importante examinar que tan bien se apega cada gas a la ley de los
gases ideales, comparando el volumen molar calculado con la ecuación de los Gases Ideales y la
Ecuación de Van dar Waals. Se proporcionan los siguientes datos:
OXIGENO 1.360
OXIGENO 0.03183
3
Presión
Tolerancia
Numero de iteraciones
disp ('---------------------------------------------------')
disp (' LEYES DE LOS GASES IDEALES Y NO IDEALES ')
disp ('---------------------------------------------------')
fprintf('\n');
disp ('1. Bioxido de carbono')
disp ('2. Oxigeno')
fprintf('\n');
opcion=input (' Ingrese la opcion: ');
r=0.082054;
switch opcion
case 1
a1=3.592;
b1=0.04267;
fprintf('\n');
t1=input (' -Ingrese LA TEMPERATURA (°K): ');
p1=input (' -Ingrese en PRESION (atm): ');
tol=input (' -Ingrese la tolerancia: ');
n= input (' -Ingrese el número de iteraciones: ');
i=1;
%valor inicial v
v1=r*t1/p1;
fprintf('\n');
fprintf ('Valor inicial: %5.5f \n’, v1);
fprintf('\n');
disp ('-------------------------------')
disp (' TABLA DE RESULTADOS ')
disp ('-------------------------------')
disp ('i Vm(L/mol) |E| ')
disp ('-------------------------------')
while i<n
f1=(p1+a1/(v1^2)) *(v1-b1)-r*t1;
f2=p1-a1/(v1^2) +(2*a1*b1)/(v1^3);
4
y=v1-f1/f2;
k=abs(v1-y);
fprintf ('%d %5.5f %5.5f\n’, i, v1, k);
if(k<tol)
disp ('El volumen molar del Bioxido de carbono es: ')
disp(y)
break;
else
v1=y;
end
i=i+1;
end
case 2
a2=1.360;
b2=0.03183;
fprintf('\n');
t2=input (' -Ingrese LA TEMPERATURA (°K): ');
p2=input (' -Ingrese en PRESION (atm): ');
tol=input (' -Ingrese la tolerancia: ');
n= input (' -Ingrese el número de iteraciones: ');
i=1;
%valor inicial v
v2=r*t2/p2;
fprintf('\n');
fprintf ('Valor inicial: %5.5f \n’, v2);
fprintf('\n');
disp ('-------------------------------')
disp (' TABLA DE RESULTADOS ')
disp ('-------------------------------')
disp ('i Vm(L/mol) |E| ')
disp ('-------------------------------')
while i<=n
f1=(p2+a2/(v2^2)) *(v2-b2)-r*t2;
f2=p2-a2/(v2^2) +(2*a2*b2)/(v2^3);
y=v2-f1/f2;
k=abs(v2-y);
fprintf ('%d %5.5f %5.5f\n’, i, v2, k);
5
if(k<tol)
disp ('El volumen molar del Oxigeno es: ')
disp(y)
break;
else
v2=y;
end
i=i+1;
end
otherwise
disp ('ERROR: La opcion no existe')
end
2. RESULTADOS
Para el gas: BIOXIDO DE CARBONO
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 1
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 24.61620 0.10361
2 24.51259 0.00000
6
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 1
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 2.46162 0.10683
2 2.35479 0.00029
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 1
Ingrese LA TEMPERATURA (°K): 300
Ingrese en PRESION (atm): 100
Ingrese la tolerancia: 0.001
Ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
7
------------------------------------
1 0.24616 0.12723
2 0.11893 0.08405
3 0.03488 0.01107
4 0.04596 0.01201
5 0.05796 0.01114
6 0.06910 0.00755
7 0.07665 0.00262
8 0.07927 0.00024
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 1
Ingrese LA TEMPERATURA (°K): 500
Ingrese en PRESION (atm): 1
Ingrese la tolerancia: 0.001
Ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 41.02700 0.04489
2 40.98211 0.00000
El volumen molar del Bióxido de carbono es:
40.9821
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 1
8
Ingrese LA TEMPERATURA (°K): 500
Ingrese en PRESION (atm): 10
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 4.10270 0.04491
2 4.05779 0.00001
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 1
Ingrese LA TEMPERATURA (°K): 500
Ingrese en PRESION (atm): 100
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 0.41027 0.04305
2 0.36722 0.00092
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
9
Ingrese la opcion: 1
Ingrese LA TEMPERATURA (°K): 700
Ingrese en PRESION (atm): 1
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 57.43780 0.01984
2 57.41796 0.00000
Ingrese la opcion: 1
Ingrese LA TEMPERATURA (°K): 700
Ingrese en PRESION (atm): 10
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 5.74378 0.01961
2 5.72417 0.00000
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
10
Ingrese la opcion: 1
Ingrese LA TEMPERATURA (°K): 700
Ingrese en PRESION (atm): 100
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 0.57438 0.01678
2 0.55760 0.00005
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 300
Ingrese en PRESION (atm): 1
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 24.61620 0.02340
2 24.59280 0.00000
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
11
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 300
Ingrese en PRESION (atm): 10
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 2.46162 0.02321
2 2.43841 0.00000
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 300
Ingrese en PRESION (atm): 100
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 0.24616 0.01952
2 0.22664 0.00028
12
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 500
Ingrese en PRESION (atm): 1
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 41.02700 0.00129
2 41.02571 0.00000
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 500
Ingrese en PRESION (atm): 10
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 4.10270 0.00107
2 4.10163 0.00000
13
El volumen molar del Oxigeno es
4.1016
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 500
Ingrese en PRESION (atm): 100
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 0.41027 0.00134
2 0.41161 0.00000
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 700
Ingrese en PRESION (atm): 1
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
14
i V.m.(L/mol) |ξ|
------------------------------------
1 57.43780 0.00817
2 57.44597 0.00000
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 700
Ingrese en PRESION (atm): 10
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 5.74378 0.00832
2 5.75210 0.00000
---------------------------------------------------
LEYES DE LOS GASES IDEALES Y NO IDEALES
---------------------------------------------------
1. Bióxido de carbono
2. Oxigeno
Ingrese la opcion: 2
Ingrese LA TEMPERATURA (°K): 700
Ingrese en PRESION (atm): 100
Ingrese la tolerancia: 0.001
ingrese el número de iteraciones: 20
------------------------------------
TABLA DE RESULTADOS
15
------------------------------------
i V.m.(L/mol) |ξ|
------------------------------------
1 0.57438 0.00982
2 0.58420 0.00001
16
TABLA FINAL
17
Ahora utilizaremos el método de la Bisección para obtener los volúmenes aproximados.
ALGORITMO DE LA BISECCION
disp ('-----------------------')
disp ('METODO DE LA BISECCION')
disp ('-----------------------')
fprintf('\n')
fun=input ('Ingrese la funcion de Van der Waals f(x)=','s');
f=inline(fun);
p=input ('Ingrese el volumen molar inicial: ');
r=input ('Ingrese el volumen molar inicial: ');
tol=input ('Ingrese la tolerancia: ');
n= input ('Ingrese el número de iteraciones: ');
i=1;
fprintf('\n')
disp ('-------------------------------------------')
disp (' TABLA DE VALORES')
disp ('-------------------------------------------')
disp ('i V.m Inicial V.m Final V.m. ')
while i<=n
q=f(p);
s=f(r);
c=q*s;
if(c<0)
while(abs(r-p)>tol)
h=(p+r)/2;
z=f(h);
18
if(q*z>0)
p=h;
elseif(q*z<0)
r=h;
else
disp ('la raiz aproximada de la funcion es')
end
i=i+1;
end
fprintf('\n')
fprintf ('El volumen molar aproximado es: %5.5f\n’, h);
break;
else
disp ('Los valores iniciales no son correctos')
end
end
BIOXIDO DE CARBONO
Primero graficaremos la función para obtener los valores del intervalo donde se encuentra el valor
del volumen aproximado.
f (x) = x^3 - 24.65887*x^2 + 3.592*x - 0.15
19
Luego podemos considerar como valor del volumen inicial 24 y como valor de volumen final 25, ya
que en el grafico se observa que la raíz está entre esos valores.
-----------------------
METODO DE LA BISECCION
-----------------------
Ingrese la funcion de Van der Waals f(x)=x^3-24.65887*x^2+3.592*x-0.15327
Ingrese el volumen molar inicial: 24
Ingrese el volumen molar inicial: 25
Ingrese la tolerancia: 0.001
Ingrese el número de iteraciones: 20
-------------------------------------------
TABLA DE VALORES
-------------------------------------------
i V.m Inicial V.m Final V.m.
1 24.00000 25.00000 24.50000
2 24.50000 25.00000 24.75000
3 24.50000 24.75000 24.62500
4 24.50000 24.62500 24.56250
5 24.50000 24.56250 24.53125
6 24.50000 24.53125 24.51563
7 24.50000 24.51563 24.50781
8 24.50781 24.51563 24.51172
9 24.51172 24.51563 24.51367
10 24.51172 24.51367 24.51270
OXIGENO
Igualmente graficaremos la función para obtener los valores del intervalo donde se encuentra el
valor del volumen aproximado.
f (x)=x^3 - 24.64803*x^2 + 1.360*x - 0.0432888
20
21
Luego podemos considerar como valor del volumen inicial 24 y como valor de volumen final 25, ya
que en el grafico se observa que la raíz está entre esos valores.
-----------------------
METODO DE LA BISECCION
-----------------------
Ingrese la funcion de Van der Waals f(x)=x^3-24.64803*x^2+1.360*x-0.0432888
Ingrese el volumen molar inicial: 24
Ingrese el volumen molar inicial: 25
Ingrese la tolerancia: 0.001
Ingrese el número de iteraciones: 20
-------------------------------------------
TABLA DE VALORES
-------------------------------------------
i V.m Inicial V.m Final V.m.
1 24.00000 25.00000 24.50000
2 24.50000 25.00000 24.75000
3 24.50000 24.75000 24.62500
4 24.50000 24.62500 24.56250
5 24.56250 24.62500 24.59375
6 24.56250 24.59375 24.57813
7 24.57813 24.59375 24.58594
8 24.58594 24.59375 24.58984
9 24.58984 24.59375 24.59180
10 24.59180 24.59375 24.59277
22