Você está na página 1de 58

RESERVORIOS

Propiedades de las Rocas y Los Fluidos.


1. INTRODUCCION
1.1.
YACIMIENTO
La ingeniera de yacimientos o reservorios es aquella ciencia fundamental, que
aplicando conocimientos cientficos, nos permita realizar una explotacin
racional del petrleo as como tambin su mxima recuperacin al menor costo
para garantizar un suministro adecuado y oportuno de sus productos. Sera a
partir de esto que se tendr un conocimiento profundo de los yacimientos con
los que estemos tratando, y de ah la planificacin adecuada del desarrollo de
estos campos y las tcnicas de recuperacin secundaria en la etapa posterior a
la vida del yacimiento se desarrollaran teniendo en cuenta sus caractersticas.
1.2.
MATLAB
MATLAB es una herramienta de software matemtico, que tiene por funcin
facilitar el clculo a distintas clases de problemas, especialmente matemticos.

este dispone de dos herramientas adicionales, Simulink y GUIDE (editor


de interfaces de usuario - GUI). Este ultimo crea una interfaz grafica que
ayudara al usuario a entender y visualizar de manera mas fcil y amigable el
lenguaje programado.
2. REALIZACION DEL PROGRAMA
La versin que se utilizo al hacer el programa fue la ltima versin de matlab. Que
contiene una serie de opciones de interfaz grafica, entre las cuales se encuentra la
opcin GUIDE. Esta opcin te permite crear en un espacio determinado un conjunto de
plantillas como muestra en la figura 1.1.

Figura 1.1
Se abrir una ventana dndote a conocer los elementos de los que podrs disponer
para hacer de la presentacin lo ms interactiva posible.

Como se puede ver dispondremos de Push Button, Slider, Radio Button, Edit text, static
text, Table, Axes, Panel, entre otros.
algo a tomar en cuenta al trabajar con archivos guide en matlab, es que primeramente
se debe de realizarla parte grafica de la plantilla, es decir introducir todas las opciones
que queremos usar, como static texts, push buttons y demas y que una vez ya
terminada esta se compilara el archivo creandose dos archivos, un archivo punto m y
otro punto fig, siendo el primero el codigo de las opciones creadas y el segundo la
parte grafica del archivo, es decir los botones, tablas o dems accesorios que haya
decidido usarse.
Los primero que se hizo fue crear las propiedades de rocas, y propiedades de los
fluidos. Las primeras propiedades que se realizaron fue la de los gases debido a la
complejidad que tena el clculo de z, y su importancia en las dems propiedades de
su clculo:
3. CALCULO DEL FACTOR DE CORRECION Z EJEMPLO
El primer obstculo con el que nos encontramos al hacer el clculo del factor fue el de
calcular el peso molecular (Ma) a partir de las fracciones molares que deban
introducirse y despus ser ledas por el programa. Al momento de escribir el codigo
hay que tomar en cuenta dos partes. La de leer el valor y posteriormente la de llamar
al valor introducido para ejecutarlo en una de las ecuaciones que se necesite.
2

En el guide se cre una tabla a partir de estatic y edit texts para leer las fracciones
respectivas de los compuestos que se establecieron a mano izquierda y a mano

derecha un push button con el nombre de resolver, de manera que al apretarlo el valor
del peso molecular se muestre en la ventana correspondiente.
los edit text son comandos en los cuales se escribe un texto que no cambiara a lo largo
de todo el programa, mientras que los edit text variaran dependiendo de que codigo se
haya propuesto.
Para leer los valores en los recuadros correspondientes una vez creadas las ventanas
se debe de hacer click derecho y en una de las ventanas e ir a la opcin viewcallbacks,
callback. Una vez hecho esto con uno de los edit text (para leer valor de la fraccin
molar ) el programa abrir el Archivo de manera directa y se dirigir a la funcin
callback donde se escribir el codigo que queremos que se realice en dicha ventana.

Fig. 1.3
En este caso por tratarse de un edit text, en el cual se deber de leer el valor de la
fraccin se realizaron los siguientes pasos:

Una vez en la funcin callback del primer static text que se lo llamo edit1 se coloco la
funcin get, la cual tiene como funcin el de pedir un objeto, en este caso un 'string' o
un caracter, ya que el dato ingresado puede tener una diversidad grande pudiendo
tratarse de un numero, letra o caracter. Posteriormente transforma el dato a un double,
es decir a un valor numrico y finalmente lo almacenara con el nombre de
handles.edit1 , siendo el handles el comando con el que almacenara todos los datos en
el programa, esta es una propiedad propia del codigo.
Ya para usar el valor dentro del texto en otra funcin lo que se hizo fue ir a la opcin la
cual llamara la funcin en este caso sera la opcin Push Button.

figura 1.4
En esta funcin se asigno el valor de C1 al handles.edit1 ya creado anteriormente, es
decir que el valor almacenado se guardara con el valor de C1. debido a la importancia
de esta variable y a que deber de llamarse en otras funciones sin tener que volver a
ingresar el valor nuevamente se introdujo el codigo global lo que har ser almacenar
ese valor en una variable global, que podr llamarse en cualquier funcin que se
desee.
A continuacin nos planteamos la idea de solucionar el hecho de que pasara si el
usuario decidiese ingresar una letra en lugar de un numero a continuacin se puede
ver el codigo usado:

lo que hace el codigo isnan es verificar si el valor es string o double. para que
despliegue el valor se uso el comando errordlg el cual desplegara un mensaje de error
con el codigo 'los valores deben ser numricos' y a continuacin el valor de C1 se
borrara asignndosele el valor de 0.
Otro de los problemas que prevenimos fue el de que pasaba en caso de que las sumas
de los valores de las fracciones molares sala ms de uno. como se sabe esto no
tendra sentido es por eso que similar al codigo de abra se cre otro. a continuacin se
muestra el codigo:

.
.
.

Fig 1.5
Ac se puede ver como primero se calculo la suma de todas las respectivas fracciones
para a continuacin con la ayuda de un ir poder ver si suma uno o no, en caso de no
hacerlo se desplegara el msgbox con el error de que la sumatoria debe de ser uno. A
continuacin los valores se guardaran con 0, para que el usuario deba corregir este
error antes de continuar.

Fig 1.6

Tambin hicimos el uso de los msgbox que son comandos que al apretar en dicha
funcin o en caso de necesitarlo se los llama y al momento despliegan alguna
informacin. Nosotros encontramos tiles estos cdigos que nos sirvi para poder
colocar el nombre de la variable y las unidades en las que se encontrara.
Tambin hubiese podido si es que se hubiese querido introducir teora o cualquier
mensaje que se desease despejar.
Posteriormente se hizo el clculo de la gravedad especifica que denominamos como
gY, uno de las dificultades con matlab es que no se puede introducir variables griegas
como , dems, por lo que tuvimos que recurrir a colocar nombres de variables
similares para que el usuario pudiese comprender de que variable se trata.

Fig 1.7
todos los clculos los colocamos en los callback de los botones ya que al apretar
dichos, recin se calcula lo valores y se despliega el resultado en el lugar que se
desee. para desplegar datos en una pantalla se usa el comando set a continuacin
entre parntesis se especifica qu tipo de variable ser, el lugar donde se lo colocara
con el comando handles, y el valor que se desplegara en ese lugar.
a partir del comando uicontrol, nosotros pudimos crear botones que podan ser
manejados a partir de un archivo.m en lugar de un archivo.fig, lo cual fue una ventaja.
En estos podan definirse propiedades como colores, tipo letra,backgroundcolor o color
de fondo y position o posicin en la que se lo dispondr en la ventana.
Ac se vio como colocamos dos botones, el de continuar y el de atrs que se
desplegara solo al apretar el botn resolver. es en estos botones que se puede
especificar el lugar o el archivo.m que se abrir a continuacin. como se puede ver en
el ejemplo la posicin seria la matriz, mientras que el archivo que se abrir a
continuacin ser el guardado con el nombre de factorZ1 :

Fig 1.8

* uno de los inconvenientes con el programa es que para que los valores globales
puedan abrirse los archivos m deben encontrarse en la misma carpeta, este es un
inconveniente ya que al reunirlo todo cada plantilla contara con un archivo m y uno fig
lo cual har que la carpeta a crearse tenga demasiado subprogramas dentro de ella.
8

cada plantilla cuenta con un botn que se denomina clear, que lo que har ser borrar
los resultados obtenidos para despus uno volver a insertar valores para obtener una
nueva respuesta. Se muestra el codigo usado para borrar:

Fig 1.9
Como se puede ver del ejemplo lo que se hizo es darle a una variable de nombre ini,
un archivo tipo char con espacios y luego copiar dicha variable en los espacio que
deseemos borrar, por lo tanto dichos lugares con valores van a ser sustituidos por los
espacios vacios.
a continuacin si apretamos continuar este botn t llevara directamente a el siguiente
archivo.m

Fig 1.10

en esta ventana se harn los clculos de la Presin pseudocritica, temperatura


pseudocritica ya sea para un gas natural o un gas condensado, esto lo decidir ya el
programa dependiendo de la fraccin molar de C1 que se encuentre en los datos
ingresados. a continuacin se ve el conjunto de if's que se utilizo para que el programa
pudiese determinar esto:

Fig 1.11

Fig 1.12

10

Una vez superado este paso deba de corregirse la ecuacin dependiendo de las
fracciones molares del H2S, CO2 y N2 con la ecuacin de correccin de Karr, kobayashi
y Burrows.
De esta manera no hay que ver si
hacer o no la correccin ya que el
programa te lo calculara todo
automticamente a partir de los
datos introducidos de las respectivas
fracciones molares. A continuacin se
abrir la siguiente plantilla en la que
ya iremos al clculo de z.

Fig 1.13

para el clculo de z se realizo una


iteracin con un while que se
mostrara a continuacin.

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

11

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


% Last Modified by GUIDE v2.5 08-Apr-2013 17:43:09
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @factorZ_OpeningFcn, ...
'gui_OutputFcn', @factorZ_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 factorZ is made visible.


function factorZ_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 factorZ (see VARARGIN)

% Choose default command line output for factorZ


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes factorZ wait for user response (see UIRESUME)
% uiwait(handles.figure1);

% --- Outputs from this function are returned to the command line.
function varargout = factorZ_OutputFcn(hObject, eventdata, handles)
%
%
%
%

varargout
hObject
eventdata
handles

cell array for returning output args (see VARARGOUT);


handle to figure
reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure


varargout{1} = handles.output;

12

function edit1_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit1=NewVal; %Almacenar en identificador
guidata(hObject,handles); %Salvar datos de la aplicacin
% 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)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit2=NewVal; %Almacenar en identificador
guidata(hObject,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 edit2_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

13

function edit3_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit3=NewVal; %Almacenar en identificador
guidata(hObject,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)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit4=NewVal; %Almacenar en identificador
guidata(hObject,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)


Val=get(hObject,'String'); %Almacenar valor ingresado

14

NewVal = str2double(Val); %Transformar a formato double


handles.edit5=NewVal; %Almacenar en identificador
guidata(hObject,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)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit6=NewVal; %Almacenar en identificador
guidata(hObject,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

function edit7_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit7=NewVal; %Almacenar en identificador

15

guidata(hObject,handles);
% hObject
handle to edit7 (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 edit7 as text
%
str2double(get(hObject,'String')) returns contents of edit7 as a double

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


function edit7_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit7 (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 edit8_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit8=NewVal; %Almacenar en identificador
guidata(hObject,handles);
% hObject
handle to edit8 (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 edit8 as text
%
str2double(get(hObject,'String')) returns contents of edit8 as a double

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


function edit8_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit8 (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 edit9_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit9=NewVal; %Almacenar en identificador
guidata(hObject,handles);
% hObject
handle to edit9 (see GCBO)

16

% eventdata
% handles

reserved - to be defined in a future version of MATLAB


structure with handles and user data (see GUIDATA)

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


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

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


function edit9_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit9 (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 edit10_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit10=NewVal; %Almacenar en identificador
guidata(hObject,handles);
% hObject
handle to edit10 (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 edit10 as text
%
str2double(get(hObject,'String')) returns contents of edit10 as a
double

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


function edit10_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit10 (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 edit11_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit11=NewVal; %Almacenar en identificador
guidata(hObject,handles);
% hObject
handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

17

% 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 edit11_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 edit12_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit12=NewVal; %Almacenar en identificador
guidata(hObject,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 edit12_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 edit13_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit13=NewVal; %Almacenar en identificador
guidata(hObject,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)

18

% 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 edit13_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 edit14_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit14=NewVal; %Almacenar en identificador
guidata(hObject,handles); %Salvar datos de la aplicacin

% hObject
% eventdata
% handles

handle to edit5 (see GCBO)


reserved - to be defined in a future version of MATLAB
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 edit14_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 edit15_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit15=NewVal;
handles.edit15=handles.edit14;
%Almacenar en identificador
guidata(hObject,handles); %Salvar datos de la aplicacin

19

% hObject
% eventdata
% handles

handle to edit7 (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

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


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

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


function edit15_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit7 (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 edit16_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 edit16_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

function edit17_Callback(hObject, eventdata, handles)


% hObject
handle to edit13 (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 edit13 as text
%
str2double(get(hObject,'String')) returns contents of edit13 as a
double

20

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


function edit17_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit13 (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 edit18_Callback(hObject, eventdata, handles)


% hObject
handle to edit12 (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 edit12 as text
%
str2double(get(hObject,'String')) returns contents of edit12 as a
double

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


function edit18_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit12 (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 edit19_Callback(hObject, eventdata, handles)


% hObject
handle to edit11 (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 edit11 as text
%
str2double(get(hObject,'String')) returns contents of edit11 as a
double

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


function edit19_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit11 (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.

21

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

function edit20_Callback(hObject, eventdata, handles)


% hObject
handle to edit10 (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 edit10 as text
%
str2double(get(hObject,'String')) returns contents of edit10 as a
double

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


function edit20_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit10 (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 edit21_Callback(hObject, eventdata, handles)


% hObject
handle to edit9 (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 edit9 as text
%
str2double(get(hObject,'String')) returns contents of edit9 as a double

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


function edit21_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit9 (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

22

function edit22_Callback(hObject, eventdata, handles)


% hObject
handle to edit8 (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 edit8 as text
%
str2double(get(hObject,'String')) returns contents of edit8 as a double

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


function edit22_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit8 (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)
global C1
global CO2
global N2
global H2S
C1=handles.edit1;
C2=handles.edit2;
C3=handles.edit3;
C4=handles.edit4;
C5=handles.edit5;
C6=handles.edit6;
C7=handles.edit7;
C8=handles.edit8;
C9=handles.edit9;
H2O=handles.edit10;
CO2=handles.edit11;
N2=handles.edit12;
H2S=handles.edit13;
save C1
save CO2
save N2
save H2S
if isnan(C1)|isnan(C2)|isnan(C3)|isnan(C4)|isnan(C5)|isnan(C6)|isnan(C7)|
isnan(C8)|isnan(C9)|isnan(H2O)|isnan(CO2)|isnan(N2)|isnan(H2S)
errordlg('Los valores deben ser numrico','ERROR');
%set(handles.edit1,'String','0');
C1=0;
%set(handles.edit2,'String',0);
C2=0;
%set(handles.edit3,'String',0);
C3=0;
%set(handles.edit4,'String',0);
C4=0;

23

%set(handles.edit5,'String',0);
C5=0;
%set(handles.edit6,'String',0);
C6=0;
%set(handles.edit7,'String',0);
C7=0;
%set(handles.edit8,'String',0);
C8=0;
%set(handles.edit9,'String',0);
C9=0;
%set(handles.edit10,'String',0);
H2O=0;
%set(handles.edit11,'String',0);
CO2=0;
%set(handles.edit12,'String',0);
N2=0;
%set(handles.edit13,'String',0);
H2S=0;
errordlg('Los valores deben ser numrico','ERROR');
end
S=C1+C2+C3+C4+C5+C6+C7+C8+C9+(H2O)+(CO2)+(N2)+(H2S);
if (S~=1.00)
C1=0;
%set(handles.edit2,'String',0);
C2=0;
%set(handles.edit3,'String',0);
C3=0;
%set(handles.edit4,'String',0);
C4=0;
%set(handles.edit5,'String',0);
C5=0;
%set(handles.edit6,'String',0);
C6=0;
%set(handles.edit7,'String',0);
C7=0;
%set(handles.edit8,'String',0);
C8=0;
%set(handles.edit9,'String',0);
C9=0;
%set(handles.edit10,'String',0);
H2O=0;
%set(handles.edit11,'String',0);
CO2=0;
%set(handles.edit12,'String',0);
N2=0;
%set(handles.edit13,'String',0);
H2S=0;
errordlg('Los valores deben sumar 1','ERROR');
%COMO HAGO PARA CAMBIAR VALORES
end
global M
M=(C1)*(16.043)+(C2)*(30.07)+(C3)*(44.097)+(C4)*(58.123)+(C5)*(72.151)+
(C6)*(86.178)+(C7)*(100.205)+(C8)*(114.232)+(C9)*(128.259)+(H2O)*(18.015)+
(CO2)*(44.01)+(N2)*(28.013)+(H2S)*(34.076);
set(handles.edit14,'String',M);
set(handles.edit15,'String',M);
% hObject
% eventdata

handle to pushbutton1 (see GCBO)


reserved - to be defined in a future version of MATLAB

24

% handles

structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
msgbox('Peso molecular = lb/l-mol');
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

function edit24_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 edit24_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

% --- Executes on button press in pushbutton3.


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

% --- Executes on button press in pushbutton4.


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

function edit25_Callback(hObject, eventdata, handles)


% hObject
handle to edit7 (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 edit7 as text
%
str2double(get(hObject,'String')) returns contents of edit7 as a double

25

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


function edit25_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit7 (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 pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
global M
global gY
gY=M/28.97;
save gY
set(handles.edit16,'String',gY);
uicontrol('Style','pushbutton','Units','normalized','Position',[.75 .06 .2 .07],
...
'String','CONTINUAR','Callback','close all;clc; factorZ1');
uicontrol('Style','pushbutton','Units','normalized','Position',[.75 .15 .2 .07],
...
'String','ATRAS','Callback','close all;clc; menupropiedadesgas');
% hObject
handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

function edit26_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 edit26_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

26

% --- Executes on button press in pushbutton6.


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

function edit27_Callback(hObject, eventdata, handles)


% hObject
handle to edit27 (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 edit27 as text
%
str2double(get(hObject,'String')) returns contents of edit27 as a
double

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


function edit27_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit27 (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 pushbutton7.


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

% --- Executes on button press in pushbutton8.


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

function edit28_Callback(hObject, eventdata, handles)


% hObject
handle to edit28 (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 edit28 as text
%
str2double(get(hObject,'String')) returns contents of edit28 as a
double

27

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


function edit28_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit28 (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 pushbutton9.


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

function edit29_Callback(hObject, eventdata, handles)


% hObject
handle to edit29 (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 edit29 as text
%
str2double(get(hObject,'String')) returns contents of edit29 as a
double

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


function edit29_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit29 (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 pushbutton10.


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

% --- Executes on button press in pushbutton11.


function pushbutton11_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton11 (see GCBO)

28

% eventdata
% handles

reserved - to be defined in a future version of MATLAB


structure with handles and user data (see GUIDATA)

function edit30_Callback(hObject, eventdata, handles)


% hObject
handle to edit30 (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 edit30 as text
%
str2double(get(hObject,'String')) returns contents of edit30 as a
double

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


function edit30_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit30 (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 pushbutton12.


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

function edit31_Callback(hObject, eventdata, handles)


% hObject
handle to edit31 (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 edit31 as text
%
str2double(get(hObject,'String')) returns contents of edit31 as a
double

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


function edit31_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit31 (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'))

29

end

set(hObject,'BackgroundColor','white');

% --- Executes on button press in pushbutton13.


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

% --- Executes on button press in pushbutton14.


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

function edit32_Callback(hObject, eventdata, handles)


% hObject
handle to edit32 (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 edit32 as text
%
str2double(get(hObject,'String')) returns contents of edit32 as a
double

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


function edit32_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit32 (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 pushbutton15.


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

function edit33_Callback(hObject, eventdata, handles)


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

30

%
double

str2double(get(hObject,'String')) returns contents of edit33 as a

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


function edit33_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit33 (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 pushbutton16.


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

% --- Executes on button press in pushbutton17.


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

function edit34_Callback(hObject, eventdata, handles)


% hObject
handle to edit34 (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 edit34 as text
%
str2double(get(hObject,'String')) returns contents of edit34 as a
double

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


function edit34_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit34 (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

31

% --- Executes on button press in pushbutton18.


function pushbutton18_Callback(hObject, eventdata, handles)
ini=char('
');
set(handles.edit16,'String',ini);
set(handles.edit15,'String',ini);
set(handles.edit14,'String',ini);

% hObject
handle to pushbutton18 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)
function varargout = factorZ1(varargin)
% FACTORZ1 M-file for factorZ1.fig
%
FACTORZ1, by itself, creates a new FACTORZ1 or raises the existing
%
singleton*.
%
%
H = FACTORZ1 returns the handle to a new FACTORZ1 or the handle to
%
the existing singleton*.
%
%
FACTORZ1('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in FACTORZ1.M with the given input arguments.
%
%
FACTORZ1('Property','Value',...) creates a new FACTORZ1 or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before factorZ1_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to factorZ1_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 factorZ1
% Last Modified by GUIDE v2.5 10-Apr-2013 13:27:29
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @factorZ1_OpeningFcn, ...
'gui_OutputFcn', @factorZ1_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 factorZ1 is made visible.

32

function factorZ1_OpeningFcn(hObject, eventdata, handles, varargin)


global gY
global CO2
global H2S
global N2
set(handles.edit1,'String',gY);
set(handles.edit3,'String',gY);
set(handles.edit5,'String',gY);
set(handles.edit7,'String',gY);
set(handles.edit10,'String',CO2);
set(handles.edit11,'String',H2S);
set(handles.edit12,'String',N2);
set(handles.edit16,'String',CO2);
set(handles.edit17,'String',H2S);
set(handles.edit18,'String',N2);

uicontrol('Style','pushbutton','Units','normalized','Position',[.846 .25 .078 .


07], ...
'String','ATRAS','backgroundColor',[1 1 0.5],'Callback','close
all;clc;factorZ2');
uicontrol('Style','pushbutton','Units','normalized','Position',[.846 .12 .078 .
07], ...
'String','CONTINUAR','backgroundColor',[1 0.7 0.1],'Callback','close
all;clc;factorZ2');
%if handles.edit1~=handles.edit3
%
errordlg('Los valores deben sumar 1','ERROR');
% end
%
%
%
%
%

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 factorZ1 (see VARARGIN)

% Choose default command line output for factorZ1


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes factorZ1 wait for user response (see UIRESUME)
% uiwait(handles.figure1);

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

33

% --- Executes on button press in pushbutton7.


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

function edit5_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit5=NewVal; %Almacenar en identificador
%guidata(hObject,handles); %Salvar datos de la aplicacin
% hObject
% eventdata
% handles

handle to edit5 (see GCBO)


reserved - to be defined in a future version of MATLAB
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

% --- Executes on button press in pushbutton8.


function pushbutton8_Callback(hObject, eventdata, handles)
global C1
global gY
global Pscgc
F=C1*1;
if (F>=0.8)
Pscgc=0;
else
Pscgc=706-51.7+15*(gY)-11.1*(gY)^2;
save Pscgc
end
set(handles.edit6,'String',Pscgc);
% hObject
handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton9.


function pushbutton9_Callback(hObject, eventdata, handles)
% hObject
handle to pushbutton9 (see GCBO)

34

% eventdata
% handles

reserved - to be defined in a future version of MATLAB


structure with handles and user data (see GUIDATA)

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

% --- Executes on button press in pushbutton10.


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

function edit7_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit7=NewVal; %Almacenar en identificador
%guidata(hObject,handles); %Salvar datos de la aplicacin
% hObject
handle to edit7 (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 edit7 as text
%
str2double(get(hObject,'String')) returns contents of edit7 as a double

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


function edit7_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit7 (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.

35

if ispc && isequal(get(hObject,'BackgroundColor'),


get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

% --- Executes on button press in pushbutton11.


function pushbutton11_Callback(hObject, eventdata, handles)
global C1
H=C1*1;
%gY=handles.edit5;
global gY
global Tscgc
if (H>=0.8)
Tscgc=0;
else
Tscgc=187+330*(gY)-71.5*(gY)^2;
save Tscgc
end
set(handles.edit8,'String',Tscgc);
% hObject
handle to pushbutton11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton12.


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

function edit8_Callback(hObject, eventdata, handles)


% hObject
handle to edit8 (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 edit8 as text
%
str2double(get(hObject,'String')) returns contents of edit8 as a double

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


function edit8_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit8 (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

36

% --- 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)

function edit1_Callback(hObject, eventdata, handles)


%global gY
%set(handles.edit1,'String',gY);
%set(handles.edit3,'String',gY);
%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit1=NewVal; %Almacenar en identificador
%guidata(hObject,handles); %Salvar datos de la aplicacin
% 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

% --- Executes on button press in pushbutton2.


function pushbutton2_Callback(hObject, eventdata, handles)
global C1
global CO2
global N2
global H2S
global gY
global Pscgn
set(handles.edit21,'string',C1);
set(handles.edit22,'string',CO2);
set(handles.edit23,'string',N2);
set(handles.edit24,'string',H2S);
%load gY
%O=gY*1;
%set(handles.edit21,'string',gY);
F=C1*1;
if (F<0.8)
Pscgn=0;
else

37

Pscgn=677+15*(gY)-37.5*(gY)^2;
end
save Pscgn
set(handles.edit2,'String',Pscgn);
% hObject
handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton3.


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

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

% --- Executes on button press in pushbutton4.


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

function edit3_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit3=NewVal; %Almacenar en identificador
%guidata(hObject,handles); %Salvar datos de la aplicacin
% 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)

38

% 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

% --- Executes on button press in pushbutton5.


function pushbutton5_Callback(hObject, eventdata, handles)
%gY=handles.edit3;
global gY
global Tscgn
global C1
F=C1*1;
if(F<0.8)
Tscgn=0;
else
Tscgn=168+325*(gY)-12.5*(gY)^2;
end
save Tscgn
set(handles.edit4,'String',Tscgn);
% hObject
handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton6.


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

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)

39

% eventdata
% handles

reserved - to be defined in a future version of MATLAB


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 pushbutton13.


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

function edit9_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit9=NewVal; %Almacenar en identificador
%guidata(hObject,handles);
% hObject
handle to edit9 (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 edit9 as text
%
str2double(get(hObject,'String')) returns contents of edit9 as a double

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


function edit9_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit9 (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 pushbutton14.


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

function edit10_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double

40

%handles.edit10=NewVal; %Almacenar en identificador


%guidata(hObject,handles);
% hObject
handle to edit10 (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 edit10 as text
%
str2double(get(hObject,'String')) returns contents of edit10 as a
double

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


function edit10_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit10 (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 pushbutton16.


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

% --- Executes on button press in pushbutton17.


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

function edit11_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit11=NewVal; %Almacenar en identificador
%guidata(hObject,handles);
% hObject
handle to edit11 (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 edit11 as text
%
str2double(get(hObject,'String')) returns contents of edit11 as a
double

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


function edit11_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit11 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

41

% 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 edit12_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit12=NewVal; %Almacenar en identificador
%guidata(hObject,handles);
% hObject
handle to edit12 (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 edit12 as text
%
str2double(get(hObject,'String')) returns contents of edit12 as a
double

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


function edit12_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit12 (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 pushbutton18.


function pushbutton18_Callback(hObject, eventdata, handles)
global Tsc_c
global Tscgn
global Tscgc
global CO2
global N2
global H2S
A=CO2*1;
B=N2*1;
C=H2S*1;
if ((A==0)&(B==0)&(C==0))& Tscgn==0
set(handles.edit9,'String',Tscgc);
Tsc_2=0;
Tsc_c=Tscgc;
save Tsc_c
elseif ((A==0)&(B==0)&(C==0))& Tscgc==0
set(handles.edit9,'String',Tscgn);
Tsc_2=0;

42

Tsc_c=Tscgn;
save Tsc_c
elseif Tscgn==0 & ((A~=0)|(B~=0)|(C~=0))
set(handles.edit9,'String',Tscgc);
Tsc_2=(Tscgc)-80*(A)+130*(C)-250*(B);
Tsc_c=Tsc_2;
save Tsc_c
elseif Tscgc==0 & ((A~=0)|(B~=0)|(C~=0))
set(handles.edit9,'String',Tscgn);
Tsc_2=(Tscgn)-80*(A)+130*(C)-250*(B);
Tsc_c=Tsc_2;
save Tsc_c
end
%Tsc=handles.edit9;
%yCO2=handles.edit10;
%yH2S=handles.edit11;
%yN2=handles.edit12;
set(handles.edit14,'String',Tsc_c);
% hObject
% eventdata
% handles

handle to pushbutton18 (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton19.


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

function edit14_Callback(hObject, eventdata, handles)


% hObject
handle to edit14 (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 edit14 as text
%
str2double(get(hObject,'String')) returns contents of edit14 as a
double

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


function edit14_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit14 (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

43

% --- Executes on button press in pushbutton20.


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

% --- Executes on button press in pushbutton21.


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

% --- Executes on button press in pushbutton23.


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

% --- Executes on button press in pushbutton24.


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

function edit15_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit15=NewVal; %Almacenar en identificador
%guidata(hObject,handles);
% hObject
handle to edit15 (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 edit15 as text
%
str2double(get(hObject,'String')) returns contents of edit15 as a
double

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


function edit15_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit15 (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

44

function edit16_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit16=NewVal; %Almacenar en identificador
%guidata(hObject,handles);
% hObject
handle to edit16 (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 edit16 as text
%
str2double(get(hObject,'String')) returns contents of edit16 as a
double

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


function edit16_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit16 (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 edit17_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit17=NewVal; %Almacenar en identificador
%guidata(hObject,handles);
% hObject
handle to edit17 (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 edit17 as text
%
str2double(get(hObject,'String')) returns contents of edit17 as a
double

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


function edit17_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit17 (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

45

function edit18_Callback(hObject, eventdata, handles)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit18=NewVal; %Almacenar en identificador
%guidata(hObject,handles);
% hObject
handle to edit18 (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 edit18 as text
%
str2double(get(hObject,'String')) returns contents of edit18 as a
double

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


function edit18_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit18 (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 pushbutton25.


function pushbutton25_Callback(hObject, eventdata, handles)
global Psc_c
global Pscgn
global Pscgc
global CO2
global N2
global H2S
%Psc=handles.edit15;
%yCO2=handles.edit16;
%yH2S=handles.edit17;
%yN2=handles.edit18;
A=CO2*1;
B=N2*1;
C=H2S*1;
if ((A==0)&(B==0)&(C==0))&(Pscgn==0)
set(handles.edit15,'String',Pscgc);
Psc_2=0;
Psc_c=Pscgc;
save Psc_c
elseif ((A==0)&(B==0)&(C==0))&(Pscgc==0)
set(handles.edit15,'String',Pscgn);
Psc_2=0;
Psc_c=Pscgn;
save Psc_c
elseif Pscgn==0 & ((A~=0)|(B~=0)|(C~=0))
set(handles.edit15,'String',Pscgc);
Psc_2=(Pscgc)+440*(A)+600*(C)-170*(B);
Psc_c=Psc_2;

46

save Psc_c
elseif Pscgc==0 & ((A~=0)|(B~=0)|(C~=0))
Psc_2=(Pscgn)+440*(A)+600*(C)-170*(B);
Psc_c=Psc_2;
save Psc_c
end
set(handles.edit19,'String',Psc_c);
% hObject
handle to pushbutton25 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton26.


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

function edit19_Callback(hObject, eventdata, handles)


% hObject
handle to edit19 (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 edit19 as text
%
str2double(get(hObject,'String')) returns contents of edit19 as a
double

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


function edit19_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit19 (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 pushbutton27.


function pushbutton27_Callback(hObject, eventdata, handles)
ini=char(' ');
set(handles.edit19,'String',ini);
set(handles.edit14,'String',ini);
set(handles.edit2,'String',ini);
set(handles.edit4,'String',ini);
set(handles.edit6,'String',ini);
set(handles.edit8,'String',ini);
% hObject
handle to pushbutton27 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

47

function edit20_Callback(hObject, eventdata, handles)


% hObject
% eventdata
% handles

handle to edit20 (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

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


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

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


function edit20_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit20 (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 edit21_Callback(hObject, eventdata, handles)


% hObject
% eventdata
% handles

handle to edit21 (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

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


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

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


function edit21_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit21 (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 edit22_Callback(hObject, eventdata, handles)


% hObject
handle to edit22 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB

48

% handles

structure with handles and user data (see GUIDATA)

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


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

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


function edit22_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit22 (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 edit23_Callback(hObject, eventdata, handles)


% hObject
handle to edit23 (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 edit23 as text
%
str2double(get(hObject,'String')) returns contents of edit23 as a
double

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


function edit23_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit23 (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 edit24_Callback(hObject, eventdata, handles)


% hObject
handle to edit24 (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 edit24 as text
%
str2double(get(hObject,'String')) returns contents of edit24 as a
double

49

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


function edit24_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit24 (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 varargout = factorZ2(varargin)
% FACTORZ2 M-file for factorZ2.fig
%
FACTORZ2, by itself, creates a new FACTORZ2 or raises the existing
%
singleton*.
%
%
H = FACTORZ2 returns the handle to a new FACTORZ2 or the handle to
%
the existing singleton*.
%
%
FACTORZ2('CALLBACK',hObject,eventData,handles,...) calls the local
%
function named CALLBACK in FACTORZ2.M with the given input arguments.
%
%
FACTORZ2('Property','Value',...) creates a new FACTORZ2 or raises the
%
existing singleton*. Starting from the left, property value pairs are
%
applied to the GUI before factorZ2_OpeningFcn gets called. An
%
unrecognized property name or invalid value makes property application
%
stop. All inputs are passed to factorZ2_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 factorZ2
% Last Modified by GUIDE v2.5 10-Apr-2013 20:21:44
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',
mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @factorZ2_OpeningFcn, ...
'gui_OutputFcn', @factorZ2_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

50

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


function factorZ2_OpeningFcn(hObject, eventdata, handles, varargin)
H=imread('vaticano.jpg');
image(H);
axis off
global Psc_c
global Tsc_c
set(handles.edit2,'String',Psc_c);
set(handles.edit5,'String',Tsc_c);
uicontrol('Style','pushbutton','Units','normalized','Position',[.92 .15 .078 .
07], ...
'String','ATRAS','backgroundColor',[1 1 0.5],'Callback','close
all;clc;factorZ1');
uicontrol('Style','pushbutton','Units','normalized','Position',[.92 .02 .078 .
07], ...
'String','MENU','backgroundColor',[1 0.7 0.1],'Callback','close
all;clc;menupropiedadesgas');
%
%
%
%
%

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 factorZ2 (see VARARGIN)

% Choose default command line output for factorZ2


handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes factorZ2 wait for user response (see UIRESUME)
% uiwait(handles.figure1);

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

% --- Executes on button press in pushbutton2.


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

51

% --- Executes on button press in pushbutton3.


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

function edit1_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit1=NewVal; %Almacenar en identificador
guidata(hObject,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)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit2=NewVal; %Almacenar en identificador
%guidata(hObject,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

52

% 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

% --- Executes on button press in pushbutton4.


function pushbutton4_Callback(hObject, eventdata, handles)
global Psr
global Psc_c
P=handles.edit1;
Psr=(P)/(Psc_c);
set(handles.edit3,'String',Psr);
save Psr
% hObject
handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton5.


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

% --- Executes on button press in pushbutton6.


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

53

% --- Executes on button press in pushbutton7.


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

function edit4_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit4=NewVal; %Almacenar en identificador
guidata(hObject,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)


%Val=get(hObject,'String'); %Almacenar valor ingresado
%NewVal = str2double(Val); %Transformar a formato double
%handles.edit5=NewVal; %Almacenar en identificador
%guidata(hObject,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

54

% 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

% --- Executes on button press in pushbutton8.


function pushbutton8_Callback(hObject, eventdata, handles)
global Tsr
global Tsc_c
T=handles.edit4;
Tsr=(T)/(Tsc_c);
save Tsr
set(handles.edit6,'String',Tsr);
% hObject
handle to pushbutton8 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton18.


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

function edit13_Callback(hObject, eventdata, handles)


% hObject

handle to edit13 (see GCBO)

55

% eventdata
% handles

reserved - to be defined in a future version of MATLAB


structure with handles and user data (see GUIDATA)

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


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

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


function edit13_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit13 (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 pushbutton19.


function pushbutton19_Callback(hObject, eventdata, handles)
global Psr
global Tsr
global a
%calculos
z=1;
z1=0;
a=1;
b=5;
while(b~=a)
z=a;
Ar=(0.27*(Psr))/(z*Tsr);
CT1=0.3265+(-1.07/Tsr)+(-0.5339/((Tsr)^3))+(0.01569/((Tsr)^4))+(-0.05165/
((Tsr)^5));
CT2=0.5475+(-0.7361/Tsr)+(0.1844/((Tsr)^2));
CT3=0.1056*((-0.7361/Tsr)+(0.1844/(Tsr)^2));
CT4=0.6134*(1+0.721*((Ar)^2))*(((Ar)^2)/((Tsr)^3))*exp(-0.7210*((Ar)^2));
z1=1+CT1*Ar+CT2*((Ar)^2)-CT3*((Ar)^5)+CT4;
a=z1;
b=z;
c=z;
end
save a
set(handles.edit13,'string',a);
% hObject
handle to pushbutton19 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles
structure with handles and user data (see GUIDATA)

% --- Executes on button press in pushbutton20.


function pushbutton20_Callback(hObject, eventdata, handles)
ini=char(' ');
set(handles.edit3,'String',ini);
set(handles.edit6,'String',ini);
set(handles.edit13,'String',ini);

56

% hObject
% eventdata
% handles

handle to pushbutton20 (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

function edit14_Callback(hObject, eventdata, handles)


% hObject
% eventdata
% handles

handle to edit14 (see GCBO)


reserved - to be defined in a future version of MATLAB
structure with handles and user data (see GUIDATA)

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


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

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


function edit14_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit14 (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 edit15_Callback(hObject, eventdata, handles)


% hObject
handle to edit15 (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 edit15 as text
%
str2double(get(hObject,'String')) returns contents of edit15 as a
double

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


function edit15_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit15 (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

57

function edit16_Callback(hObject, eventdata, handles)


% hObject
handle to edit16 (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 edit16 as text
%
str2double(get(hObject,'String')) returns contents of edit16 as a
double

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


function edit16_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit16 (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 edit17_Callback(hObject, eventdata, handles)


Val=get(hObject,'String'); %Almacenar valor ingresado
NewVal = str2double(Val); %Transformar a formato double
handles.edit17=NewVal; %Almacenar en identificador
guidata(hObject,handles);
% hObject
handle to edit17 (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 edit17 as text
%
str2double(get(hObject,'String')) returns contents of edit17 as a
double

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


function edit17_CreateFcn(hObject, eventdata, handles)
% hObject
handle to edit17 (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

58

Você também pode gostar