Sie sind auf Seite 1von 14

UNIVERSIDAD MAYOR DE SAN

ANDRES
FACULTAD DE INGENIERIA

2º PARCIAL

ESTUDIANTES:

NEISA ARACELI BUITRE VARGAS


PAOLA MARISOL ESPINAL CONDORI
MATERIA:

PROGRAMACION Y ANALISIS NUMERICO PRQ-


404
DOCENTE: ING. ROBERTO PARRA
Fecha de entrega: 2-12-2019
1. ENUNCIADO

PROBLEMA 8.2
8.2 En ingeniería química, los reactores de flujo tipo tapón (es decir, aquellos en que el fluido va de un extremo al otro con
una mezcla mínima a lo largo del eje longitudinal) se usan para convertir reactantes en productos. Se ha determinado que la
eficiencia de la conversión algunas veces se mejora recirculando
una porción de la corriente del producto, de tal forma que regrese a la entrada para un paso adicional a través del reactor
(figura P8.2). La razón de recirculando se define como

𝐯𝐨𝐥𝐮𝐦𝐞𝐧 𝐝𝐞 𝐟𝐥𝐮𝐢𝐝𝐨 𝐪𝐮𝐞 𝐫𝐞𝐠𝐫𝐞𝐬𝐚 𝐚 𝐥𝐚 𝐞𝐧𝐭𝐫𝐚𝐝𝐚


𝑹=
𝐯𝐨𝐥𝐮𝐦𝐞𝐧 𝐪𝐮𝐞 𝐬𝐚𝐥𝐞 𝐝𝐞𝐥 𝐬𝐢𝐬𝐭𝐞𝐦𝐚

Suponga que se está procesando una sustancia química A para generar un producto B. Para el caso en que A forma a B de
acuerdo con una reacción auto catalítica (es decir, en la cual uno de los productos actúa como catalizador o estimulante en la
reacción), es posible demostrar que una razón óptima de recirculación debe satisfacer

𝟏 + 𝑹(𝟏 − 𝑿𝑨𝒇 ) 𝑹+𝟏


𝒍𝒏 =
𝑹(𝟏 − 𝑿𝑨𝒇 ) 𝑹[𝟏 + 𝑹(𝟏 − 𝑿𝑨𝒇 )]

donde XAƒ es la fracción del reactante A qué se convierte en el producto B. La razón óptima de recirculación corresponde a
un reactor de tamaño mínimo necesario para alcanzar el nivel
deseado de conversión. Utilice un método numérico para determinar la razón de recirculación necesaria, de manera que se
minimice el tamaño del reactor para una conversión fraccional de XAƒ = 0.95

Figura P8.2
Representación esquemática de un reactor de flujo tipo tapón con recirculación.

2. ALGORITMO

Newton Raphson

1.- Nos damos Ro, tol

2.- Hallamos f(Ro)

𝑽𝑹 𝟏+𝑹(𝟏−𝑿𝑨𝒇 ) 𝑹+𝟏
𝑹= ; 𝒍𝒏 =
𝑽𝑺 𝑹(𝟏−𝑿𝑨𝒇 ) 𝑹[𝟏+𝑹(𝟏−𝑿𝑨𝒇 )]

𝟏 + 𝑹(𝟏 − 𝑿𝑨𝒇 ) 𝑹+𝟏


𝒇𝑹 = 𝒍𝒏 −
𝑹(𝟏 − 𝑿𝑨𝒇 ) 𝑹[𝟏 + 𝑹(𝟏 − 𝑿𝑨𝒇 )]

3.- Derivamos la ecuación y hallamos f ’(Ro)


𝒇(𝑹𝒐 +𝒉) − 𝒇(𝑹𝒐 −𝒉)
𝒇 ′𝑹𝒐 =
𝟐∗𝒉
𝒇(𝑹 )
4.- Hallamos 𝑹𝟏 = 𝑹𝒐 − 𝒇 ′ 𝒐
𝑹𝒐

5.- 𝑬𝒓𝒓𝒐𝒓 = |𝑹𝟏 − 𝑹𝒐 |


6.- Si Error > tol

𝑹𝟏 = 𝑹𝒐 Volvemos al paso 2

7.- Si Error < tol

R1 es solución

3. DIAGRAMA DE FLUJO

INICIO

XAƒ , Ro

fR=ln (1+R(1-XAf))/(R(1-XAf))-(R+1)/R[1+R(1-XAf)]

Error=20
h=0,00001
tol=0,001

NO
Error > tol R1 FIN

SI

fR=fr(Ro)
d fR = (fr(Ro+h) - fr(Ro-h))/(2*h)
R1=RO – fR/dfR
Error= R1-Ro
R1=RO

4. CODIFICACION EN MATLAB
PROGRAMA razon.m
clc,clear
global Xaf
%usando newton
Xaf=0.96
h=0.00001
tol=0.001
error=20
i=1
Ro=0.5
while error>tol
fr=razon(Ro);
dfr=(razon(Ro+h)-razon(Ro-h))/(2*h);
R1=Ro-fr/dfr;
error=abs(R1-Ro);
fprintf('i=%g Ro=%g fr=%g dfr=%g R1=%g error=%g \n',i, Ro, fr, dfr, R1, error)
Ro=R1;
i=i+1;
end
R1

PROGRAMA metodo1.m
clc,clear
global Xaf
%usando newton
Xaf=0.96
h=0.00001
tol=0.001
error=20
i=1
Ro=0.5
while error>tol
fr=razon(Ro);
dfr=(razon(Ro+h)-razon(Ro-h))/(2*h);
R1=Ro-fr/dfr;
error=abs(R1-Ro);
fprintf('i=%g Ro=%g fr=%g dfr=%g R1=%g error=%g \n',i, Ro, fr, dfr, R1, error)
Ro=R1;
i=i+1;
end
R1
PROGRAMA FOR_NEWTON.M (GUIDE)
function varargout = FOR_NEWTON(varargin)
% FOR_NEWTON MATLAB code for FOR_NEWTON.fig
% FOR_NEWTON, by itself, creates a new FOR_NEWTON or raises the existing
% singleton*.
%
% H = FOR_NEWTON returns the handle to a new FOR_NEWTON or the handle to
% the existing singleton*.
%
% FOR_NEWTON('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in FOR_NEWTON.M with the given input arguments.
%
% FOR_NEWTON('Property','Value',...) creates a new FOR_NEWTON or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before FOR_NEWTON_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to FOR_NEWTON_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help FOR_NEWTON

% Last Modified by GUIDE v2.5 27-Nov-2019 09:40:24

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @FOR_NEWTON_OpeningFcn, ...
'gui_OutputFcn', @FOR_NEWTON_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT

% --- Executes just before FOR_NEWTON is made visible.


function FOR_NEWTON_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to FOR_NEWTON (see VARARGIN)

% Choose default command line output for FOR_NEWTON


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

% UIWAIT makes FOR_NEWTON wait for user response (see UIRESUME)


% uiwait(handles.figure1);

[y,Fs] = audioread('back.mp3');
sound(y,Fs);
axes(handles.axes2)
a=imread('back.jpg');
image(a);
axis off

axes(handles.axes3)
b=imread('figura.jpg');
image(b);
axis off

% --- Outputs from this function are returned to the command line.
function varargout = FOR_NEWTON_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

function edit1_Callback(hObject, eventdata, handles)


% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text


% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function edit2_Callback(hObject, eventdata, handles)


% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit2 as text


% str2double(get(hObject,'String')) returns contents of edit2 as a double

% --- Executes during object creation, after setting all properties.


function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function edit3_Callback(hObject, eventdata, handles)


% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit3 as text


% str2double(get(hObject,'String')) returns contents of edit3 as a double

% --- Executes during object creation, after setting all properties.


function edit3_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function edit4_Callback(hObject, eventdata, handles)


% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit4 as text


% str2double(get(hObject,'String')) returns contents of edit4 as a double

% --- Executes during object creation, after setting all properties.


function edit4_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.


% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in pushbutton1.


function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)

global Xaf
%usando newton
Xaf=str2double(get(handles.edit1,'String'))
h=0.00001;
tol=str2double(get(handles.edit3,'String'))
error=20;
i=1;
Ro=str2double(get(handles.edit2,'String'))
if Ro<=0 || Ro>0.5
msgbox('EL valor dado es inapropiado debido a la naturaleza de la función')
return
end
while error>tol
numit(i)=i;
Rov(i)=Ro;
fr=razon(Ro);
frv(i)=fr;
dfr=(razon(Ro+h)-razon(Ro-h))/(2*h);
dfrv(i)=dfr;
R1=Ro-fr/dfr;
R1v(i)=R1;
error=abs(R1-Ro);
errorv(i)=error;
Ro=R1;
i=i+1;
end
iteraciones=[numit' Rov' frv' dfrv' R1v' errorv'];
set(handles.uitable1,'Data',iteraciones)
set(handles.edit4,'String',num2str(R1))

%para la grafica
syms R
xg=[0.51 0.6 0.7 0.8 0.9 0.96]
n=length(xg);
Xbf=1-xg;
for i=1:n
rg(i)=vpasolve(log((1+R.*Xbf(i))./(R.*Xbf(i)))-(R+1)./(R.*(1+R.*Xbf(i)))==0,R);
end
axes(handles.axes1)
plot(xg,rg,'o-')
title('Razon vs Xaf')
xlabel('Concentración, Xaf')
ylabel('Razon, R')
grid on
5. RESULTADOS DE LA EJECUCION

Con los datos que se da en el problema

XAf=0.95

El valor de R será 0.28194

6. ANALISIS FISICO QUIMICO

Un reactor con recirculación es un dispositivo que permite aproximarnos al comportamiento de flujo en


mezcla completa, empleando un reactor de flujo en piston

Das könnte Ihnen auch gefallen