Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Integrantes:
Introducción:
Se realizó una interfaz gráfica con la ayuda de “app designer”, herramienta que viene integrada
en las funciones de Mathlab. Esta interfaz se relaciona al diseño de canales trapezoidales y
rectangulares con flujo uniforme, de donde en base al script proporcionado se encontrará las
características principales de un canal, usando la Ecuación de Manning y el método numérico de
Newton-Rapshon.
Desarrollo:
App designer, herramienta integrada dentro de las funciones de Matlab, es una aplicación que
permite crear apps profesionales, aunque no sea un desarrollador de software profesional
(Mathlab, s.f.).
Para el cálculo de las características del canal se genera un script a partir del “PUSH BUTTON”
con los datos de ingresos de los “Edit Field”, tal que:
% Value changed function: CalcularButton
function CalcularButtonValueChanged(app, event)
Q = (app.Q.Value);
b = (app.b.Value);
z = (app.z.Value);
n = (app.n.Value);
S = (app.S.Value);
yinitial=0.01; %Se asume un valor inicial para empezar
el cálculo
end
• Flujo en régimen
• Riesgo de azolve de
• Velocidad Alta
Resultados:
Conclusiones:
Al crear una interfaz gráfica se pueden obtener los resultados de una manera inmediata y se
muestran de una forma sencilla.
Para la aplicación de los conocimientos adquiridos en hidráulica de Canales, nos resultó más
factible y didáctico emplearlo mediante un código.
Referencia:
Mathlab. (s.f.). MATLAB App Designer. Obtenido de
https://la.mathworks.com/products/matlab/app-designer.html:
https://la.mathworks.com/products/matlab/app-designer.html
Anexo
Q = (app.Q.Value);
b = (app.b.Value);
z = (app.z.Value);
n = (app.n.Value);
S = (app.S.Value);
app.Vel.Value= Vel;
app.Calado_Normal.Value= Calado_Normal;
app.Areah.Value=Areah;
app.T.Value=T;
app.F.Value=F;
app.Alt.Value=Alt;
if app.F.Value< 1;
end
end
end
end
% Component initialization
methods (Access = private)
% Create Image
app.Image = uiimage(app.UIFigure);
app.Image.Position = [-62 -15 814 550];
app.Image.ImageSource = 'close-up-drop-water-spray-black-
white-wallpaper-preview.jpg';
% Create CaudalLabel
app.CaudalLabel = uilabel(app.UIFigure);
app.CaudalLabel.BackgroundColor = [0 0 0];
app.CaudalLabel.HorizontalAlignment = 'center';
app.CaudalLabel.FontWeight = 'bold';
app.CaudalLabel.FontColor = [1 1 1];
app.CaudalLabel.Position = [121 369 49 22];
app.CaudalLabel.Text = 'Caudal ';
% Create Q
app.Q = uieditfield(app.UIFigure, 'numeric');
app.Q.ValueChangedFcn = createCallbackFcn(app,
@QValueChanged, true);
app.Q.Tag = 'Q';
app.Q.FontColor = [1 1 1];
app.Q.BackgroundColor = [0 0 0];
app.Q.Position = [201 365 44 30];
% Create AnchodelcanalLabel
app.AnchodelcanalLabel = uilabel(app.UIFigure);
app.AnchodelcanalLabel.BackgroundColor = [0 0 0];
app.AnchodelcanalLabel.HorizontalAlignment = 'center';
app.AnchodelcanalLabel.FontColor = [1 1 1];
app.AnchodelcanalLabel.Position = [95 328 91 22];
app.AnchodelcanalLabel.Text = 'Ancho del canal';
% Create b
app.b = uieditfield(app.UIFigure, 'numeric');
app.b.Tag = 'b';
app.b.FontColor = [1 1 1];
app.b.BackgroundColor = [0 0 0];
app.b.Position = [201 324 44 30];
% Create CoeficientedeManningLabel
app.CoeficientedeManningLabel = uilabel(app.UIFigure);
app.CoeficientedeManningLabel.BackgroundColor = [0 0 0];
app.CoeficientedeManningLabel.HorizontalAlignment =
'center';
app.CoeficientedeManningLabel.FontColor = [1 1 1];
app.CoeficientedeManningLabel.Position = [54 253 132 22];
app.CoeficientedeManningLabel.Text = 'Coeficiente de
Manning';
% Create n
app.n = uieditfield(app.UIFigure, 'numeric');
app.n.Tag = 'n';
app.n.FontColor = [1 1 1];
app.n.BackgroundColor = [0 0 0];
app.n.Position = [201 249 44 30];
% Create PendientelateraldelcanalLabel
app.PendientelateraldelcanalLabel = uilabel(app.UIFigure);
app.PendientelateraldelcanalLabel.BackgroundColor = [0 0
0];
app.PendientelateraldelcanalLabel.HorizontalAlignment =
'center';
app.PendientelateraldelcanalLabel.FontColor = [1 1 1];
app.PendientelateraldelcanalLabel.Position = [39 290 147
22];
app.PendientelateraldelcanalLabel.Text = 'Pendiente
lateral del canal';
% Create z
app.z = uieditfield(app.UIFigure, 'numeric');
app.z.Tag = 'z';
app.z.FontColor = [1 1 1];
app.z.BackgroundColor = [0 0 0];
app.z.Position = [201 286 44 30];
% Create PendientelongitudinaldelcanalLabel
app.PendientelongitudinaldelcanalLabel =
uilabel(app.UIFigure);
app.PendientelongitudinaldelcanalLabel.BackgroundColor =
[0 0 0];
app.PendientelongitudinaldelcanalLabel.HorizontalAlignment
= 'center';
app.PendientelongitudinaldelcanalLabel.FontColor = [1 1
1];
app.PendientelongitudinaldelcanalLabel.Position = [3 216
184 22];
app.PendientelongitudinaldelcanalLabel.Text = 'Pendiente
longitudinal del canal';
% Create S
app.S = uieditfield(app.UIFigure, 'numeric');
app.S.Tag = 'S';
app.S.FontColor = [1 1 1];
app.S.BackgroundColor = [0 0 0];
app.S.Position = [200 219 45 25];
% Create CalcularButton
app.CalcularButton = uibutton(app.UIFigure, 'state');
app.CalcularButton.ValueChangedFcn =
createCallbackFcn(app, @CalcularButtonValueChanged, true);
app.CalcularButton.Tag = 'C';
app.CalcularButton.Text = 'Calcular';
app.CalcularButton.BackgroundColor = [0.651 0.651 0.651];
app.CalcularButton.FontSize = 18;
app.CalcularButton.FontWeight = 'bold';
app.CalcularButton.FontColor = [0.1882 0.0902 0.1098];
app.CalcularButton.Position = [374 315 174 44];
% Create VelocidadLabel
app.VelocidadLabel = uilabel(app.UIFigure);
app.VelocidadLabel.BackgroundColor = [0 0 0];
app.VelocidadLabel.HorizontalAlignment = 'center';
app.VelocidadLabel.FontColor = [1 1 1];
app.VelocidadLabel.Position = [336 174 91 22];
app.VelocidadLabel.Text = 'Velocidad';
% Create Vel
app.Vel = uieditfield(app.UIFigure, 'numeric');
app.Vel.FontColor = [1 1 1];
app.Vel.BackgroundColor = [0 0 0];
app.Vel.Position = [439 175 66 17];
% Create CaladoNormalLabel
app.CaladoNormalLabel = uilabel(app.UIFigure);
app.CaladoNormalLabel.BackgroundColor = [0 0 0];
app.CaladoNormalLabel.HorizontalAlignment = 'center';
app.CaladoNormalLabel.FontColor = [1 1 1];
app.CaladoNormalLabel.Position = [338 144 86 22];
app.CaladoNormalLabel.Text = 'Calado Normal';
% Create Calado_Normal
app.Calado_Normal = uieditfield(app.UIFigure, 'numeric');
app.Calado_Normal.FontColor = [1 1 1];
app.Calado_Normal.BackgroundColor = [0 0 0];
app.Calado_Normal.Position = [439 144 66 17];
% Create NFroudeLabel
app.NFroudeLabel = uilabel(app.UIFigure);
app.NFroudeLabel.BackgroundColor = [0 0 0];
app.NFroudeLabel.HorizontalAlignment = 'center';
app.NFroudeLabel.FontColor = [1 1 1];
app.NFroudeLabel.Position = [339 115 85 22];
app.NFroudeLabel.Text = 'Nº Froude';
% Create F
app.F = uieditfield(app.UIFigure, 'numeric');
app.F.FontColor = [1 1 1];
app.F.BackgroundColor = [0 0 0];
app.F.Position = [439 115 66 17];
% Create AlturaCanalLabel
app.AlturaCanalLabel = uilabel(app.UIFigure);
app.AlturaCanalLabel.BackgroundColor = [0 0 0];
app.AlturaCanalLabel.HorizontalAlignment = 'center';
app.AlturaCanalLabel.FontColor = [1 1 1];
app.AlturaCanalLabel.Position = [336 81 91 22];
app.AlturaCanalLabel.Text = 'Altura Canal';
% Create Alt
app.Alt = uieditfield(app.UIFigure, 'numeric');
app.Alt.FontColor = [1 1 1];
app.Alt.BackgroundColor = [0 0 0];
app.Alt.Position = [439 81 66 17];
% Create reaHidrulicaLabel
app.reaHidrulicaLabel = uilabel(app.UIFigure);
app.reaHidrulicaLabel.BackgroundColor = [0 0 0];
app.reaHidrulicaLabel.HorizontalAlignment = 'center';
app.reaHidrulicaLabel.FontColor = [1 1 1];
app.reaHidrulicaLabel.Position = [339 49 88 22];
app.reaHidrulicaLabel.Text = 'Área Hidráulica';
% Create Areah
app.Areah = uieditfield(app.UIFigure, 'numeric');
app.Areah.FontColor = [1 1 1];
app.Areah.BackgroundColor = [0 0 0];
app.Areah.Position = [439 49 66 17];
% Create EspejodeAguaLabel
app.EspejodeAguaLabel = uilabel(app.UIFigure);
app.EspejodeAguaLabel.BackgroundColor = [0 0 0];
app.EspejodeAguaLabel.HorizontalAlignment = 'center';
app.EspejodeAguaLabel.FontColor = [1 1 1];
app.EspejodeAguaLabel.Position = [336 13 90 22];
app.EspejodeAguaLabel.Text = 'Espejo de Agua';
% Create T
app.T = uieditfield(app.UIFigure, 'numeric');
app.T.FontColor = [1 1 1];
app.T.BackgroundColor = [0 0 0];
app.T.Position = [439 18 66 17];
% Create EditField
app.EditField = uieditfield(app.UIFigure, 'text');
app.EditField.Editable = 'off';
app.EditField.Position = [110 410 135 23];
app.EditField.Value = 'DATOS DE INGRESO:';
% Create EditField_2
app.EditField_2 = uieditfield(app.UIFigure, 'text');
app.EditField_2.Editable = 'off';
app.EditField_2.FontColor = [1 1 1];
app.EditField_2.BackgroundColor = [0.651 0.651 0.651];
app.EditField_2.Position = [420 211 100 26];
app.EditField_2.Value = 'RESULTADOS:';
% Create EditField_3
app.EditField_3 = uieditfield(app.UIFigure, 'text');
app.EditField_3.FontColor = [1 1 1];
app.EditField_3.BackgroundColor = [0 0 0];
app.EditField_3.Position = [76 497 497 22];
app.EditField_3.Value = 'DISEÑO DE CANALES TRAPEZOIDALES Y
RECTANGULARES CON FLUJO UNIFORME';
% Create EditField_4
app.EditField_4 = uieditfield(app.UIFigure, 'text');
app.EditField_4.FontColor = [1 1 1];
app.EditField_4.BackgroundColor = [0 0 0];
app.EditField_4.Position = [70 462 502 20];
app.EditField_4.Value = 'Este software utiliza la Ec. de
Gauckler-Manning y el Método Numérico de Newton-Raphson';
% Create m3sLabel
app.m3sLabel = uilabel(app.UIFigure);
app.m3sLabel.BackgroundColor = [0 0 0];
app.m3sLabel.HorizontalAlignment = 'center';
app.m3sLabel.FontColor = [1 1 1];
app.m3sLabel.Position = [259 369 56 23];
app.m3sLabel.Text = 'm3/s';
% Create mLabel
app.mLabel = uilabel(app.UIFigure);
app.mLabel.BackgroundColor = [0 0 0];
app.mLabel.HorizontalAlignment = 'center';
app.mLabel.FontColor = [1 1 1];
app.mLabel.Position = [259 331 56 23];
app.mLabel.Text = 'm';
% Create Label
app.Label = uilabel(app.UIFigure);
app.Label.BackgroundColor = [0 0 0];
app.Label.HorizontalAlignment = 'center';
app.Label.FontColor = [1 1 1];
app.Label.Position = [259 290 56 23];
app.Label.Text = '-';
% Create Label_2
app.Label_2 = uilabel(app.UIFigure);
app.Label_2.BackgroundColor = [0 0 0];
app.Label_2.HorizontalAlignment = 'center';
app.Label_2.FontColor = [1 1 1];
app.Label_2.Position = [259 253 56 23];
app.Label_2.Text = '-';
% Create mmLabel
app.mmLabel = uilabel(app.UIFigure);
app.mmLabel.BackgroundColor = [0 0 0];
app.mmLabel.HorizontalAlignment = 'center';
app.mmLabel.FontColor = [1 1 1];
app.mmLabel.Position = [259 219 56 23];
app.mmLabel.Text = 'm/m';
% Create msLabel
app.msLabel = uilabel(app.UIFigure);
app.msLabel.BackgroundColor = [0 0 0];
app.msLabel.HorizontalAlignment = 'center';
app.msLabel.FontColor = [1 1 1];
app.msLabel.Position = [519 172 56 23];
app.msLabel.Text = 'm/s';
% Create mLabel_2
app.mLabel_2 = uilabel(app.UIFigure);
app.mLabel_2.BackgroundColor = [0 0 0];
app.mLabel_2.HorizontalAlignment = 'center';
app.mLabel_2.FontColor = [1 1 1];
app.mLabel_2.Position = [519 141 56 23];
app.mLabel_2.Text = 'm';
% Create Label_3
app.Label_3 = uilabel(app.UIFigure);
app.Label_3.BackgroundColor = [0 0 0];
app.Label_3.HorizontalAlignment = 'center';
app.Label_3.FontColor = [1 1 1];
app.Label_3.Position = [519 109 56 23];
app.Label_3.Text = '-';
% Create mLabel_3
app.mLabel_3 = uilabel(app.UIFigure);
app.mLabel_3.BackgroundColor = [0 0 0];
app.mLabel_3.HorizontalAlignment = 'center';
app.mLabel_3.FontColor = [1 1 1];
app.mLabel_3.Position = [519 81 56 23];
app.mLabel_3.Text = 'm';
% Create m2Label_2
app.m2Label_2 = uilabel(app.UIFigure);
app.m2Label_2.BackgroundColor = [0 0 0];
app.m2Label_2.HorizontalAlignment = 'center';
app.m2Label_2.FontColor = [1 1 1];
app.m2Label_2.Position = [519 43 56 23];
app.m2Label_2.Text = 'm2';
% Create mLabel_4
app.mLabel_4 = uilabel(app.UIFigure);
app.mLabel_4.BackgroundColor = [0 0 0];
app.mLabel_4.HorizontalAlignment = 'center';
app.mLabel_4.FontColor = [1 1 1];
app.mLabel_4.Position = [519 13 56 23];
app.mLabel_4.Text = 'm';
% Create Fl
app.Fl = uieditfield(app.UIFigure, 'text');
app.Fl.HorizontalAlignment = 'center';
app.Fl.FontColor = [1 1 1];
app.Fl.BackgroundColor = [0 0 0];
app.Fl.Position = [18 99 255 33];
% Create Va
app.Va = uieditfield(app.UIFigure, 'text');
app.Va.HorizontalAlignment = 'center';
app.Va.FontColor = [1 1 1];
app.Va.BackgroundColor = [0 0 0];
app.Va.Position = [18 53 255 33];
% Create v
app.v = uieditfield(app.UIFigure, 'text');
app.v.HorizontalAlignment = 'center';
app.v.FontColor = [1 1 1];
app.v.BackgroundColor = [0 0 0];
app.v.Position = [18 6 255 33];
% Create NOTALabel
app.NOTALabel = uilabel(app.UIFigure);
app.NOTALabel.BackgroundColor = [0.8 0.8 0.8];
app.NOTALabel.HorizontalAlignment = 'center';
app.NOTALabel.FontWeight = 'bold';
app.NOTALabel.FontColor = [0.1216 0.1216 0.1216];
app.NOTALabel.Position = [18 147 255 26];
app.NOTALabel.Text = 'NOTA:';
% Construct app
function app = Interfaz_Final
if nargout == 0
clear app
end
end