Está en la página 1de 7

Ingeniería Computacional- Proyecto #4

Maria Camila Bravo Bohada (2180532)

En un destilador flash entra un alimento con una fracción molar de Benceno 𝑧𝐵 = 0.5 y
Tolueno 𝑧𝑡 = 0.5. La mezcla binaria es sometida a una destilación flash operando a una
presión de 2.5 atm. Usemos Chao-seader como ecuación de estado.

En Matlab:
a. Haga un programa que calcule la fracción molar en la corriente de salida de gas, la
𝑉
fracción molar en la corriente de salida del líquido, la fracción de vaporización 𝑓 = a
𝐹
cinco temperaturas diferentes. Realice un GUI que permita interacción con el usuario
para obtener los datos calculados.
A partir de las gráficas anteriores es posible visualizar que la temperatura de rocío es de
401.93 K y la temperatura de burbuja es 408.009 K

Diagrama de proceso

Código
function varargout = TALLER4INTENTO2(varargin)
% TALLER4INTENTO2 MATLAB code for TALLER4INTENTO2.fig
% TALLER4INTENTO2, by itself, creates a new TALLER4INTENTO2 or raises the existing
% singleton*.
%
% H = TALLER4INTENTO2 returns the handle to a new TALLER4INTENTO2 or the handle to
% the existing singleton*.
%
% TALLER4INTENTO2('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in TALLER4INTENTO2.M with the given input arguments.
%
% TALLER4INTENTO2('Property','Value',...) creates a new TALLER4INTENTO2 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before TALLER4INTENTO2_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to TALLER4INTENTO2_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 TALLER4INTENTO2

% Last Modified by GUIDE v2.5 13-Sep-2021 09:42:12

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @TALLER4INTENTO2_OpeningFcn, ...
'gui_OutputFcn', @TALLER4INTENTO2_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 TALLER4INTENTO2 is made visible.


function TALLER4INTENTO2_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 TALLER4INTENTO2 (see VARARGIN)

% Choose default command line output for TALLER4INTENTO2


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = TALLER4INTENTO2_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;

% --- Executes on slider movement.


function slider1_Callback(hObject, eventdata, handles)
% hObject handle to slider1 (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,'Value') returns position of slider


% get(hObject,'Min') and get(hObject,'Max') to determine range ofslider
l=get(handles.slider1,'Value')
T=6.079*l+128.78
zb=0.5;zt=0.5;P=2.5;F=1;
At=6.9509;Bt=1342.31;Ct=219.1870;Ab=6.8799;Bb=1196.76;Cb=219.1610;
%Presión en milimetros de mercurio y temperatura en C
Psatt=10^(At-Bt/(Ct+T))/760;
Psatb=10^(Ab-Bb/(Cb+T))/760;
xt=(P-Psatb)/(Psatt-Psatb);
xb=1-xt;
yt=Psatt/P*xt;
kt=Psatt/P;kb=Psatb/P;
yb=1-yt;
f=(xb-zb)/(xb-yb);
set(handles.edit1,'String',T)
set(handles.edit2,'String',f)
set(handles.edit3,'String',xb)
set(handles.edit4,'String',xt)
set(handles.edit5,'String',yt)
set(handles.edit6,'String',yb)

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


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

% Hint: slider controls usually have a light gray background.


if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
end

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

function edit5_Callback(hObject, eventdata, handles)


% hObject handle to edit5 (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 edit5 as text


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

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


function edit5_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit5 (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 edit6_Callback(hObject, eventdata, handles)


% hObject handle to edit6 (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 edit6 as text


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

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


function edit6_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit6 (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
Interfaz gráfica

Figure 1. Interfaz gráfica

Figure 2. Interfaz gráfica funcional

En este caso, se movió el slider para obtener valores de composiciones y f para la temperatura
mostrada en la interfaz. De esta manera, se tomaron diferentes temperaturas entre la temperatura
de burbuja y la temperatura de rocío y se obtuvo
i Temperatura [°C] xB xT yB yT f
1 128,78 0,435331 0,564669 0,631564 0,368436 0,329551
2 129,15 0,424511 0,575489 0,620996 0,379004 0,384198
3 130,21 0,39346 0,60654 0,589607 0,410393 0,543162
4 131,03 0,370012 0,629988 0,564814 0,435186 0,667284
5 132,12 0,33941 0,66059 0,530957 0,469043 0,838385
6 132,91 0,317766 0,682234 0,505928 0,494072 0,968493
7 134,859 0,266059 0,733941 0,442218 0,557782 1,328010

Figure 3. Tabla de resultados para MATLAB

A partir de los datos obtenidos es posible observar que el valor de F de la temperatura de rocío y
burbuja no corresponden a lo esperado, 0 y 1 respectivamente. Esto se puede explicar porque para
el modelo de programación se utilizó la ley de Raoult, el cuál es ideal. Del mismo modo, para
modelar el sistema se utilizó el método CHAO-SEA. Los datos muestran la tendencia de que, al
aumentar la temperatura, la composición de tolueno aumenta tanto en la fase líquida como
gaseosa, mientras que la composición del benceno disminuye. Esto significa que el tolueno está
cambiando de fase y por eso su fracción molar se ve afectada.

También podría gustarte