You are on page 1of 29

U NIVERSIDAD NACIONAL DE S AN C RISTBAL DE

H UAMANGA
FACULTAD DE I NGENIERA M INAS , G EOLOGA Y C IVIL

E SCUELA DE F ORMACIN P ROFESIONAL DE I NGENIERA


C IVIL

CURSO:
MTODOS NUMRICOS (IC-343)

PROGRAMACIN DE SECCIONES DE CANALES

D OCENTE :
Ing. CATRO PEREZ, Cristian
A LUMNOS :
SOSA CHAVEZ, Salomn
SULCA DIAZ, Efrain

AYACUCHO -P ER
2017
ndice general

Captulo 0 1. SECCIONES DE CANALES Pgina 2

1.1. INTERFAZ PRINCIPAL DE ENTRADA . . . . . . . . . . . . . . . . 3


1.2. INTERFAZ DE LAS SECCIONES DE TODOS LOS CANALES 3
1.3. SECCIN N 01 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3.1. CANAL RECTANGULAR . . . . . . . . . . . . . . . . . . . . . 4
1.3.2. INTERFAZ DEL CANAL . . . . . . . . . . . . . . . . . . . . . 4
1.3.3. CDIGO FUENTE DE LA SECCIN N01 . . . . . . . . . 4
1.4. SECCIN N 02 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4.1. CANAL TRAPEZOIDAL . . . . . . . . . . . . . . . . . . . . . 7
1.4.2. INTERFAZ DEL CANAL . . . . . . . . . . . . . . . . . . . . . 7
1.4.3. CDIGO FUENTE DE LA SECCIN N02 . . . . . . . . . 7
1.5. SECCIN N 03 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.1. CANAL TRIANGULAR . . . . . . . . . . . . . . . . . . . . . . 10
1.5.2. INTERFAZ DEL CANAL . . . . . . . . . . . . . . . . . . . . . 10
1.5.3. CDIGO FUENTE DE LA SECCIN N03 . . . . . . . . . 11
1.6. SECCIN N 04 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.6.1. CANAL TIPO CIRCULAR . . . . . . . . . . . . . . . . . . . . 12
1.6.2. INTERFAZ DEL CANAL . . . . . . . . . . . . . . . . . . . . . 12
1.6.3. CDIGO FUENTE DE LA SECCIN N04 . . . . . . . . . 13
1.7. SECCIN N 05 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.7.1. CANAL TIPO OVOIDE . . . . . . . . . . . . . . . . . . . . . . 18
1.7.2. INTERFAZ DEL CANAL . . . . . . . . . . . . . . . . . . . . . 18
1.7.3. CDIGO FUENTE DE LA SECCIN N05 . . . . . . . . . 19
1.8. SECCIN N 06 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.8.1. CANAL TIPO PARABLICO . . . . . . . . . . . . . . . . . . 20
1.8.2. INTERFAZ DEL CANAL . . . . . . . . . . . . . . . . . . . . . 20
1.8.3. CDIGO FUENTE DE LA SECCIN N06 . . . . . . . . . 21
1.9. SECCIN N 07 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
1.9.1. CANAL TIPO BVEDA . . . . . . . . . . . . . . . . . . . . . . 24
1.9.2. INTERFAZ DEL CANAL . . . . . . . . . . . . . . . . . . . . . 24
1.9.3. CDIGO FUENTE DE LA SECCIN N07 . . . . . . . . . 26

Ingeniera civil Pag. 1


Captulo 1

SECCIONES DE CANALES
METODOS NUMERICOS Secciones de Canales

1.1 INTERFAZ PRINCIPAL DE ENTRADA

Figura 1.1: Interfaz general del programa

1.2 INTERFAZ DE LAS SECCIONES DE TODOS LOS CANALES

Figura 1.2: Secciones de todos los canales

Ingeniera civil Pag. 3


METODOS NUMERICOS Secciones de Canales

1.3 SECCIN N 01

1.3.1. CANAL RECTANGULAR

Figura 1.3: Seccin rectangular

1.3.2. INTERFAZ DEL CANAL

Figura 1.4: interfaz de resultados de la seccin N01

1.3.3. CDIGO FUENTE DE LA SECCIN N01


1.3.3.1. Cdigo fuente para los clculos del canal

Ingeniera civil Pag. 4


METODOS NUMERICOS Secciones de Canales

1 function pushbutton1_Callback(hObject, eventdata, handles)


2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of
MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5
6 S=str2double(get(handles.edit12,'string')); % S= ESLA PENDIENTE
DEL CANAL
7 Q=str2double(get(handles.edit1,'string')); % Q= ES EL CAUDAL QUE
SE QUIERE
8 n=str2double(get(handles.edit11,'string')); % n= COEFICIENTE DE
RUGOSIDAD
9 b=str2double(get(handles.edit2,'string')); % b= BASE DEL CANAL
10
11
12
13 precis=0.001;
14 Yo=0.001;
15 C=((Q*n)/(sqrt(S)))^3;
16
17 y=Yo;
18 z=0;
19 L=sqrt(1+z^2);
20
21 while 1
22 A=b*y+z*y^2;
23 P=b+2*y*sqrt(1+z^2);
24 T=b+2*z*y;
25 F=A^5/P^2-C;
26 D=(A^4*(5*P*T-4*A*L))/(P^3);
27 ym=y-F/D;
28 if (abs(ym-y)<precis)
29 break
30 end
31 y=ym;
32 end
33 Yn=y;
34
35 An=b*Yn+z*Yn^2;
36 Pn=b+2*Yn*sqrt(1+z^2);
37 Tn=b+2*z*Yn;
38 Rn=An/Pn;
39 Vn=Q/An;
40 En=Yn+Vn^2/19.62;
41 NF=Vn/sqrt(9.81*An/Tn);
42
43 if (NF<1)
44 FL=('Subcritico');
45 else

Ingeniera civil Pag. 5


METODOS NUMERICOS Secciones de Canales

46 FL=('supercritico');
47 end
48
49
50 set(handles.edit3,'String',real(Yn))
51 set(handles.edit4,'String',real(An))
52 set(handles.edit5,'String',real(Pn))
53 set(handles.edit6,'String',real(Tn))
54 set(handles.edit7,'String',real(Rn))
55 set(handles.edit8,'String',real(Vn))
56 set(handles.edit9,'String',real(En))
57 set(handles.edit10,'String',real(NF))
58 set(handles.edit13,'String',FL)

Ingeniera civil Pag. 6


METODOS NUMERICOS Secciones de Canales

1.4 SECCIN N 02

1.4.1. CANAL TRAPEZOIDAL

Figura 1.5: Seccin trapezoidal

1.4.2. INTERFAZ DEL CANAL

Figura 1.6: interfaz de resultados de la seccin N02

1.4.3. CDIGO FUENTE DE LA SECCIN N02


1.4.3.1. Cdigo fuente para los clculos del canal

Ingeniera civil Pag. 7


METODOS NUMERICOS Secciones de Canales

1 function pushbutton1_Callback(hObject, eventdata, handles)


2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of
MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5 S=str2double(get(handles.edit12,'string'));
6 Q=str2double(get(handles.edit1,'string'));
7 n=str2double(get(handles.edit11,'string'));
8 b=str2double(get(handles.edit2,'string'));
9 z=str2double(get(handles.edit14,'string'));
10
11
12 precis=0.001;
13 Yo=0.001;
14 C=((Q*n)/(sqrt(S)))^3;
15
16 y=Yo;
17 L=sqrt(1+z^2);
18
19 while 1
20 A=b*y+z*y^2;
21 P=b+2*y*sqrt(1+z^2);
22 T=b+2*z*y;
23 F=A^5/P^2-C;
24 D=(A^4*(5*P*T-4*A*L))/(P^3);
25 ym=y-F/D;
26 if (abs(ym-y)<precis)
27 break
28 end
29 y=ym;
30 end
31 Yn=y;
32
33 An=b*Yn+z*Yn^2;
34 Pn=b+2*Yn*sqrt(1+z^2);
35 Tn=b+2*z*Yn;
36 Rn=An/Pn;
37 Vn=Q/An;
38 En=Yn+Vn^2/19.62;
39 NF=Vn/sqrt(9.81*An/Tn);
40
41 if (NF<1)
42 FL=('Subcritico');
43 else
44 FL=('supercritico');
45 end
46
47 set(handles.edit3,'String',real(Yn))
48 set(handles.edit4,'String',real(An))

Ingeniera civil Pag. 8


METODOS NUMERICOS Secciones de Canales

49 set(handles.edit5,'String',real(Pn))
50 set(handles.edit6,'String',real(Tn))
51 set(handles.edit7,'String',real(Rn))
52 set(handles.edit8,'String',real(Vn))
53 set(handles.edit9,'String',real(En))
54 set(handles.edit10,'String',real(NF))
55 set(handles.edit13,'String',FL)

Ingeniera civil Pag. 9


METODOS NUMERICOS Secciones de Canales

1.5 SECCIN N 03

1.5.1. CANAL TRIANGULAR

Figura 1.7: Seccin triangular

1.5.2. INTERFAZ DEL CANAL

Figura 1.8: interfaz de resultados de la seccin N03

Ingeniera civil Pag. 10


METODOS NUMERICOS Secciones de Canales

1.5.3. CDIGO FUENTE DE LA SECCIN N03


1.5.3.1. Cdigo fuente para los clculos del canal

1 function pushbutton1_Callback(hObject, eventdata, handles)


2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of
MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5
6 S=str2double(get(handles.edit12,'string')); % S= ESLA PENDIENTE
DEL CANAL
7 Q=str2double(get(handles.edit1,'string')); % Q = ES EL CAUDAL
QUE SE QUIERE
8 n=str2double(get(handles.edit11,'string')); % n= COEFICIENTE DE
RUGOSIDAD
9 z=str2double(get(handles.edit2,'string')); % b= BASE DEL CANAL
10
11
12 precis=0.001;
13 Yo=0.001;
14 C=((Q*n)/(sqrt(S)))^3;
15
16 y=Yo;
17 b=0;
18 L=sqrt(1+z^2);
19
20 while 1
21 A=b*y+z*y^2;
22 P=b+2*y*sqrt(1+z^2);
23 T=b+2*z*y;
24 F=A^5/P^2-C;
25 D=(A^4*(5*P*T-4*A*L))/(P^3);
26 ym=y-F/D;
27 if (abs(ym-y)<precis)
28 break
29 end
30 y=ym;
31 end
32 Yn=y;
33
34 An=b*Yn+z*Yn^2;
35 Pn=b+2*Yn*sqrt(1+z^2);
36 Tn=b+2*z*Yn;
37 Rn=An/Pn;
38 Vn=Q/An;
39 En=Yn+Vn^2/19.62;
40 NF=Vn/sqrt(9.81*An/Tn);
41
42 if (NF<1)

Ingeniera civil Pag. 11


METODOS NUMERICOS Secciones de Canales

43 FL=('Subcritico');
44 else
45 FL=('supercritico');
46 end
47
48 set(handles.edit3,'String',real(Yn))
49 set(handles.edit4,'String',real(An))
50 set(handles.edit5,'String',real(Pn))
51 set(handles.edit6,'String',real(Tn))
52 set(handles.edit7,'String',real(Rn))
53 set(handles.edit8,'String',real(Vn))
54 set(handles.edit9,'String',real(En))
55 set(handles.edit10,'String',real(NF))
56 set(handles.edit13,'String',FL)

1.6 SECCIN N 04

1.6.1. CANAL TIPO CIRCULAR

Figura 1.9: Seccin tipo circular

1.6.2. INTERFAZ DEL CANAL

Ingeniera civil Pag. 12


METODOS NUMERICOS Secciones de Canales

Figura 1.10: interfaz de resultados de la seccin N04

1.6.3. CDIGO FUENTE DE LA SECCIN N04


1.6.3.1. Cdigo fuente para los clculos del canal

1 function pushbutton1_Callback(hObject, eventdata, handles)


2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of
MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5
6 S=str2double(get(handles.edit12,'string'));
7 Q=str2double(get(handles.edit1,'string'));
8 n=str2double(get(handles.edit11,'string'));
9 h=str2double(get(handles.edit2,'string'));
10
11
12 precis=0.001;
13 Yo=0.001;
14 C=((Q*n)/(sqrt(S)))^3;
15
16 y=Yo;
17
18 while 1
19 an=acos(10/13);
20 angu=asin(10/13);
21 ang=acos(1-3*y/h);
22 A=h^2*(2*ang-sin(2*ang))/18;
23 P=2*ang*h/3;
24 T=2*h*sin(ang)/3;
25 F=A^5/P^2-C;

Ingeniera civil Pag. 13


METODOS NUMERICOS Secciones de Canales

26 D=5/209952*h^8*(2*pi-2*acos(-1+3*y/h)+sin(2*acos(-1+3*y/h)))
^4/(2*pi-2*acos(-1+3*y/h))^2*(6/h/(1-(-1+3*y/h)^2)^(1/2)-6*
cos(2*acos(-1+3*y/h))/h/(1-(-1+3*y/h)^2)^(1/2))-1/17496*h
^7*(2*pi-2*acos(-1+3*y/h)+sin(2*acos(-1+3*y/h)))^5/(2*pi-2*
acos(-1+3*y/h))^3/(1-(-1+3*y/h)^2)^(1/2);
27 ym=y-F/D;
28 if (abs(ym-y)<precis)
29 break
30
31 end
32 y=ym;
33 end
34 Yh=y;
35 if 0 < Yh & Yh < h/13
36 ang=acos(1-3*Yh/h);
37 An=h^2*(2*ang-sin(2*ang))/18;
38 Pn=2*ang*h/3;
39 Tn=2*h*sin(ang)/3;
40 Rn=An/Pn;
41 Vn=Q/An;
42 En=Yh+Vn^2/19.62;
43 NF=Vn/sqrt(9.81*An/Tn);
44
45 if (NF<1)
46 FL=('Subcritico');
47 else
48 FL=('supercritico');
49 end
50
51 set(handles.edit3,'String',real(Yh))
52 set(handles.edit4,'String',real(An))
53 set(handles.edit5,'String',real(Pn))
54 set(handles.edit6,'String',real(Tn))
55 set(handles.edit7,'String',real(Rn))
56 set(handles.edit8,'String',real(Vn))
57 set(handles.edit9,'String',real(En))
58 set(handles.edit10,'String',real(NF))
59 set(handles.edit13,'String',FL)
60
61
62
63
64 elseif h/13 < Yh & Yh < 12*h/13
65
66 while 1
67 an=acos(10/13);
68 angu=asin(10/13);
69 ang=acos(10*(h-2*y)/(11*h));
70

Ingeniera civil Pag. 14


METODOS NUMERICOS Secciones de Canales

71 A=h^2*(2*an-sin(2*an))/18 + 121*h^2*(ang-sin(ang))/400+h*(13*y
-h)*(7*sin(an)+33*sin(ang))/(30*26);
72 P=2*h*an/3+11*h*ang/10;
73 T=h*(33*sin(ang)-13*sin(an))/30;
74 F=A^5/P^2-C;
75 D=5*(908122504207835/40532396646334464*h^2+121/400*h^2*(acos
(1/11*(10*h-20*y)/h)-1/11*(121-(10*h-20*y)^2/h^2)^(1/2))
+1/780*h*(13*y-h)*(7/13*69^(1/2)+3*(121-(10*h-20*y)^2/h^2)
^(1/2)))^4/(6243429402941671/13510798882111488*h+11/10*h*
acos(1/11*(10*h-20*y)/h))^2*(121/400*h^2*(20/h/(121-(10*h-
20*y)^2/h^2)^(1/2)-20/11/(121-(10*h-20*y)^2/h^2)^(1/2)*(10*
h-20*y)/h^2)+1/60*h*(7/13*69^(1/2)+3*(121-(10*h-20*y)^2/h
^2)^(1/2))+1/13/h*(13*y-h)/(121-(10*h-20*y)^2/h^2)^(1/2)
*(10*h-20*y))-44*(908122504207835/40532396646334464*h
^2+121/400*h^2*(acos(1/11*(10*h-20*y)/h)-1/11*(121-(10*h-
20*y)^2/h^2)^(1/2))+1/780*h*(13*y-h)*(7/13*69^(1/2)+3*(121-
(10*h-20*y)^2/h^2)^(1/2)))
^5/(6243429402941671/13510798882111488*h+11/10*h*acos
(1/11*(10*h-20*y)/h))^3/(121-(10*h-20*y)^2/h^2)^(1/2);
76
77 ym=y-F/D;
78 if (abs(ym-y)<precis)
79 break
80 end
81 y=ym;
82 end
83 Yh=y;
84
85 an=acos(10/13);
86 angu=asin(10/13);
87 ang=acos(10*(h-2*Yh)/(11*h));
88 An=h^2*(2*an-sin(2*an))/18 + 121*h^2*(ang-sin(ang))/400+h*(13*
Yh-h)*(7*sin(an)+33*sin(ang))/(30*26);
89 Pn=2*h*an/3+11*h*ang/10;
90 Tn=h*(33*sin(ang)-13*sin(an))/30;
91 Rn=An/Pn;
92 Vn=Q/An;
93 En=Yh+Vn^2/19.62;
94 NF=Vn/sqrt(9.81*An/Tn);
95
96 if (NF<1)
97 FL=('Subcritico');
98 else
99 FL=('supercritico');
100 end
101
102 set(handles.edit3,'String',real(Yh))
103 set(handles.edit4,'String',real(An))
104 set(handles.edit5,'String',real(Pn))
105 set(handles.edit6,'String',real(Tn))

Ingeniera civil Pag. 15


METODOS NUMERICOS Secciones de Canales

106 set(handles.edit7,'String',real(Rn))
107 set(handles.edit8,'String',real(Vn))
108 set(handles.edit9,'String',real(En))
109 set(handles.edit10,'String',real(NF))
110 set(handles.edit13,'String',FL)
111
112
113
114
115 elseif 12*h/13 < Yh & Yh < h
116
117 while 1
118 an=acos(10/13);
119 angu=asin(10/13);
120 ang=acos(3*y/h-2);
121 A=h^2*(2*an-sin(2*an))/18 + 121*h^2*(2*angu-sin(2*angu))/400+h
^2*sin(an)*22/39+h^2*(2*(an-ang)+sin(2*ang)-sin(2*an))/18;
122 P=2*h*an/3+11*h*angu/5+2*h*(an-ang)/3;
123 T=2*h*sin(ang)/3;
124 F=A^5/P^2-C;
125 D=5/18*(1660256160063512387/6485183463413514240*h^2+22/507*h
^2*69^(1/2)+1/18*h^2*(6243429402941671/4503599627370496-2*
acos(3/h*y-2)+sin(2*acos(3/h*y-2))-20/169*69^(1/2)))
^4/(323300815366218607/135107988821114880*h+2/3*h
*(6243429402941671/9007199254740992-acos(3/h*y-2)))^2*h
^2*(6/h/(1-(3/h*y-2)^2)^(1/2)-6*cos(2*acos(3/h*y-2))/h/(1-
(3/h*y-2)^2)^(1/2))-
4*(1660256160063512387/6485183463413514240*h^2+22/507*h
^2*69^(1/2)+1/18*h^2*(6243429402941671/4503599627370496-2*
acos(3/h*y-2)+sin(2*acos(3/h*y-2))-20/169*69^(1/2)))
^5/(323300815366218607/135107988821114880*h+2/3*h
*(6243429402941671/9007199254740992-acos(3/h*y-2)))^3/(1-
(3/h*y-2)^2)^(1/2);
126
127 ym=y-F/D;
128 if (abs(ym-y)<precis)
129 break
130 end
131 y=ym;
132 end
133 Yh=y;
134
135 an=acos(10/13);
136 angu=asin(10/13);
137 ang=acos(3*Yh/h-2);
138 An=h^2*(2*an-sin(2*an))/18 + 121*h^2*(2*angu-sin(2*angu))/400+h
^2*sin(an)*22/39+h^2*(2*(an-ang)+sin(2*ang)-sin(2*an))/18;
139 Pn=2*h*an/3+11*h*angu/5+2*h*(an-ang)/3;
140 Tn=2*h*sin(ang)/3;
141 Rn=An/Pn;

Ingeniera civil Pag. 16


METODOS NUMERICOS Secciones de Canales

142 Vn=Q/An;
143 En=Yh+Vn^2/19.62;
144 NF=Vn/sqrt(9.81*An/Tn);
145
146 if (NF<1)
147 FL=('Subcritico');
148 else
149 FL=('supercritico');
150 end
151
152 set(handles.edit3,'String',real(Yh))
153 set(handles.edit4,'String',real(An))
154 set(handles.edit5,'String',real(Pn))
155 set(handles.edit6,'String',real(Tn))
156 set(handles.edit7,'String',real(Rn))
157 set(handles.edit8,'String',real(Vn))
158 set(handles.edit9,'String',real(En))
159 set(handles.edit10,'String',real(NF))
160 set(handles.edit13,'String',FL)
161
162
163
164 else
165 errordlg('VALOR FUERA DE RANGO');
166 end

Ingeniera civil Pag. 17


METODOS NUMERICOS Secciones de Canales

1.7 SECCIN N 05

1.7.1. CANAL TIPO OVOIDE

Figura 1.11: Seccin tipo elipse

1.7.2. INTERFAZ DEL CANAL

Figura 1.12: interfaz de resultados de la seccin N05

Ingeniera civil Pag. 18


METODOS NUMERICOS Secciones de Canales

1.7.3. CDIGO FUENTE DE LA SECCIN N05


1.7.3.1. Cdigo fuente para los clculos del canal

1 function pushbutton1_Callback(hObject, eventdata, handles)


2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of
MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5
6 S=str2double(get(handles.edit12,'string'));
7 Q=str2double(get(handles.edit1,'string'));
8 n=str2double(get(handles.edit11,'string'));
9 h=str2double(get(handles.edit2,'string'));
10
11
12 precis=0.001;
13 Yo=0.001;
14 C=((Q*n)/(sqrt(S)))^3;
15
16 y=Yo;
17
18
19 while 1
20 ang=acos(1-2*y/h);
21 A=h^2/8*(2*ang-sin(2*ang));
22 P=h*ang;
23 T=h*sin(ang);
24 F=A^5/P^2-C;
25 D=5/32768*h^8*(2*pi-2*acos(-1+2*y/h)+sin(2*
acos(-1+2*y/h)))^4/(pi-acos(-1+2*y/h))
^2*(4/h/(1-(-1+2*y/h)^2)^(1/2)-4*cos(2*acos
(-1+2*y/h))/h/(1-(-1+2*y/h)^2)^(1/2))-
1/8192*h^7*(2*pi-2*acos(-1+2*y/h)+sin(2*
acos(-1+2*y/h)))^5/(pi-acos(-1+2*y/h))^3/(1
-(-1+2*y/h)^2)^(1/2);
26
27 ym=y-F/D;
28 if (abs(ym-y)<precis)
29 break
30 end
31 y=ym;
32 end
33 Yn=y;
34
35 if 0<Yn & Yn<h
36 ang=acos(1-2*Yn/h);
37 An=h^2/8*(2*ang-sin(2*ang));
38 Pn=h*ang;
39 Tn=h*sin(ang);

Ingeniera civil Pag. 19


METODOS NUMERICOS Secciones de Canales

40 Rn=An/Pn;
41 Vn=Q/An;
42 En=Yn+Vn^2/19.62;
43 NF=Vn/sqrt(9.81*An/Tn);
44 if (NF<1)
45 FL=('subscrito');
46 else
47 FL=('supercritico');
48 end
49 set(handles.edit3,'String',real(Yn))
50 set(handles.edit4,'String',real(An))
51 set(handles.edit5,'String',real(Pn))
52 set(handles.edit6,'String',real(Tn))
53 set(handles.edit7,'String',real(Rn))
54 set(handles.edit8,'String',real(Vn))
55 set(handles.edit9,'String',real(En))
56 set(handles.edit10,'String',real(NF))
57 set(handles.edit13,'String',FL)
58
59 else
60 errordlg('VALOR FUERA DE RANGO');
61 end

1.8 SECCIN N 06

1.8.1. CANAL TIPO PARABLICO

Figura 1.13: Seccin tipo Parablico

1.8.2. INTERFAZ DEL CANAL

Ingeniera civil Pag. 20


METODOS NUMERICOS Secciones de Canales

Figura 1.14: interfaz de resultados de la seccin N06

1.8.3. CDIGO FUENTE DE LA SECCIN N06


1.8.3.1. Cdigo fuente para los clculos del canal

1 function pushbutton1_Callback(hObject, eventdata, handles)


2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of
MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5 S=str2double(get(handles.edit12,'string'));
6 Q=str2double(get(handles.edit1,'string'));
7 n=str2double(get(handles.edit11,'string'));
8 h=str2double(get(handles.edit2,'string'));
9
10
11 precis=0.001;
12 Yo=0.001;
13 C=((Q*n)/(sqrt(S)))^3;
14
15 y=Yo;
16
17 while 1
18 angulo=acos(((h/2)-y)/(h/2));
19 A=(h/2)^2*(2*angulo-sin(2*angulo))/2;
20 P=angulo*h;
21 T=h*sin(angulo);
22 F=A^5/P^2-C;
23 D=5/32768*h^8*(2*acos(2*(1/2*h-y)/h)-sin(2*acos(2*(1/2*h-y)/h)
))^4/acos(2*(1/2*h-y)/h)^2*(4/h/(1-4*(1/2*h-y)^2/h^2)^(1/2)

Ingeniera civil Pag. 21


METODOS NUMERICOS Secciones de Canales

-4*cos(2*acos(2*(1/2*h-y)/h))/h/(1-4*(1/2*h-y)^2/h^2)^(1/2)
)-1/8192*h^7*(2*acos(2*(1/2*h-y)/h)-sin(2*acos(2*(1/2*h-y)/
h)))^5/acos(2*(1/2*h-y)/h)^3/(1-4*(1/2*h-y)^2/h^2)^(1/2);
24 ym=y-F/D;
25 if (abs(ym-y)<precis)
26 break
27 end
28 y=ym;
29 end
30 Yn=y;
31
32 while 1
33
34 A=((h/2)^2)*pi/2+((y-h/2)*h);
35 P=pi*h/2+2*(y-h/2);
36 T=h;
37 F=A^5/P^2-C;
38 D=5*(1/8*h^2*pi+(-1/2*h+y)*h)^4/(1/2*pi*h-h+2*y)^2*h-
4*(1/8*h^2*pi+(-1/2*h+y)*h)^5/(1/2*pi*h-h+2*y)^3;
39 ym=y-F/D;
40 if (abs(ym-y)<precis)
41 break
42 end
43 y=ym;
44 end
45 Yn1=y;
46
47
48
49 if 0<Yn & Yn h/2
50 angulo=acos(((h/2)-Yn)/(h/2));
51 An=(h/2)^2*(2*angulo-sin(2*angulo))/2;
52 Pn=angulo*h;
53 Tn=h*sin(angulo);
54 Rn=An/Pn;
55 Vn=Q/An;
56 En=Yn+Vn^2/19.62;
57 NF=Vn/sqrt(9.81*An/Tn);
58 if (NF<1)
59 FL=('Subcritico');
60 else
61 FL=('supercritico');
62 end
63 set(handles.edit3,'String',real(Yn))
64 set(handles.edit4,'String',real(An))
65 set(handles.edit5,'String',real(Pn))
66 set(handles.edit6,'String',real(Tn))
67 set(handles.edit7,'String',real(Rn))
68 set(handles.edit8,'String',real(Vn))
69 set(handles.edit9,'String',real(En))

Ingeniera civil Pag. 22


METODOS NUMERICOS Secciones de Canales

70 set(handles.edit10,'String',real(NF))
71 set(handles.edit13,'String',FL)
72
73
74
75
76
77
78 elseif h/2<Yn1 & Yn1 h
79
80 An1=((h/2)^2)*pi/2+((Yn1-h/2))*h;
81 Pn1=pi*h/2+2*(Yn1-h/2);
82 Tn1=h;
83 Rn1=An1/Pn1;
84 Vn1=Q/An1;
85 En1=Yn1+Vn1^2/19.62;
86 NF1=Vn1/sqrt(9.81*An1/Tn1);
87 if (NF1<1)
88 FL1=('Subcritico');
89 else
90 FL1=('supercritico');
91 end
92 set(handles.edit3,'String',real(Yn1))
93 set(handles.edit4,'String',real(An1))
94 set(handles.edit5,'String',real(Pn1))
95 set(handles.edit6,'String',real(Tn1))
96 set(handles.edit7,'String',real(Rn1))
97 set(handles.edit8,'String',real(Vn1))
98 set(handles.edit9,'String',real(En1))
99 set(handles.edit10,'String',real(NF1))
100 set(handles.edit13,'String',FL1)
101
102
103
104 else
105 disp('VALOR FUERA DE RANGO')
106
107 end

Ingeniera civil Pag. 23


METODOS NUMERICOS Secciones de Canales

1.9 SECCIN N 07

1.9.1. CANAL TIPO BVEDA

Figura 1.15: Seccin tipo bveda

1.9.2. INTERFAZ DEL CANAL

Figura 1.16: interfaz de resultados de la seccin N07

Ingeniera civil Pag. 24


METODOS NUMERICOS Secciones de Canales

1.9.3. CDIGO FUENTE DE LA SECCIN N07


1.9.3.1. Cdigo fuente para los clculos del canal

1 function pushbutton1_Callback(hObject, eventdata, handles)


2 % hObject handle to pushbutton1 (see GCBO)
3 % eventdata reserved - to be defined in a future version of
MATLAB
4 % handles structure with handles and user data (see GUIDATA)
5
6 S=str2double(get(handles.edit12,'string'));
7 Q=str2double(get(handles.edit1,'string'));
8 n=str2double(get(handles.edit11,'string'));
9 h=str2double(get(handles.edit2,'string'));
10
11
12 precis=0.001;
13 Yo=0.001;
14 C=((Q*n)/(sqrt(S)))^3;
15 y=Yo;
16
17 while 1
18 angulo=acos((h-y)/h);
19 A=h^2*(2*angulo-sin(2*angulo))/2;
20 P=2*angulo*h;
21 T=2*h*sin(angulo);
22 F=A^5/P^2-C;
23 D=5/128*h^8*(2*acos((h-y)/h)-sin(2*acos((h-y)/h)))^4/acos((h-y
)/h)^2*(2/h/(1-(h-y)^2/h^2)^(1/2)-2*cos(2*acos((h-y)/h))/h
/(1-(h-y)^2/h^2)^(1/2))-1/64*h^7*(2*acos((h-y)/h)-sin(2*
acos((h-y)/h)))^5/acos((h-y)/h)^3/(1-(h-y)^2/h^2)^(1/2);
24 ym=y-F/D;
25 if (abs(ym-y)<precis)
26 break
27 end
28 y=ym;
29 end
30 Yn=y;
31
32 while 1
33 angulo=pi/6;
34 A=h^2*((pi/6)-(3^0.5)/4)+(y-h*(1-(3^0.5)/2))*h;
35 P=2*y-2*h*(1-(3^0.5)/2)+pi*h/3;
36 T=h;
37 F=A^5/P^2-C;
38 D=5*(50995425973457/562949953421312*h^2+(y-
603367941593515/4503599627370496*h)*h)^4/(2*y-
603367941593515/2251799813685248*h+1/3*pi*h)^2*h-
4*(50995425973457/562949953421312*h^2+(y-
603367941593515/4503599627370496*h)*h)^5/(2*y-

Ingeniera civil Pag. 25


METODOS NUMERICOS Secciones de Canales

603367941593515/2251799813685248*h+1/3*pi*h)^3;
39 ym=y-F/D;
40 if (abs(ym-y)<precis)
41 break
42 end
43 y=ym;
44 end
45 Yn1=y;
46
47 while 1
48 angulo2=acos((2*y-h)/h);
49 A=h^2*(pi/6+(3^0.5)/4-1/2+pi/8-1/8*(2*angulo2-sin(2*angulo2)))
;
50 P=h/2*(pi-2*angulo2)+h*((3^0.5)-1)+h*pi/3;
51 T=h*sin(angulo2);
52 F=A^5/P^2-C;
53 D=5*h^10*(3824954717886499/4503599627370496-1/4*acos((2*y-h)/h
)+1/8*sin(2*acos((2*y-h)/h)))^4/(1/2*h*(pi-2*acos((2*y-h)/h
))+1648431872091733/2251799813685248*h+1/3*h*pi)^2*(1/2/h
/(1-(2*y-h)^2/h^2)^(1/2)-1/2*cos(2*acos((2*y-h)/h))/h/(1-
(2*y-h)^2/h^2)^(1/2))-4*h
^10*(3824954717886499/4503599627370496-1/4*acos((2*y-h)/h)
+1/8*sin(2*acos((2*y-h)/h)))^5/(1/2*h*(pi-2*acos((2*y-h)/h)
)+1648431872091733/2251799813685248*h+1/3*h*pi)^3/(1-(2*y-h
)^2/h^2)^(1/2);
54 ym=y-F/D;
55 if (abs(ym-y)<precis)
56 break
57 end
58 y=ym;
59 end
60 Yn2=y;
61
62
63 if 0<Yn & Yn h*(1-(3^0.5)/2)
64 angulo=acos((h-Yn)/h);
65 An=h^2*(2*angulo-sin(2*angulo))/2;
66 Pn=2*angulo*h;
67 Tn=2*h*sin(angulo);
68 Rn=An/Pn;
69 Vn=Q/An;
70 En=Yn+Vn^2/19.62;
71 NF=Vn/sqrt(9.81*An/Tn);
72 if (NF<1)
73 FL=('Subcritico');
74 else
75 FL=('supercritico');
76 end
77
78 set(handles.edit3,'String',real(Yn))

Ingeniera civil Pag. 26


METODOS NUMERICOS Secciones de Canales

79 set(handles.edit4,'String',real(An))
80 set(handles.edit5,'String',real(Pn))
81 set(handles.edit6,'String',real(Tn))
82 set(handles.edit7,'String',real(Rn))
83 set(handles.edit8,'String',real(Vn))
84 set(handles.edit9,'String',real(En))
85 set(handles.edit10,'String',real(NF))
86 set(handles.edit13,'String',FL)
87
88
89
90 elseif h*(1-(3^0.5)/2)<Yn1 & Yn1 h/2
91 angulo=pi/6;
92 An1=h^2*((pi/6)-(3^0.5)/4)+(Yn1-h*(1-(3^0.5)/2))*h;
93 Pn1=2*Yn1-2*h*(1-(3^0.5)/2)+pi*h/3;
94 Tn1=h;
95 Rn1=An1/Pn1;
96 Vn1=Q/An1;
97 En1=Yn1+Vn1^2/19.62;
98 NF1=Vn1/sqrt(9.81*An1/Tn1);
99 if (NF1<1)
100 FL1=('Subcritico');
101 else
102 FL1=('supercritico');
103 end
104 set(handles.edit3,'String',real(Yn1))
105 set(handles.edit4,'String',real(An1))
106 set(handles.edit5,'String',real(Pn1))
107 set(handles.edit6,'String',real(Tn1))
108 set(handles.edit7,'String',real(Rn1))
109 set(handles.edit8,'String',real(Vn1))
110 set(handles.edit9,'String',real(En1))
111 set(handles.edit10,'String',real(NF1))
112 set(handles.edit13,'String',FL1)
113
114
115
116
117 elseif h/2<Yn2 & Yn2 h
118 angulo2=acos((2*Yn2-h)/h);
119 An2=h^2*(pi/6+(3^0.5)/4-1/2+pi/8-1/8*(2*angulo2-sin(2*angulo2))
);
120 Pn2=h/2*(pi-2*angulo2)+h*((3^0.5)-1)+h*pi/3;
121 Tn2=h*sin(angulo2);
122 Rn2=An2/Pn2;
123 Vn2=Q/An2;
124 En2=Yn2+Vn2^2/19.62;
125 NF2=Vn2/sqrt(9.81*An2/Tn2);
126
127 if (NF2<1)

Ingeniera civil Pag. 27


METODOS NUMERICOS Secciones de Canales

128 FL2=('Subcritico');
129 else
130 FL2=('supercritico');
131 end
132 set(handles.edit3,'String',real(Yn2))
133 set(handles.edit4,'String',real(An2))
134 set(handles.edit5,'String',real(Pn2))
135 set(handles.edit6,'String',real(Tn2))
136 set(handles.edit7,'String',real(Rn2))
137 set(handles.edit8,'String',real(Vn2))
138 set(handles.edit9,'String',real(En2))
139 set(handles.edit10,'String',real(NF2))
140 set(handles.edit13,'String',FL2)
141
142
143
144 else h<Yn2
145 errordlg('VALOR FUERA DE RANGO');
146 end

Ingeniera civil Pag. 28

You might also like