Está en la página 1de 26

CI171-INTRODUCCIÓN A LOS

METODOS COMPUTACIONALES

TRABAJO FINAL:
INCORPORACIÓN DEL
SOFTWARE MATLAB
DENTRO DE PROYECTOS
DE DISEÑO DE TUBERÍAS
RAMIFICADAS
FACULTAD DE INGENIERÍA

CICLO 2017-02

INTRODUCCIÓN A LOS MÉTODOS COMPUTACIONALES

SECCIÓN: CV61

PROYECTO FINAL:
INCORPORACIÓN DE SOFTWARE
MATLAB DENTRO DE
PROYECTOS DE DISEÑO DE
TUBERÍAS RAMIFICADAS

DOCENTE: MELO SAUL LUIZ

ESTUDIANTES:
ARANGO PALOMINO, Amada Karolina u201517083
PINEDA ESTEBAN, Andrea Pilar u201517295
QUIQUIA ROBLES, Paola Cristina u201517272
ROSALES VILLANUEVA, Aldair Santos u201517261
YARANGA HUAMANI, Rogelio u201517370

SEDE VILLA, NOVIEMBRE 2017


ÍNDICE

1. Antecedentes

2. Presentación del problema

3. Planteamiento de objetivos

4. Importancia

5. Evaluación de alternativas de solución

6. Optimización de proceso

7. Entregable en Matlab

8. Conclusiones

9. Anexos

10. Bibliografía
1. ANTECEDENTES

El agua es un elemento esencial para la existencia de vida en nuestro planeta.


Todos los seres vivos somos, en mayor o menor medida, agua y necesitamos
consumirla de forma continuada para vivir. Es por ello que la humanidad ha
almacenado y distribuido agua prácticamente desde sus orígenes. Desde las
primeras técnicas de almacenaje, limpieza y distribución hasta las
infraestructuras y tecnologías actuales para el tratamiento de aguas, reciclado
de aguas y depuración de aguas ha transcurrido una larga historia.1

Los primeros antecedentes se encontraron en Jericó, Israel, hace


aproximadamente 70000 años, donde el agua era almacenada en pozos y
distribuida a través de canales excavados en arena y rocas. Posteriormente, se
comenzaron a utilizar tuberías huecas, similares a las que se usan hoy en día.
Por ejemplo, en Egipto se utilizaron arboles huecos en el transporte de fluidos,
así como en China utilizaron el árbol de bambú. Fueron precisamente los
egipcios, los primeros en utilizar métodos para el tratamiento del agua. Estos
registros datan de hace más de 1,500 años hasta el 400 A.C. Es así como a lo
largo de la historia los métodos de almacenamiento y distribución de agua fueron
mejorando con el fin de encontrar el método más práctico y efectivo. En la
antigua Grecia, el agua de escorrentía, agua de pozos y agua de lluvia eran
utilizadas desde épocas muy tempranas por sus ciudadanos. Debido al
crecimiento de la población se vieron obligados a desarrollar sistemas más
eficaces para al almacenamiento y distribución del agua, lo que llevó a la
construcción de las primeras redes de distribución a gran escala que requerían
de unos materiales más sofisticados, como la cerámica, la madera o el metal.

La verdadera novedad introducida por los griegos estuvo en que ellos fueron la
primera sociedad en tener un interés claro por la calidad del agua que
consumían. Por ello, el agua utilizada se retiraba mediante sistemas de aguas
residuales, a la vez que el agua de lluvia, y se utilizaban embalses de aireación
para la purificación del agua.

1
Cfr.CONDORCHEM:2010
Así llegamos a la época del imperio Romano. Los romanos fueron los mayores
arquitectos en construcciones de redes de distribución de agua que ha existido
a lo largo de la historia.

En la actualidad, el método más común para transportar fluidos de un punto a


otro es impulsarlo a través de un sistema de tuberías. Las tuberías de sección
circular son las más frecuentes debido a que generan menores perdidas en
comparación con otras tuberías que poseen vértices, además, ofrece mayor
resistencia estructural frente al golpe de ariete.2

Los materiales con que se construyen las conducciones son muy diversos tales
como acero al carbono, acero inoxidable, hierro forjado, fundición, plomo,
plásticos, cemento, amianto, bronce, cobre, cerámica, vidrio, etc., y cada uno
responde a una necesidad concreta.3En el caso de conducción de fluidos
líquidos los materiales más utilizados en los diseños son: PVC, CPVC, cobre y
polipropileno. La elección depende básicamente de las necesidades del
proyecto, el tipo de estructura en el cual se instalarán las tuberías, el tipo de
fluido que se transporta, economía del proyecto y la rentabilidad.

Así como se vio en párrafos anteriores, la elección del material de transporte de


fluido depende de la demanda del proyecto y la magnitud del mismo, debido a la
gran demanda en el sector de construcción. Por lo tanto, es indispensable
estudiar los diferentes tipos de instalaciones que se realizan con mayor
frecuencia en el país. Las tuberías instaladas en las redes de acueducto de las
ciudades y municipios están instaladas con asbesto, concreto, cobre y PVC,
cabe señalar que las dimensiones van en función de la necesidad de
proporcionar un servicio de calidad.

En función del material y requerimiento del proyecto es que se realizan los


diseños de ingeniería de almacenamiento y distribución de agua potable, partir
del cual se diseñan sistemas de tuberías. Un sistema de tubería son conjuntos
de tuberías que operan bajo las mismas condiciones hidráulicas, ejemplos:
Redes de agua potable de una ciudad, Sistemas de tuberías en plantas
industriales, Sistemas de riego, de drenaje y otros, pueden tener diseño sencillo

2
Cfr.Potter 45:2002
3
Cfr.Condorchem:2010
(en serie) o diseños complejos (en paralelo y ramificados). forman parte de un
sistema de tuberías4. Este sistema puede ser en serie, paralelo y ramificada.

Se tiene tuberías en serie cuando se conectan dos tuberías diferentes (en


tamaño o rugosidades), de modo tal que la misma cantidad de fluido fluya a
través de ellas y la pérdida de carga total es la suma de pérdidas de carga
parciales. Los sistemas de tuberías ramificadas están constituidos por dos o más
tuberías que se ramifican en cierto punto y no vuelven a unirse aguas abajo. La
solución se encuentra suponiendo primero una elevación de la línea
piezométrica en la unión y luego calculando el caudal para cada rama, teniendo
que cumplirse el principio de continuidad (Qi = Qo). Si el caudal hacia la unión
es muy grande se asume una mayor elevación de la carga piezométrica, lo cual
reducirá el caudal de ingreso (Qi) e incrementará el caudal de salida (Qo)5.

2. PRESENTACIÓN DEL PROBLEMA

A lo largo de los años, para poder diseñar, construir y controlar obras en beneficio
de la sociedad se hace necesario e indispensable la labor del ingeniero.
Respecto a lo anterior, el conocimiento y experiencia con la que cuenta es útil
para la generación de recursos e implementación de modelos que sirvan de
instrumento para el desarrollo de la sociedad.

El agua tiene una importancia trascendental para la vida y salud de todas las
personas. Es por ello que una de las obras más requeridas dentro de la sociedad
es la canalización, transporte y distribución optima del agua para el
abastecimiento público de agua potable, riego, industrias y otros. Para ello, se
busca aplicar métodos y procesos creativos acordes con el avance de la ciencia
y el desarrollo de la tecnología. Es así que, mediante la aplicación de modelos
matemáticos y la ayuda de las tecnologías actuales, se hacen uso de nuevos
programas y softwares que simplifiquen los cálculos y nos permitan ahorrar
tiempo y dinero en el desarrollo de las actividades.

4
Cfr. UPC
5
Cfr. UPC
Uno de los programas más útiles para los ingenieros es el Matlab. Este programa
está especialmente diseñado para el uso con fines científicos o de ingeniería. El
programa te permite resolver los cálculos necesarios para tu análisis, trabajo o
proyecto. Asimismo, con la ayuda de este programa podemos crear fácilmente
nuestras propias funciones y programas especiales.

En el presente trabajo se pretende calcular la elevación o cota del punto de


conexión de las tuberías para determinar la posición correcta de las tuberías que
se encuentren interconectadas, respecto a ese punto. Además, de poder calcular
el caudal óptimo que deberá registrarse en las ramificaciones de manera que
haya una correcta distribución a lo largo del trayecto que deba recorrer.

Es importante resaltar el beneficio que tiene la aplicación de este programa ya


que sin ello la solución convencional demora más y el margen de error puede
llegar hacer mayor de lo indicado debido al redondeo de los cálculos y errores
propios del mal cálculo.

3. PLANTEAMIENTO DE OBJETIVOS

Elaborar una programación en el software Matlab que permita calcular la


elevación o cota del punto de conexión de las tuberías ramificadas
transportadoras de líquidos.

4. IMPORTANCIA

Es importante reducir el tiempo de cálculo e interacción para hallar ciertos


parámetros de diseños en tuberías ramificadas, a la par optimizar la precisión de
cálculo, la cual puede llegar hasta el milímetro. Situación que no sucede cuando
se calcula mediante fórmulas o tabulaciones, los cuales generan errores que
pueden ser arrastrados durante el cálculo de las cotas, caudales, entre otros.
Además, la importancia de abarcar este tema radica en que en la actualidad se
requieren de muchos proyectos de mejoramiento y ampliación de servicios de
agua y saneamiento rural en regiones como Apurímac, Huancavelica, Puno,
entre otros.

5. EVALUACIÓN DE LA ALTERNATIVA DE SOLUCIÓN

Se encuentra la cota “d” a partir de “n” interacciones y aplicaciones de fórmulas


de Hazen-Williams.

A continuación, se presenta el método convencional de resolución

Ilustración 1: Representación de un sistema de tubería ramificada

Los sistemas de tuberías ramificadas están constituidos por tres elementos


conectados en una sola unión (en el punto d). Las cargas hidráulicas Ha, Hb, Hc
se consideran conocidas, las incógnitas son la carga hidráulica en Hd y las
descargas Q1, Q2 y Q3. La relación adicional es el equilibrio de la continuidad
en el punto d.6

Siguiendo en análisis de la premisa anterior, la solución se encuentra


suponiendo primero una elevación de la línea piezométrica en la unión y luego
calculando el caudal para cada rama, teniendo que cumplirse el principio de
continuidad (Qi = Qo). A continuación, se muestran el análisis desarrollado.

6
Cfr. Potter: 2014
En primer lugar, calculamos la perdida de carga hidráulica de a-d

ℎ𝑓 = ℎ𝑎 − ℎ𝑑

Luego calculamos el caudal con la siguiente ecuación de Hazen

1
ℎ𝑓𝑥𝐷4.87 1.852
𝑄1 = ( ) 𝐶
10.68𝐿

En segundo lugar, calculamos la perdida de carga hidráulica de b-d

ℎ𝑓 = ℎ𝑏 − ℎ𝑑
Posteriormente calculamos el caudal en 2 con la siguiente ecuación de Hazen

1
ℎ𝑓𝑥𝐷4.87 1.852
𝑄2 = ( ) 𝐶
10.68𝐿

En tercer lugar, calculamos la perdida de carga hidráulica de a-d

ℎ𝑓 = ℎ𝑑 − ℎ𝑐

Por consiguiente, calculamos el caudal en 3 con la siguiente ecuación de Hazen

1
ℎ𝑓𝑥𝐷4.87 1.852
𝑄3 = ( ) 𝐶
10.68𝐿

Luego de hallar Q1, Q2 y Q3 sustituimos los valores en la ecuación de


continuidad para verificar el equilibrio de continuidad

Q1=Q2+Q3

Si el caudal hacia la unión es muy grande y no se logra la igualdad, se asume


una mayor elevación de la carga piezométrica, lo cual reducirá el caudal de
ingreso (Q1) e incrementará el caudal de salida (Q2+Q3).

Se logrará la igualdad cuando la elevación de la carga hidráulica en Hd sea la


óptima.
6. OPTIMIZACIÓN DE PROCESO

Se encuentra la cota “d” a partir de “n” interacciones y aplicaciones de fórmulas


de Hazen-Williams con la ayuda de Matlab.
Se encuentra la cota “d” a partir de “n” interacciones y aplicaciones de fórmulas
de Hazen-Williams con la ayuda de Matlab.

Para el cálculo con ayuda del Matlab utilizaremos el método de la secante

MÉTODO DE LA BISECCIÓN

Método iterativo que búsqueda incremental donde el intervalo se divide en dos.


Si la función planteada cambia de signo sobre un intervalo, se evalúa el valor
de la función en el punto medio de este intervalo.

El método de bisección es uno de los más versátiles para determinar una raíz
real en un intervalo de una ecuación dada, es fácil de comprender, aunque si
se desea una mayor exactitud el número de cálculos que hay que realizar
aumenta considerablemente. En otras palabras, la convergencia puede ser
"muy lenta", por lo cual se hace necesario establecer una cota para n, es
decir, imponer un máximo número de iteraciones.7

Sin embargo, no tiene en cuenta la magnitud de los valores de la función en


las aproximaciones calculadas, sólo tiene en cuenta el signo de f(xn ), lo que
hace que buenas aproximaciones intermedias pasen desapercibidas. 8

El desarrollo de la programación se presenta además en el software de Excel:

7
Cfr. MDP
8
Cfr. MDP
7. ENTREGABLE EN MATLAB

function varargout = GUI_TUB(varargin)


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

% Last Modified by GUIDE v2.5 18-Nov-2017 14:36:42

% Begin initialization code - DO NOT EDIT


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @GUI_TUB_OpeningFcn, ...
'gui_OutputFcn', @GUI_TUB_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 GUI_TUB is made visible.
function GUI_TUB_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 GUI_TUB (see VARARGIN)

% Choose default command line output for GUI_TUB


handles.output = hObject;

% Update handles structure


guidata(hObject, handles);

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


% uiwait(handles.figure1);

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

% Get default command line output from handles structure


varargout{1} = handles.output;

function Z1_Callback(hObject, eventdata, handles)


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


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

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


function Z1_CreateFcn(hObject, eventdata, handles)
% hObject handle to Z1 (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 Z2_Callback(hObject, eventdata, handles)


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


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

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


function Z2_CreateFcn(hObject, eventdata, handles)
% hObject handle to Z2 (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 Z3_Callback(hObject, eventdata, handles)


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


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

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


function Z3_CreateFcn(hObject, eventdata, handles)
% hObject handle to Z3 (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 L1_Callback(hObject, eventdata, handles)


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


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

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


function L1_CreateFcn(hObject, eventdata, handles)
% hObject handle to L1 (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 D1_Callback(hObject, eventdata, handles)


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


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

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


function D1_CreateFcn(hObject, eventdata, handles)
% hObject handle to D1 (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 C1_Callback(hObject, eventdata, handles)


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


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

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


function C1_CreateFcn(hObject, eventdata, handles)
% hObject handle to C1 (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 L2_Callback(hObject, eventdata, handles)


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


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

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


function L2_CreateFcn(hObject, eventdata, handles)
% hObject handle to L2 (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 D2_Callback(hObject, eventdata, handles)


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


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

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


function D2_CreateFcn(hObject, eventdata, handles)
% hObject handle to D2 (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 C2_Callback(hObject, eventdata, handles)


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


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

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


function C2_CreateFcn(hObject, eventdata, handles)
% hObject handle to C2 (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 L3_Callback(hObject, eventdata, handles)


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


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

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


function L3_CreateFcn(hObject, eventdata, handles)
% hObject handle to L3 (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 D3_Callback(hObject, eventdata, handles)
% hObject handle to D3 (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 D3 as text


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

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


function D3_CreateFcn(hObject, eventdata, handles)
% hObject handle to D3 (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 C3_Callback(hObject, eventdata, handles)


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


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

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


function C3_CreateFcn(hObject, eventdata, handles)
% hObject handle to C3 (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 Zx_Callback(hObject, eventdata, handles)


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

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


function Zx_CreateFcn(hObject, eventdata, handles)
% hObject handle to Zx (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)
Z1=str2double(get(handles.Z1,'string'));
Z2=str2double(get(handles.Z2,'string'));
Z3=str2double(get(handles.Z3,'string'));
L1=str2double(get(handles.L1,'string'));
L2=str2double(get(handles.L2,'string'));
L3=str2double(get(handles.L3,'string'));
D1=str2double(get(handles.D1,'string'));
D2=str2double(get(handles.D2,'string'));
D3=str2double(get(handles.D3,'string'));
C1=str2double(get(handles.C1,'string'));
C2=str2double(get(handles.C2,'string'));
C3=str2double(get(handles.C3,'string'));
Error_deseado=str2double(get(handles.E,'string'));
an=Z2;
bn=Z1;
mn=(an+bn)/2;
K1=((((D1^4.87)/(10.68*L1))^(1/1.852))*C1);
K2=((((D2^4.87)/(10.68*L2))^(1/1.852))*C2);
K3=((((D3^4.87)/(10.68*L3))^(1/1.852))*C3);
fan=-(((abs(Z1-an))^(1/1.852))*K1)+(((abs(an-
Z2))^(1/1.852))*K2)+(((abs(an-Z3))^(1/1.852))*K3);
fmn=-(((abs(Z1-mn))^(1/1.852))*K1)+(((abs(mn-
Z2))^(1/1.852))*K2)+(((abs(mn-Z3))^(1/1.852))*K3);
Error=abs(mn-1)/abs(mn);
if Z1>Z2>Z3
while Error>Error_deseado
if fan*fmn<0
an=an;
bn=mn;mna=mn;
mn=(an+bn)/2;
fan=-(((abs(Z1-an))^(1/1.852))*K1)+(((abs(an-
Z2))^(1/1.852))*K2)+(((abs(an-Z3))^(1/1.852))*K3);
fmn=-(((abs(Z1-mn))^(1/1.852))*K1)+(((abs(mn-
Z2))^(1/1.852))*K2)+(((abs(mn-Z3))^(1/1.852))*K3);
Error=abs(mn-mna)/abs(mn);
else
an=mn;
bn=bn;mna=mn;
mn=(an+bn)/2;
fan=-(((Z1-an)^(1/1.852))*K1)+(((abs(an-
Z2))^(1/1.852))*K2)+(((abs(an-Z3))^(1/1.852))*K3);
fmn=-(((Z1-mn)^(1/1.852))*K1)+(((abs(mn-
Z2))^(1/1.852))*K2)+(((abs(mn-Z3))^(1/1.852))*K3);
Error=abs(mn-mna)/abs(mn);
end
end
else
errordlg('IDENTIFICA BIEN EL ORDEN DE LAS COTAS Z1(MAYOR COTA) Y
Z3(MENOR COTA)')
end
Q1=round((((abs(Z1-mn))^(1/1.852))*K1),3);
Q2=round((((abs(mn-Z2))^(1/1.852))*K2),3);
Q3=round((((abs(mn-Z3))^(1/1.852))*K3),3);
set(handles.Zx,'string',mn);

% 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 pushbutton3.


function pushbutton3_Callback(hObject, eventdata, handles)
close;
% 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 a_Callback(hObject, eventdata, handles)


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


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

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


function a_CreateFcn(hObject, eventdata, handles)
% hObject handle to a (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 b_Callback(hObject, eventdata, handles)


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


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

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


function b_CreateFcn(hObject, eventdata, handles)
% hObject handle to b (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 E_Callback(hObject, eventdata, handles)


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


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

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


function E_CreateFcn(hObject, eventdata, handles)
% hObject handle to E (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
8. CONCLUSIONES

 Los programas de métodos computacionales permiten optimizar el cálculo de


parámetros de diversos fenómenos físicos.

 La programación que se realizó permite obtener una precisión menor que un


cálculo realizado a mano, el cálculo realizado a mano genera un valor que difiere
en más de una unidad.

 El error en la programación es menor a 0.01.

9. ANEXOS
10. BIBLIOGRAFIA

 Universidad Peruana de Ciencias Aplicadas(UPC) (2017) Flujo en Tuberías, ppts


de Mecánica de Fluidos, UPC: Lima.

 CONDORCHEM (2010) Historia de los sistemas de distribución y tratamiento de


agua (consulta: 17 de Noviembre de 2017)( https://condorchem.com/es/).
 EMPRESA PAVCO(2017) Válvulas reductoras y accesorios,(consulta: 17 de
Noviembre de 2017)(http://www.hidrojing.com/wp-
content/uploads/Bibliografia/14_Uso%20de%20valvulas%20reductoras%20de
%20presion.pdf).

 MOORE, Holly (2006) Matlab para Ingenieros, Pearson: Madrid.

 Universidad Nacional del Mar de Plata (2013)Métodos Numéricos,(Consulta:


20 de noviembre de 2017)(http://www3.fi.mdp.edu.ar/metodos/teorias/MN%20-
%202013b%20-%203%20ec%20no%20lineales%202013_2.pdf)

También podría gustarte