SlideShare a Scribd company logo
1 of 15
Download to read offline
PYTHON PARA INGENIERIA - CANALES ABIERTOS
METODO DE NEWTHON RAPHSON:
ECUACION DE MANNING
ECUACION PARA EL METODO DE NEWTON RAPHSON
ECUACIONES PARA CANAL TRAPEZOIDAL
AREA ->
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
1 of 15 3/13/2018, 3:15 PM
PERIMETRO->
DERIVANDO EL AREA RESPECTO A y:
DERIVANDO EL PERIMETRO RESPECTO A y:
DONDE:
B = ANCHO DE BASE DEL CANAL
Z1 = PENDIENTE IZQUIERDA DE LA SECCION DEL CANAL
Z2 = PENDIENTE DERECHA DE LA SECCION DEL CANAL
yi = TIRANTE NORMAL A CALCULAR
In [3]: import math
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
2 of 15 3/13/2018, 3:15 PM
In [1]: def trapezoidal(q, b, z1, z2, s, n):
"""
|Retorna una lista con
| - Tirante Normal de la seccion
| - Area hidráulica de la seccion
| - Perímetro mojado
| - Radio Hidráulico
| - Espejo de agua
| - Tirante medio
| - Velocidad media
| - Energía
| - Radio Hidráulico
| - Espejo de agua
| - Tirante medio
| - Velocidad media
| - Energía
| - Numero de Froude
|Entrada de Datos:
| q(m3/s) -> Caudal circulante por el canal
| s -> Pendi☺ente del canal
| n -> Coeficiente de manning
| z1 -> Pendiente izquierda de la seccion del canal
| z2 -> Pendiente derecha de la seccion del canal
| b -> Longitud de base del canal
|Ejemplo:
| >>> seccion_trapezoidal = trapezoidal(0.5, 0.5, 1, 1, 0.01, 0.014)
| >>> print(seccion_trapezoidal)
| >>> (0.28720341374388053, 0.2260875077380789, 1.3123339257528945, 0
.1722789476835105,
| 1.0744068274877612, 0.21043007355670804, 0.5365684383574587, 2
.2115330696610056, 1.5394970620863067)
"""
cte = q*n/s**0.5
yi = 1
yf = 2
error = 0.000000001
cont = 1
while abs(yi-yf) > error:
print("Iteración: ", cont)
yi = yf
area = b*yi + z1*yi**2/2 + z2*yi**2/2
perimeter = b + yi*(z1**2+1)**0.5 + yi*(z2**2+1)**0.5
fy = area**(5/3)/perimeter**(2/3)-cte
d_area = b + z1 * yi + z2 * yi
d_perimeter = (z1**2+1)**0.5 + (z2**2+1)**0.5
dfy = 5*area**(2/3) / perimeter**(2/3) * d_area / 3 - 2 * area**(
5/3) / perimeter**(5/3) * d_perimeter / 3
yf = yi - fy/dfy
cont += 1
if cont > 40:
break
print("yf=", yf)
print("error: ", abs(yf-yi))
a = b*yf + z1*yf**2/2 + z2*yf**2/2
p = b + yf*(z1**2+1)**0.5 + yf*(z2**2+1)**0.5
r = a/p
t = b+z1*yf+z2*yf
ym = a/t
v = q/a
e = yf + v**2/(2*9.806665)
froude = v/(9.806665*a/t)**0.5
return yf, a, p, r, t, ym, e, v, froude
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
3 of 15 3/13/2018, 3:15 PM
In [3]: seccion_trapezoidal = trapezoidal(0.5, 0.5, 1, 1, 0.01, 0.014)
In [4]: print(seccion_trapezoidal)
ECUACIONES PARA CANAL CIRCULAR
Iteración: 1
yf= 1.1757678260211835
error: 0.8242321739788165
Iteración: 2
yf= 0.6835237825717543
error: 0.4922440434494292
Iteración: 3
yf= 0.41666557810687294
error: 0.26685820446488134
Iteración: 4
yf= 0.30840080977437995
error: 0.10826476833249299
Iteración: 5
yf= 0.2879311733654157
error: 0.020469636408964265
Iteración: 6
yf= 0.2872043201745382
error: 0.0007268531908775078
Iteración: 7
yf= 0.28720341374528957
error: 9.064292486038461e-07
Iteración: 8
yf= 0.28720341374388053
error: 1.4090395517030174e-12
(0.28720341374388053, 0.2260875077380789, 1.3123339257528945, 0.1722789
476835105, 1.0744068274877612, 0.21043007355670804, 0.5365684383574587,
2.2115330696610056, 1.5394970620863067)
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
4 of 15 3/13/2018, 3:15 PM
AREA ->
PERIMETRO ->
DERIVANDO EL AREA RESPECTO A ->
DERIVANDO EL PERIMETRO RESPECTO A ->
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
5 of 15 3/13/2018, 3:15 PM
In [1]: def circle(q, d, s, n):
"""
|Retorna una lista con
| - Tirante Normal de la seccion
| - Area hidráulica de la seccion
| - Perímetro mojado
| - Radio Hidráulico
| - Espejo de agua
| - Tirante medio
| - Velocidad media
| - Energía
| - Numero de Froude
| q(m3/s) -> Caudal circulante por el canal
| d -> Longitud del diámetro de la sección
| s -> Pendiente del canal
| n -> Coeficiente de manning
|Ejemplo:
| >>> seccion_circular = circle(0.5, 1.3, 0.001, 0.014)
| >>> print(seccion_circular)
| >>> (0.5332481279157819, 0.5127041358149504, 1.8072573165180572,
| 0.28369183022744604, 1.2788573030089485, 0.4009080095243143,
| 0.5817384458469715, 0.9752213120053009, 0.49183581132307763)
"""
cte = q * n / s ** 0.5
yi = math.pi-0.01
yf = yi+0.01
if q > d/2:
yi = math.pi * 1.95 - 0.01
yf = math.pi * 1.95
error = 0.000000001
cont = 1
while abs(yi - yf) > error:
print("Iteración: ", cont)
yi = yf
area = d**2*(yi-math.sin(yi))/8
perimeter = yi*d/2
fy = area ** (5 / 3) / perimeter ** (2 / 3) - cte
d_area = d**2*(1-math.cos(yi))/8
d_perimeter = d/2
dfy = 5 * area ** (2 / 3) / perimeter ** (2 / 3) * d_area / 3 - 2
* area ** (5 / 3) / perimeter ** (
5 / 3) * d_perimeter / 3
yf = yi - fy / dfy
cont += 1
if cont > 40 or area > (math.pi*d**2/4):
break
print("yf=", yf)
print("error: ", abs(yf - yi))
if area < (math.pi*d**2/4):
h = d*(1-math.cos(yf/2))/2
a = d**2*(yi-math.sin(yi))/8
p = yi*d/2
r = a / p
t = d*math.sin(yf/2)
ym = a / t
v = q / a
e = h + v ** 2 / (2 * 9.806665)
froude = v / (9.806665 * a / t) ** 0.5
return h, a, p, r, t, ym, e, v, froude
else:
return 'Error'
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
6 of 15 3/13/2018, 3:15 PM
In [4]: seccion_circular = circle(0.5, 1.3, 0.001, 0.014)
In [5]: print(seccion_circular)
ECUACIONES PARA CANAL PARABÓLICO
Iteración: 1
yf= 2.7947684239726702
error: 0.3468242296171229
Iteración: 2
yf= 2.7804381906696047
error: 0.014330233303065487
Iteración: 3
yf= 2.780395871566242
error: 4.23191033629422e-05
Iteración: 4
yf= 2.7803958711917014
error: 3.745403986954443e-10
(0.5332481279157819, 0.5127041358149504, 1.8072573165180572, 0.28369183
022744604, 1.2788573030089485, 0.4009080095243143, 0.5817384458469715,
0.9752213120053009, 0.49183581132307763)
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
7 of 15 3/13/2018, 3:15 PM
AREA ->
DERIVANDO EL AREA RESPECTO A ->
SI
PERIMETRO ->
DERIVANDO EL PERIMETRO RESPECTO A ->
SI
PERIMETRO ->
DERIVANDO EL PERIMETRO RESPECTO A ->
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
8 of 15 3/13/2018, 3:15 PM
In [8]: def parabolic(q, t, s, n):
cte = q * n / s ** 0.5
yi = 1
yf = 2
error = 0.000000001
cont = 1
while abs(yi - yf) > error:
print("Iteración: ", cont)
yi = yf
area = 2*t*yi/3
d_area = 2*t/3
perimeter = 0
d_perimeter = 0
if yi/t <= 0.25:
perimeter = t + 8*yi**2/(3*t)
d_perimeter = 16*yi/(3*t)
elif yi/t > 0.25:
x = 4*yi/t
dx = 4/t
perimeter = 0.5*t*((1+x**2)**0.5+math.log(x+(1+x**2)**0.5)/x)
d_perimeter = 0.5*t*(x/(1+x**2)**0.5+1/(x*(1+x**2)**0.5)-math
.log(x+(1+x**2)**0.5)/x**2)*dx
fy = area ** (5 / 3) / perimeter ** (2 / 3) - cte
dfy = 5 * area ** (2 / 3) / perimeter ** (2 / 3) * d_area / 3 - 2
* area ** (5 / 3) / perimeter ** (
5 / 3) * d_perimeter / 3
yf = yi - fy / dfy
cont += 1
if cont > 40:
break
print("yf=", yf)
print("error: ", abs(yf - yi))
a = 2*t*yf/3
p = 0
if yi / t <= 0.25:
p = t + 8 * yf ** 2 / (3 * t)
elif yi / t > 0.25:
x = 4 * yf / t
p = 0.5 * t * ((1 + x ** 2) ** 0.5 + math.log(x + (1 + x ** 2) **
0.5) / x)
r = a / p
ym = a / t
v = q / a
e = yf + v ** 2 / (2 * 9.806665)
froude = v / (9.806665 * a / t) ** 0.5
return yf, a, p, r, ym, e, v, froude
In [9]: para = parabolic(1.5, 1.0, 0.01, 0.014)
print(para)
Iteración: 1
yf= 0.7463737949066422
error: 1.2536262050933578
Iteración: 2
yf= 0.76054974826516
error: 0.014175953358517734
Iteración: 3
yf= 0.7605484112206655
error: 1.3370444944538207e-06
Iteración: 4
yf= 0.7605484112206562
error: 9.325873406851315e-15
(0.7605484112206562, 0.5070322741471042, 1.902217044788166, 0.266548065
86677815, 0.5070322741471042, 1.2067796537800057, 2.9583915590446384, 1
.32671360454801)
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
9 of 15 3/13/2018, 3:15 PM
ECUACIONES PARA CANAL NATURAL
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
10 of 15 3/13/2018, 3:15 PM
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
11 of 15 3/13/2018, 3:15 PM
AREA ->
DERIVANDO EL AREA RESPECTO A ->
PERIMETRO ->
DERIVANDO EL PERIMETRO RESPECTO A ->
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
12 of 15 3/13/2018, 3:15 PM
In [1]: def coord_yn(c, yn):
if max_matrix(c)[1] > (yn + min_matrix(c)[1]):
c_1 = []
for i in range(len(c)):
if c[i][1] <= (yn + min_matrix(c)[1]):
c_1.append(c[i])
c_1.insert(0, c[c.index(c_1[0]) - 1])
c_1.append(c[c.index(c_1[len(c_1) - 1]) + 1])
return c_1
else:
return c
In [2]: def min_matrix(c):
return min([i[0] for i in c]), min([i[1] for i in c])
def max_matrix(c):
return max([i[0] for i in c]), max([i[1] for i in c])
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
13 of 15 3/13/2018, 3:15 PM
In [14]: def natural(c, q, s, n):
cte = q * n / s ** 0.5
yi = (max_matrix(c)[1] - min_matrix(c)[1]) / 1.05
yf = yi + 0.01
error = 0.0000000001
cont = 1
y_min = min_matrix(c)[1]
while abs(yi - yf) > error:
yi = yf
area = 0
perimeter = 0
d_area = 0
c_1 = coord_yn(c, yi)
n_c = len(c_1)
for i in range(1, n_c - 2):
area += (yi + y_min) * (c_1[i + 1][0] - c_1[i][0]) - (c_1[i +
1][i] + c_1[i][1]) * (
c_1[i + 1][0] - c_1[i][0]) / 2
perimeter += ((c_1[i + 1][0] - c_1[i][0]) ** 2 + (c_1[i + 1][
1] - c_1[i][1]) ** 2) ** 0.5
d_area += c_1[i + 1][0] - c_1[i][0]
area = area - ((y_min + yi - c_1[1][1]) ** 2 / 2) * (c_1[1][0] -
c_1[0][0]) / (c_1[1][1] - c_1[0][1]) + (
(y_min + yi - c_1[n_c - 2][1]) ** 2 / 2) * (c_1[n_c - 1][
0] - c_1[n_c - 2][0]) / (
c_1[n_c - 1][1] - c_1[n_c - 2][1])
perimeter = perimeter + (yi + y_min - c_1[1][1]) * (
1 + ((c_1[1][0] - c_1[0][0]) / (c_1[1][1] - c_1[0][1])) *
* 2) ** 0.5 + (
yi + y_min - c_1[n_c - 2][1]) * (
1 + ((c_1[n_c - 1][0] - c_1[n_c - 2][0]) / (c
_1[n_c - 1][1] - c_1[n_c - 2][1])) ** 2) ** 0.5
d_area = d_area - (yi+y_min-c_1[1][1])*(c_1[1][0]-c_1[0][0])/(c_1
[1][1]-c_1[0][1]) + (yi+y_min-c_1[n_c-2][1])*(
c_1[n_c-1][0]-c_1[n_c-2][0])/(c_1[n_c-1][1]-c_1[n_c-2][1])
d_perimeter = (1+((c_1[1][0]-c_1[0][0])/(c_1[1][1]-c_1[0][1]))**2
)**0.5 + (1+(
(c_1[n_c-1][0]-c_1[n_c-2][0])/(c_1[n_c-1][1]-c_1[n_c-2][1
])))**0.5
fy = area ** (5 / 3) / perimeter ** (2 / 3) - cte
dfy = 5 * area ** (2 / 3) / perimeter ** (2 / 3) * d_area / 3 - 2
* area ** (5 / 3) / perimeter ** (
5 / 3) * d_perimeter / 3
yf = yi - fy / dfy
if yf>(max_matrix(c)[1]-min_matrix(c)[1]):
yf = 'Error'
break
if cont > 40:
yf = 'Error'
break
cont += 1
if yf != 'Error':
area = 0
perimeter = 0
d_area = 0
c_1 = coord_yn(c, yf)
n_c = len(c_1)
for i in range(1, n_c - 2):
area += (yf + y_min) * (c_1[i + 1][0] - c_1[i][0]) - (c_1[i +
1][i] + c_1[i][1]) * (
c_1[i + 1][0] - c_1[i][0]) / 2
perimeter += ((c_1[i + 1][0] - c_1[i][0]) ** 2 + (c_1[i + 1][
1] - c_1[i][1]) ** 2) ** 0.5
d_area += c_1[i + 1][0] - c_1[i][0]
area = area - ((y_min + yf - c_1[1][1]) ** 2 / 2) * (c_1[1][0] -
c_1[0][0]) / (c_1[1][1] - c_1[0][1]) + (
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
14 of 15 3/13/2018, 3:15 PM
In [16]: c = [[0,1],[1,0.25],[2,0],[3,1]]
nat = natural(c, 1.5, 0.01, 0.025)
print("yf=", nat[0])
print("area=", nat[1])
print("perimeter=", nat[2])
print("rh=", nat[3])
print("ta=", nat[4])
print("ym o yh=", nat[5])
print("energy=", nat[6])
print("velocity=", nat[7])
print("froude=", nat[8])
yf= 0.634691104739465
area= 0.8097656680009463
perimeter= 2.569517015876971
rh= 0.3151431428542515
ta= 2.1476125777254182
ym o yh= 0.37705388597536815
energy= 0.8096405069611481
velocity= 1.8523877453375155
froude= 0.9633176526809352
CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html
15 of 15 3/13/2018, 3:15 PM

More Related Content

What's hot

diseño de pequeñas presas 2
diseño de pequeñas presas 2diseño de pequeñas presas 2
diseño de pequeñas presas 2Carlos Rovello
 
Curvas de remanso-tramo fijos
Curvas de remanso-tramo fijosCurvas de remanso-tramo fijos
Curvas de remanso-tramo fijosAlejandro Cabrera
 
Solucionario -mecanica_de_fluidos_e_hidraulica sotelo
Solucionario  -mecanica_de_fluidos_e_hidraulica soteloSolucionario  -mecanica_de_fluidos_e_hidraulica sotelo
Solucionario -mecanica_de_fluidos_e_hidraulica soteloRubí Morales de Masaki
 
296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...
296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...
296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...Leo Suca Yunga
 
Flujo rapidamente variado
Flujo rapidamente variadoFlujo rapidamente variado
Flujo rapidamente variadoLuis Morales
 
2. problemas resueltos propiedades geométricas (1)
2. problemas resueltos propiedades geométricas (1)2. problemas resueltos propiedades geométricas (1)
2. problemas resueltos propiedades geométricas (1)Daniela Sepulveda
 
Hidraulica de canales fundamentos y ejercicios
Hidraulica de canales fundamentos y ejerciciosHidraulica de canales fundamentos y ejercicios
Hidraulica de canales fundamentos y ejerciciosjair silva peña
 
Asentamiento y consolidación de suelos
Asentamiento y consolidación de suelosAsentamiento y consolidación de suelos
Asentamiento y consolidación de suelosdiegoupt
 
Metodos probabilisticos de Hidrologia
Metodos probabilisticos de HidrologiaMetodos probabilisticos de Hidrologia
Metodos probabilisticos de HidrologiaFreddy Svv
 
14.01 curvas verticales ejemplo de calculo 2012
14.01 curvas verticales ejemplo de calculo 201214.01 curvas verticales ejemplo de calculo 2012
14.01 curvas verticales ejemplo de calculo 2012Ronald Cotera Barrios
 

What's hot (20)

diseño de pequeñas presas 2
diseño de pequeñas presas 2diseño de pequeñas presas 2
diseño de pequeñas presas 2
 
Curvas de remanso-tramo fijos
Curvas de remanso-tramo fijosCurvas de remanso-tramo fijos
Curvas de remanso-tramo fijos
 
RESALTO HIDRAULICO
RESALTO HIDRAULICORESALTO HIDRAULICO
RESALTO HIDRAULICO
 
SUELOS 1
SUELOS 1SUELOS 1
SUELOS 1
 
Resalto hidrúlico
Resalto hidrúlicoResalto hidrúlico
Resalto hidrúlico
 
Fpu y diseño de canales
Fpu y diseño de canalesFpu y diseño de canales
Fpu y diseño de canales
 
Solucionario -mecanica_de_fluidos_e_hidraulica sotelo
Solucionario  -mecanica_de_fluidos_e_hidraulica soteloSolucionario  -mecanica_de_fluidos_e_hidraulica sotelo
Solucionario -mecanica_de_fluidos_e_hidraulica sotelo
 
296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...
296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...
296505932 271698208-solucionario-problema-4-james-cardenas-diseno-geometrico-...
 
Problemas resueltos hidrologia
Problemas resueltos hidrologiaProblemas resueltos hidrologia
Problemas resueltos hidrologia
 
FORMULARIO - MECANICA DE SUELOS
FORMULARIO - MECANICA DE SUELOSFORMULARIO - MECANICA DE SUELOS
FORMULARIO - MECANICA DE SUELOS
 
Ensayo triaxial consolidado drenado (cd)
Ensayo triaxial consolidado drenado (cd)Ensayo triaxial consolidado drenado (cd)
Ensayo triaxial consolidado drenado (cd)
 
Flujo rapidamente variado
Flujo rapidamente variadoFlujo rapidamente variado
Flujo rapidamente variado
 
Terreno de fundacion 2
Terreno de fundacion 2Terreno de fundacion 2
Terreno de fundacion 2
 
2. problemas resueltos propiedades geométricas (1)
2. problemas resueltos propiedades geométricas (1)2. problemas resueltos propiedades geométricas (1)
2. problemas resueltos propiedades geométricas (1)
 
Hidraulica de canales fundamentos y ejercicios
Hidraulica de canales fundamentos y ejerciciosHidraulica de canales fundamentos y ejercicios
Hidraulica de canales fundamentos y ejercicios
 
Asentamiento y consolidación de suelos
Asentamiento y consolidación de suelosAsentamiento y consolidación de suelos
Asentamiento y consolidación de suelos
 
Metodos probabilisticos de Hidrologia
Metodos probabilisticos de HidrologiaMetodos probabilisticos de Hidrologia
Metodos probabilisticos de Hidrologia
 
14.01 curvas verticales ejemplo de calculo 2012
14.01 curvas verticales ejemplo de calculo 201214.01 curvas verticales ejemplo de calculo 2012
14.01 curvas verticales ejemplo de calculo 2012
 
Diseño de canales
Diseño de canalesDiseño de canales
Diseño de canales
 
Ensayo de corte directo
Ensayo  de corte directoEnsayo  de corte directo
Ensayo de corte directo
 

Similar to HIDRAULICA DE CANALES

Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABCOMSATS Abbottabad
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfWaleedHussain30
 
Solution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 IntegrationSolution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 IntegrationHareem Aslam
 
Cálculo ii howard anton - capítulo 16 [tópicos do cálculo vetorial]
Cálculo ii   howard anton - capítulo 16 [tópicos do cálculo vetorial]Cálculo ii   howard anton - capítulo 16 [tópicos do cálculo vetorial]
Cálculo ii howard anton - capítulo 16 [tópicos do cálculo vetorial]Henrique Covatti
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)Maho Nakata
 
Solution shigley's
Solution shigley'sSolution shigley's
Solution shigley'sAlemu Abera
 
Shigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th editionShigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th editionLuis Eduin
 
Econometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions ManualEconometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions ManualLewisSimmonss
 
Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...
Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...
Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...4bh7qsqvyb
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsAmos Tsai
 
Solution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsSolution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsHareem Aslam
 
Triangles can Equal Circles, it's all in hour you add them up.
Triangles can Equal Circles, it's all in hour you add them up.Triangles can Equal Circles, it's all in hour you add them up.
Triangles can Equal Circles, it's all in hour you add them up.Leland Bartlett
 
A Triangle can Equal a Circle, it's all in how you add them up.
A Triangle can Equal a Circle, it's all in how you add them up.A Triangle can Equal a Circle, it's all in how you add them up.
A Triangle can Equal a Circle, it's all in how you add them up.Leland Bartlett
 
TC74VCX244FT PSpice Model (Free SPICE Model)
TC74VCX244FT PSpice Model (Free SPICE Model)TC74VCX244FT PSpice Model (Free SPICE Model)
TC74VCX244FT PSpice Model (Free SPICE Model)Tsuyoshi Horigome
 

Similar to HIDRAULICA DE CANALES (20)

Examen final
Examen finalExamen final
Examen final
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
 
Solution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 IntegrationSolution Manual : Chapter - 05 Integration
Solution Manual : Chapter - 05 Integration
 
Gilat_ch03.pdf
Gilat_ch03.pdfGilat_ch03.pdf
Gilat_ch03.pdf
 
Cálculo ii howard anton - capítulo 16 [tópicos do cálculo vetorial]
Cálculo ii   howard anton - capítulo 16 [tópicos do cálculo vetorial]Cálculo ii   howard anton - capítulo 16 [tópicos do cálculo vetorial]
Cálculo ii howard anton - capítulo 16 [tópicos do cálculo vetorial]
 
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
quantum chemistry on quantum computer handson by Q# (2019/8/4@MDR Hongo, Tokyo)
 
Solution shigley's
Solution shigley'sSolution shigley's
Solution shigley's
 
Shigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th editionShigley 13830681 solution mechanical engineering design shigley 7th edition
Shigley 13830681 solution mechanical engineering design shigley 7th edition
 
Gilat_ch05.pdf
Gilat_ch05.pdfGilat_ch05.pdf
Gilat_ch05.pdf
 
Econometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions ManualEconometric Analysis 8th Edition Greene Solutions Manual
Econometric Analysis 8th Edition Greene Solutions Manual
 
Fusion_Class
Fusion_ClassFusion_Class
Fusion_Class
 
Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...
Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...
Modern power system analysis. By D.P. and Nagrath, I.J., 2003. Tata McGraw-Hi...
 
Numerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special FunctionsNumerical Algorithm for a few Special Functions
Numerical Algorithm for a few Special Functions
 
DC servo motor
DC servo motorDC servo motor
DC servo motor
 
Solution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 FunctionsSolution Manual : Chapter - 01 Functions
Solution Manual : Chapter - 01 Functions
 
Gilat_ch01.pdf
Gilat_ch01.pdfGilat_ch01.pdf
Gilat_ch01.pdf
 
Triangles can Equal Circles, it's all in hour you add them up.
Triangles can Equal Circles, it's all in hour you add them up.Triangles can Equal Circles, it's all in hour you add them up.
Triangles can Equal Circles, it's all in hour you add them up.
 
A Triangle can Equal a Circle, it's all in how you add them up.
A Triangle can Equal a Circle, it's all in how you add them up.A Triangle can Equal a Circle, it's all in how you add them up.
A Triangle can Equal a Circle, it's all in how you add them up.
 
TC74VCX244FT PSpice Model (Free SPICE Model)
TC74VCX244FT PSpice Model (Free SPICE Model)TC74VCX244FT PSpice Model (Free SPICE Model)
TC74VCX244FT PSpice Model (Free SPICE Model)
 

More from Dennis Ventura Huaman

More from Dennis Ventura Huaman (8)

Clase 3 - OpenFoam
Clase 3 - OpenFoamClase 3 - OpenFoam
Clase 3 - OpenFoam
 
CURSO OPENFOAM
CURSO OPENFOAMCURSO OPENFOAM
CURSO OPENFOAM
 
WaterHID - Gradiente Hidráulico con Python3
WaterHID - Gradiente Hidráulico con Python3WaterHID - Gradiente Hidráulico con Python3
WaterHID - Gradiente Hidráulico con Python3
 
PROGRAMACION PYQT5
PROGRAMACION PYQT5PROGRAMACION PYQT5
PROGRAMACION PYQT5
 
DISTRIBUCIONES ESTADISTICAS EN HIDROLOGÍA Y SU APLICACIÓN EN R
DISTRIBUCIONES ESTADISTICAS EN HIDROLOGÍA Y SU APLICACIÓN EN RDISTRIBUCIONES ESTADISTICAS EN HIDROLOGÍA Y SU APLICACIÓN EN R
DISTRIBUCIONES ESTADISTICAS EN HIDROLOGÍA Y SU APLICACIÓN EN R
 
Materia y energia
Materia y energiaMateria y energia
Materia y energia
 
Materia y energía, materia oscura
Materia y energía, materia oscuraMateria y energía, materia oscura
Materia y energía, materia oscura
 
Crisis de la modernidad y postmodernidad
Crisis de la modernidad y postmodernidadCrisis de la modernidad y postmodernidad
Crisis de la modernidad y postmodernidad
 

Recently uploaded

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Intelisync
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 

Recently uploaded (20)

Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)Introduction to Decentralized Applications (dApps)
Introduction to Decentralized Applications (dApps)
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 

HIDRAULICA DE CANALES

  • 1. PYTHON PARA INGENIERIA - CANALES ABIERTOS METODO DE NEWTHON RAPHSON: ECUACION DE MANNING ECUACION PARA EL METODO DE NEWTON RAPHSON ECUACIONES PARA CANAL TRAPEZOIDAL AREA -> CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 1 of 15 3/13/2018, 3:15 PM
  • 2. PERIMETRO-> DERIVANDO EL AREA RESPECTO A y: DERIVANDO EL PERIMETRO RESPECTO A y: DONDE: B = ANCHO DE BASE DEL CANAL Z1 = PENDIENTE IZQUIERDA DE LA SECCION DEL CANAL Z2 = PENDIENTE DERECHA DE LA SECCION DEL CANAL yi = TIRANTE NORMAL A CALCULAR In [3]: import math CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 2 of 15 3/13/2018, 3:15 PM
  • 3. In [1]: def trapezoidal(q, b, z1, z2, s, n): """ |Retorna una lista con | - Tirante Normal de la seccion | - Area hidráulica de la seccion | - Perímetro mojado | - Radio Hidráulico | - Espejo de agua | - Tirante medio | - Velocidad media | - Energía | - Radio Hidráulico | - Espejo de agua | - Tirante medio | - Velocidad media | - Energía | - Numero de Froude |Entrada de Datos: | q(m3/s) -> Caudal circulante por el canal | s -> Pendi☺ente del canal | n -> Coeficiente de manning | z1 -> Pendiente izquierda de la seccion del canal | z2 -> Pendiente derecha de la seccion del canal | b -> Longitud de base del canal |Ejemplo: | >>> seccion_trapezoidal = trapezoidal(0.5, 0.5, 1, 1, 0.01, 0.014) | >>> print(seccion_trapezoidal) | >>> (0.28720341374388053, 0.2260875077380789, 1.3123339257528945, 0 .1722789476835105, | 1.0744068274877612, 0.21043007355670804, 0.5365684383574587, 2 .2115330696610056, 1.5394970620863067) """ cte = q*n/s**0.5 yi = 1 yf = 2 error = 0.000000001 cont = 1 while abs(yi-yf) > error: print("Iteración: ", cont) yi = yf area = b*yi + z1*yi**2/2 + z2*yi**2/2 perimeter = b + yi*(z1**2+1)**0.5 + yi*(z2**2+1)**0.5 fy = area**(5/3)/perimeter**(2/3)-cte d_area = b + z1 * yi + z2 * yi d_perimeter = (z1**2+1)**0.5 + (z2**2+1)**0.5 dfy = 5*area**(2/3) / perimeter**(2/3) * d_area / 3 - 2 * area**( 5/3) / perimeter**(5/3) * d_perimeter / 3 yf = yi - fy/dfy cont += 1 if cont > 40: break print("yf=", yf) print("error: ", abs(yf-yi)) a = b*yf + z1*yf**2/2 + z2*yf**2/2 p = b + yf*(z1**2+1)**0.5 + yf*(z2**2+1)**0.5 r = a/p t = b+z1*yf+z2*yf ym = a/t v = q/a e = yf + v**2/(2*9.806665) froude = v/(9.806665*a/t)**0.5 return yf, a, p, r, t, ym, e, v, froude CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 3 of 15 3/13/2018, 3:15 PM
  • 4. In [3]: seccion_trapezoidal = trapezoidal(0.5, 0.5, 1, 1, 0.01, 0.014) In [4]: print(seccion_trapezoidal) ECUACIONES PARA CANAL CIRCULAR Iteración: 1 yf= 1.1757678260211835 error: 0.8242321739788165 Iteración: 2 yf= 0.6835237825717543 error: 0.4922440434494292 Iteración: 3 yf= 0.41666557810687294 error: 0.26685820446488134 Iteración: 4 yf= 0.30840080977437995 error: 0.10826476833249299 Iteración: 5 yf= 0.2879311733654157 error: 0.020469636408964265 Iteración: 6 yf= 0.2872043201745382 error: 0.0007268531908775078 Iteración: 7 yf= 0.28720341374528957 error: 9.064292486038461e-07 Iteración: 8 yf= 0.28720341374388053 error: 1.4090395517030174e-12 (0.28720341374388053, 0.2260875077380789, 1.3123339257528945, 0.1722789 476835105, 1.0744068274877612, 0.21043007355670804, 0.5365684383574587, 2.2115330696610056, 1.5394970620863067) CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 4 of 15 3/13/2018, 3:15 PM
  • 5. AREA -> PERIMETRO -> DERIVANDO EL AREA RESPECTO A -> DERIVANDO EL PERIMETRO RESPECTO A -> CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 5 of 15 3/13/2018, 3:15 PM
  • 6. In [1]: def circle(q, d, s, n): """ |Retorna una lista con | - Tirante Normal de la seccion | - Area hidráulica de la seccion | - Perímetro mojado | - Radio Hidráulico | - Espejo de agua | - Tirante medio | - Velocidad media | - Energía | - Numero de Froude | q(m3/s) -> Caudal circulante por el canal | d -> Longitud del diámetro de la sección | s -> Pendiente del canal | n -> Coeficiente de manning |Ejemplo: | >>> seccion_circular = circle(0.5, 1.3, 0.001, 0.014) | >>> print(seccion_circular) | >>> (0.5332481279157819, 0.5127041358149504, 1.8072573165180572, | 0.28369183022744604, 1.2788573030089485, 0.4009080095243143, | 0.5817384458469715, 0.9752213120053009, 0.49183581132307763) """ cte = q * n / s ** 0.5 yi = math.pi-0.01 yf = yi+0.01 if q > d/2: yi = math.pi * 1.95 - 0.01 yf = math.pi * 1.95 error = 0.000000001 cont = 1 while abs(yi - yf) > error: print("Iteración: ", cont) yi = yf area = d**2*(yi-math.sin(yi))/8 perimeter = yi*d/2 fy = area ** (5 / 3) / perimeter ** (2 / 3) - cte d_area = d**2*(1-math.cos(yi))/8 d_perimeter = d/2 dfy = 5 * area ** (2 / 3) / perimeter ** (2 / 3) * d_area / 3 - 2 * area ** (5 / 3) / perimeter ** ( 5 / 3) * d_perimeter / 3 yf = yi - fy / dfy cont += 1 if cont > 40 or area > (math.pi*d**2/4): break print("yf=", yf) print("error: ", abs(yf - yi)) if area < (math.pi*d**2/4): h = d*(1-math.cos(yf/2))/2 a = d**2*(yi-math.sin(yi))/8 p = yi*d/2 r = a / p t = d*math.sin(yf/2) ym = a / t v = q / a e = h + v ** 2 / (2 * 9.806665) froude = v / (9.806665 * a / t) ** 0.5 return h, a, p, r, t, ym, e, v, froude else: return 'Error' CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 6 of 15 3/13/2018, 3:15 PM
  • 7. In [4]: seccion_circular = circle(0.5, 1.3, 0.001, 0.014) In [5]: print(seccion_circular) ECUACIONES PARA CANAL PARABÓLICO Iteración: 1 yf= 2.7947684239726702 error: 0.3468242296171229 Iteración: 2 yf= 2.7804381906696047 error: 0.014330233303065487 Iteración: 3 yf= 2.780395871566242 error: 4.23191033629422e-05 Iteración: 4 yf= 2.7803958711917014 error: 3.745403986954443e-10 (0.5332481279157819, 0.5127041358149504, 1.8072573165180572, 0.28369183 022744604, 1.2788573030089485, 0.4009080095243143, 0.5817384458469715, 0.9752213120053009, 0.49183581132307763) CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 7 of 15 3/13/2018, 3:15 PM
  • 8. AREA -> DERIVANDO EL AREA RESPECTO A -> SI PERIMETRO -> DERIVANDO EL PERIMETRO RESPECTO A -> SI PERIMETRO -> DERIVANDO EL PERIMETRO RESPECTO A -> CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 8 of 15 3/13/2018, 3:15 PM
  • 9. In [8]: def parabolic(q, t, s, n): cte = q * n / s ** 0.5 yi = 1 yf = 2 error = 0.000000001 cont = 1 while abs(yi - yf) > error: print("Iteración: ", cont) yi = yf area = 2*t*yi/3 d_area = 2*t/3 perimeter = 0 d_perimeter = 0 if yi/t <= 0.25: perimeter = t + 8*yi**2/(3*t) d_perimeter = 16*yi/(3*t) elif yi/t > 0.25: x = 4*yi/t dx = 4/t perimeter = 0.5*t*((1+x**2)**0.5+math.log(x+(1+x**2)**0.5)/x) d_perimeter = 0.5*t*(x/(1+x**2)**0.5+1/(x*(1+x**2)**0.5)-math .log(x+(1+x**2)**0.5)/x**2)*dx fy = area ** (5 / 3) / perimeter ** (2 / 3) - cte dfy = 5 * area ** (2 / 3) / perimeter ** (2 / 3) * d_area / 3 - 2 * area ** (5 / 3) / perimeter ** ( 5 / 3) * d_perimeter / 3 yf = yi - fy / dfy cont += 1 if cont > 40: break print("yf=", yf) print("error: ", abs(yf - yi)) a = 2*t*yf/3 p = 0 if yi / t <= 0.25: p = t + 8 * yf ** 2 / (3 * t) elif yi / t > 0.25: x = 4 * yf / t p = 0.5 * t * ((1 + x ** 2) ** 0.5 + math.log(x + (1 + x ** 2) ** 0.5) / x) r = a / p ym = a / t v = q / a e = yf + v ** 2 / (2 * 9.806665) froude = v / (9.806665 * a / t) ** 0.5 return yf, a, p, r, ym, e, v, froude In [9]: para = parabolic(1.5, 1.0, 0.01, 0.014) print(para) Iteración: 1 yf= 0.7463737949066422 error: 1.2536262050933578 Iteración: 2 yf= 0.76054974826516 error: 0.014175953358517734 Iteración: 3 yf= 0.7605484112206655 error: 1.3370444944538207e-06 Iteración: 4 yf= 0.7605484112206562 error: 9.325873406851315e-15 (0.7605484112206562, 0.5070322741471042, 1.902217044788166, 0.266548065 86677815, 0.5070322741471042, 1.2067796537800057, 2.9583915590446384, 1 .32671360454801) CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 9 of 15 3/13/2018, 3:15 PM
  • 10. ECUACIONES PARA CANAL NATURAL CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 10 of 15 3/13/2018, 3:15 PM
  • 12. AREA -> DERIVANDO EL AREA RESPECTO A -> PERIMETRO -> DERIVANDO EL PERIMETRO RESPECTO A -> CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 12 of 15 3/13/2018, 3:15 PM
  • 13. In [1]: def coord_yn(c, yn): if max_matrix(c)[1] > (yn + min_matrix(c)[1]): c_1 = [] for i in range(len(c)): if c[i][1] <= (yn + min_matrix(c)[1]): c_1.append(c[i]) c_1.insert(0, c[c.index(c_1[0]) - 1]) c_1.append(c[c.index(c_1[len(c_1) - 1]) + 1]) return c_1 else: return c In [2]: def min_matrix(c): return min([i[0] for i in c]), min([i[1] for i in c]) def max_matrix(c): return max([i[0] for i in c]), max([i[1] for i in c]) CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 13 of 15 3/13/2018, 3:15 PM
  • 14. In [14]: def natural(c, q, s, n): cte = q * n / s ** 0.5 yi = (max_matrix(c)[1] - min_matrix(c)[1]) / 1.05 yf = yi + 0.01 error = 0.0000000001 cont = 1 y_min = min_matrix(c)[1] while abs(yi - yf) > error: yi = yf area = 0 perimeter = 0 d_area = 0 c_1 = coord_yn(c, yi) n_c = len(c_1) for i in range(1, n_c - 2): area += (yi + y_min) * (c_1[i + 1][0] - c_1[i][0]) - (c_1[i + 1][i] + c_1[i][1]) * ( c_1[i + 1][0] - c_1[i][0]) / 2 perimeter += ((c_1[i + 1][0] - c_1[i][0]) ** 2 + (c_1[i + 1][ 1] - c_1[i][1]) ** 2) ** 0.5 d_area += c_1[i + 1][0] - c_1[i][0] area = area - ((y_min + yi - c_1[1][1]) ** 2 / 2) * (c_1[1][0] - c_1[0][0]) / (c_1[1][1] - c_1[0][1]) + ( (y_min + yi - c_1[n_c - 2][1]) ** 2 / 2) * (c_1[n_c - 1][ 0] - c_1[n_c - 2][0]) / ( c_1[n_c - 1][1] - c_1[n_c - 2][1]) perimeter = perimeter + (yi + y_min - c_1[1][1]) * ( 1 + ((c_1[1][0] - c_1[0][0]) / (c_1[1][1] - c_1[0][1])) * * 2) ** 0.5 + ( yi + y_min - c_1[n_c - 2][1]) * ( 1 + ((c_1[n_c - 1][0] - c_1[n_c - 2][0]) / (c _1[n_c - 1][1] - c_1[n_c - 2][1])) ** 2) ** 0.5 d_area = d_area - (yi+y_min-c_1[1][1])*(c_1[1][0]-c_1[0][0])/(c_1 [1][1]-c_1[0][1]) + (yi+y_min-c_1[n_c-2][1])*( c_1[n_c-1][0]-c_1[n_c-2][0])/(c_1[n_c-1][1]-c_1[n_c-2][1]) d_perimeter = (1+((c_1[1][0]-c_1[0][0])/(c_1[1][1]-c_1[0][1]))**2 )**0.5 + (1+( (c_1[n_c-1][0]-c_1[n_c-2][0])/(c_1[n_c-1][1]-c_1[n_c-2][1 ])))**0.5 fy = area ** (5 / 3) / perimeter ** (2 / 3) - cte dfy = 5 * area ** (2 / 3) / perimeter ** (2 / 3) * d_area / 3 - 2 * area ** (5 / 3) / perimeter ** ( 5 / 3) * d_perimeter / 3 yf = yi - fy / dfy if yf>(max_matrix(c)[1]-min_matrix(c)[1]): yf = 'Error' break if cont > 40: yf = 'Error' break cont += 1 if yf != 'Error': area = 0 perimeter = 0 d_area = 0 c_1 = coord_yn(c, yf) n_c = len(c_1) for i in range(1, n_c - 2): area += (yf + y_min) * (c_1[i + 1][0] - c_1[i][0]) - (c_1[i + 1][i] + c_1[i][1]) * ( c_1[i + 1][0] - c_1[i][0]) / 2 perimeter += ((c_1[i + 1][0] - c_1[i][0]) ** 2 + (c_1[i + 1][ 1] - c_1[i][1]) ** 2) ** 0.5 d_area += c_1[i + 1][0] - c_1[i][0] area = area - ((y_min + yf - c_1[1][1]) ** 2 / 2) * (c_1[1][0] - c_1[0][0]) / (c_1[1][1] - c_1[0][1]) + ( CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 14 of 15 3/13/2018, 3:15 PM
  • 15. In [16]: c = [[0,1],[1,0.25],[2,0],[3,1]] nat = natural(c, 1.5, 0.01, 0.025) print("yf=", nat[0]) print("area=", nat[1]) print("perimeter=", nat[2]) print("rh=", nat[3]) print("ta=", nat[4]) print("ym o yh=", nat[5]) print("energy=", nat[6]) print("velocity=", nat[7]) print("froude=", nat[8]) yf= 0.634691104739465 area= 0.8097656680009463 perimeter= 2.569517015876971 rh= 0.3151431428542515 ta= 2.1476125777254182 ym o yh= 0.37705388597536815 energy= 0.8096405069611481 velocity= 1.8523877453375155 froude= 0.9633176526809352 CLASE 1-checkpoint file:///D:/python/Tutorial1/CANALES.html 15 of 15 3/13/2018, 3:15 PM