Академический Документы
Профессиональный Документы
Культура Документы
'Rectangular
Q = Range(e6).Value
b = Range(e7).Value
s = Range(e8).Value
n = Range(e9).Value
y = Range(e11).Value
If (Q = 0) Then
Do
Q = Val(InputBox(Ingrese el valor del caudal (Q) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Q 0)
End If
If (b = 0) Then
Do
b = Val(InputBox(Ingrese el valor del Ancho de la solera (b) teniendo en cuenta que
tiene que ser mayor que 0))
Loop Until (b 0)
End If
If (s = 0) Then
Do
s = Val(InputBox(Ingrese el valor de la pendiente(S) teniendo en cuenta que tiene
que ser mayor que 0))
Loop Until (s 0)
End If
If (n = 0) Then
Do
n = Val(InputBox(Ingrese el valor del coeficiente de rugosidad(n) teniendo en
cuenta que tiene que ser mayor que 0))
Loop Until (n 0)
End If
If (y = 0) Then
Do
y = Val(InputBox(Ingrese el valor del tirante Normal (Yn) teniendo en cuenta que
tiene que ser mayor que 0))
Loop Until (y 0)
End If
Range(e6).Select
ActiveCell.FormulaR1C1 = Q
Range(e7).Select
ActiveCell.FormulaR1C1 = b
Range(e8).Select
ActiveCell.FormulaR1C1 = s
Range(e9).Select
ActiveCell.FormulaR1C1 = n
Range(e11).Select
ActiveCell.FormulaR1C1 = y
a = b y
p = 2 y + b
rh = (b y) (2 y + b)
eh = (Q n) s ^ (1 2)
eg = a rh ^ (2 3)
Range(h10).Select
ActiveCell.FormulaR1C1 = Round(eh, 3)
Range(j10).Select
ActiveCell.FormulaR1C1 = Round(eg, 3)
Else
Range(h11).Select
ActiveCell.FormulaR1C1 = NO CUMPLE
Range(d12).Select
ActiveCell.FormulaR1C1 = INGRESE OTRO VALOR
End If
End Sub
Range(e6).Select
Selection.ClearContents
Range(e7).Select
Selection.ClearContents
Range(e8).Select
Selection.ClearContents
Range(e9).Select
Selection.ClearContents
Range(e11).Select
Selection.ClearContents
Range(h10).Select
Selection.ClearContents
Range(j10).Select
Selection.ClearContents
Range(h11).Select
Selection.ClearContents
Range(d12).Select
Selection.ClearContents
End Sub
If (Q = 0) Then
Do
Q = Val(InputBox(Ingrese el valor del caudal (Q) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Q 0)
End If
If (b = 0) Then
Do
b = Val(InputBox(Ingrese el valor del Ancho de la solera (b) teniendo en cuenta que
tiene que ser mayor que 0))
Loop Until (b 0)
End If
If (Z = 0) Then
Do
Z = Val(InputBox(Ingrese el valor del taludn(Z) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Z 0)
End If
If (s = 0) Then
Do
s = Val(InputBox(Ingrese el valor de la pendiente(S) teniendo en cuenta que tiene
que ser mayor que 0))
Loop Until (s 0)
End If
If (n = 0) Then
Do
n = Val(InputBox(Ingrese el valor del coeficiente de rugosidad(n) teniendo en
cuenta que tiene que ser mayor que 0))
Loop Until (n 0)
End If
If (y = 0) Then
Do
y = Val(InputBox(Ingrese el valor del tirante Normal (Yn) teniendo en cuenta que
tiene que ser mayor que 0))
Loop Until (y 0)
End If
Range(e16).Select
ActiveCell.FormulaR1C1 = Q
Range(e17).Select
ActiveCell.FormulaR1C1 = b
Range(e18).Select
ActiveCell.FormulaR1C1 = Z
Range(e19).Select
ActiveCell.FormulaR1C1 = s
Range(e20).Select
ActiveCell.FormulaR1C1 = n
Range(e22).Select
ActiveCell.FormulaR1C1 = y
a = (b + Z y) y
p = b + 2 y Sqr(1 + Z ^ 2)
rh = ((b + Z y) y) (b + 2 y Sqr(1 + Z ^ 2))
eh = (Q n) s ^ (1 2)
eg = a rh ^ (2 3)
Range(h20).Select
ActiveCell.FormulaR1C1 = Round(eh, 3)
Range(j20).Select
ActiveCell.FormulaR1C1 = Round(eg, 3)
Else
Range(h21).Select
ActiveCell.FormulaR1C1 = NO CUMPLE
Range(d23).Select
ActiveCell.FormulaR1C1 = INGRESE OTRO VALOR
End If
End Sub
Range(e16).Select
Selection.ClearContents
Range(e17).Select
Selection.ClearContents
Range(e18).Select
Selection.ClearContents
Range(e19).Select
Selection.ClearContents
Range(e20).Select
Selection.ClearContents
Range(e22).Select
Selection.ClearContents
Range(h20).Select
Selection.ClearContents
Range(j20).Select
Selection.ClearContents
Range(h21).Select
Selection.ClearContents
Range(d23).Select
Selection.ClearContents
End Sub
Q = Range(e27).Value
Z = Range(e28).Value
s = Range(e29).Value
n = Range(e30).Value
y = Range(e32).Value
If (Q = 0) Then
Do
Q = Val(InputBox(Ingrese el valor del caudal (Q) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Q 0)
End If
If (Z = 0) Then
Do
Z = Val(InputBox(Ingrese el valor del Ancho de la solera (b) teniendo en cuenta que
tiene que ser mayor que 0))
Loop Until (Z 0)
End If
If (s = 0) Then
Do
s = Val(InputBox(Ingrese el valor de la pendiente(S) teniendo en cuenta que tiene
que ser mayor que 0))
Loop Until (s 0)
End If
If (n = 0) Then
Do
n = Val(InputBox(Ingrese el valor del coeficiente de rugosidad(n) teniendo en
cuenta que tiene que ser mayor que 0))
Loop Until (n 0)
End If
If (y = 0) Then
Do
y = Val(InputBox(Ingrese el valor del tirante Normal (Yn) teniendo en cuenta que
tiene que ser mayor que 0))
Loop Until (y 0)
End If
Range(e27).Select
ActiveCell.FormulaR1C1 = Q
Range(e28).Select
ActiveCell.FormulaR1C1 = Z
Range(e29).Select
ActiveCell.FormulaR1C1 = s
Range(e30).Select
ActiveCell.FormulaR1C1 = n
Range(e32).Select
ActiveCell.FormulaR1C1 = y
a = Z y ^ 2
p = 2 y Sqr(1 + Z ^ 2)
rh = (Z y) (2 Sqr(1 + Z ^ 2))
eh = (Q n) s ^ (1 2)
eg = a rh ^ (2 3)
Range(h31).Select
ActiveCell.FormulaR1C1 = Round(eh, 3)
Range(j31).Select
ActiveCell.FormulaR1C1 = Round(eg, 3)
Else
Range(h32).Select
ActiveCell.FormulaR1C1 = NO CUMPLE
Range(d33).Select
ActiveCell.FormulaR1C1 = INGRESE OTRO VALOR
End If
End Sub
Range(e27).Select
Selection.ClearContents
Range(e28).Select
Selection.ClearContents
Range(e29).Select
Selection.ClearContents
Range(e30).Select
Selection.ClearContents
Range(e32).Select
Selection.ClearContents
Range(h31).Select
Selection.ClearContents
Range(j31).Select
Selection.ClearContents
Range(h32).Select
Selection.ClearContents
Range(d33).Select
Selection.ClearContents
End Sub
Q = Range(e37).Value
di = Range(e38).Value
s = Range(e39).Value
n = Range(e40).Value
y = Range(e42).Value
If (Q = 0) Then
Do
Q = Val(InputBox(Ingrese el valor del caudal (Q) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Q 0)
End If
If (s = 0) Then
Do
s = Val(InputBox(Ingrese el valor de la pendiente(S) teniendo en cuenta que tiene
que ser mayor que 0))
Loop Until (s 0)
End If
If (n = 0) Then
Do
n = Val(InputBox(Ingrese el valor del coeficiente de rugosidad(n) teniendo en
cuenta que tiene que ser mayor que 0))
Loop Until (n 0)
End If
Do
di = Val(InputBox(Ingrese el valor del di�metro (d) teniedo en cuenta que tiene que
ser mayor a 0 y mayor que el tirante (y) ))
y = Val(InputBox(Ingrese el valor del tirante (y) teniedo en cuenta que tiene que
ser mayor a 0 y menor que el di�metro (d) ))
Loop Until (di y And di 0 And y 0)
Range(e37).Select
ActiveCell.FormulaR1C1 = Q
Range(e38).Select
ActiveCell.FormulaR1C1 = di
Range(e39).Select
ActiveCell.FormulaR1C1 = s
Range(e40).Select
ActiveCell.FormulaR1C1 = n
Range(e42).Select
ActiveCell.FormulaR1C1 = y
r = di 2
h = Abs(r - y)
Pi = 3.141592654
ang = h r
Range(n24).Select
ActiveCell.FormulaR1C1 = ang
alfa = Range(n26).Value
beta = 2 Pi - alfa
If (y r) Then
a = (beta - Sin(beta)) (di ^ 2 8)
p = beta di 2
rh = a p
Else
a = (alfa - Sin(alfa)) (di ^ 2 8)
p = alfa di 2
rh = a p
End If
eh = (Q n) s ^ (1 2)
eg = a rh ^ (2 3)
Range(h41).Select
ActiveCell.FormulaR1C1 = Round(eh, 3)
Range(j41).Select
ActiveCell.FormulaR1C1 = Round(eg, 3)
Else
Range(h42).Select
ActiveCell.FormulaR1C1 = NO CUMPLE
Range(d43).Select
ActiveCell.FormulaR1C1 = INGRESE OTRO VALOR
End If
End Sub
Range(e38).Select
Selection.ClearContents
Range(e39).Select
Selection.ClearContents
Range(e40).Select
Selection.ClearContents
Range(e42).Select
Selection.ClearContents
Range(h41).Select
Selection.ClearContents
Range(j41).Select
Selection.ClearContents
Range(h42).Select
Selection.ClearContents
Range(d43).Select
Selection.ClearContents
End Sub
Private Sub CommandButton9_Click()
'Parab�lica
Q = Range(e47).Value
s = Range(e48).Value
n = Range(e49).Value
y = Range(e51).Value
If (Q = 0) Then
Do
Q = Val(InputBox(Ingrese el valor del caudal (Q) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Q 0)
End If
If (s = 0) Then
Do
s = Val(InputBox(Ingrese el valor de la pendiente(S) teniendo en cuenta que tiene
que ser mayor que 0))
Loop Until (s 0)
End If
If (n = 0) Then
Do
n = Val(InputBox(Ingrese el valor del coeficiente de rugosidad(n) teniendo en
cuenta que tiene que ser mayor que 0))
Loop Until (n 0)
End If
If (y = 0) Then
Do
y = Val(InputBox(Ingrese el valor del tirante Normal (Yn) teniendo en cuenta que
tiene que ser mayor que 0))
Loop Until (y 0)
End If
Range(e47).Select
ActiveCell.FormulaR1C1 = Q
Range(e48).Select
ActiveCell.FormulaR1C1 = s
Range(e49).Select
ActiveCell.FormulaR1C1 = n
Range(e51).Select
ActiveCell.FormulaR1C1 = y
t = 2 Sqr(y)
a = 2 3 t y
x = 4 y t
If (x 0 And x = 1) Then
p = t + (8 y ^ 2) (3 t)
Else
p = (t 2) (Sqr(1 + x ^ 2) + (1 x) Log(x + Sqr(1 + x ^ 2)))
End If
rh = a p
eh = (Q n) s ^ (1 2)
eg = a rh ^ (2 3)
Range(h51).Select
ActiveCell.FormulaR1C1 = Round(eh, 3)
Range(j51).Select
ActiveCell.FormulaR1C1 = Round(eg, 3)
Else
Range(h52).Select
ActiveCell.FormulaR1C1 = NO CUMPLE
Range(d52).Select
ActiveCell.FormulaR1C1 = INGRESE OTRO VALOR
End If
End Sub
Private Sub CommandButton10_Click()
Range(e47).Select
Selection.ClearContents
Range(e48).Select
Selection.ClearContents
Range(e49).Select
Selection.ClearContents
Range(e51).Select
Selection.ClearContents
Range(h51).Select
Selection.ClearContents
Range(j51).Select
Selection.ClearContents
Range(h52).Select
Selection.ClearContents
Range(d52).Select
Selection.ClearContents
End Sub
Q = Range(e56).Value
b = Range(e57).Value
r = Range(e58).Value
s = Range(e59).Value
n = Range(e60).Value
y = Range(e62).Value
If (Q = 0) Then
Do
Q = Val(InputBox(Ingrese el valor del caudal (Q) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Q 0)
End If
If (b = 0) Then
Do
b = Val(InputBox(Ingrese el valor de la base (b) teniedo en cuenta que debe ser
mayor a 0 ))
Loop Until (b 0)
End If
If (r = y Or r = 0 Or y = 0) Then
Do
y = Val(InputBox(Ingrese el valor del tirante Normal (Yn) teniendo en cuenta
que tiene que ser mayor que el radio (r) y mayor que 0 ))
r = Val(InputBox(Ingrese el valor del radio (r) teniendo en cuenta que tiene
que ser menor que el tirante(y) y mayor que 0 ))
Loop Until (r y And r 0 And y 0)
End If
If (s = 0) Then
Do
s = Val(InputBox(Ingrese el valor de la pendiente(S) teniendo en cuenta que tiene
que ser mayor que 0))
Loop Until (s 0)
End If
If (n = 0) Then
Do
n = Val(InputBox(Ingrese el valor del coeficiente de rugosidad(n) teniendo en
cuenta que tiene que ser mayor que 0))
Loop Until (n 0)
End If
Range(e56).Select
ActiveCell.FormulaR1C1 = Q
Range(e57).Select
ActiveCell.FormulaR1C1 = b
Range(e58).Select
ActiveCell.FormulaR1C1 = r
Range(e59).Select
ActiveCell.FormulaR1C1 = s
Range(e60).Select
ActiveCell.FormulaR1C1 = n
Range(e62).Select
ActiveCell.FormulaR1C1 = y
Pi = 3.141592654
a = (Pi 2 - 2) r ^ 2 + (b + 2 r) y
p = (Pi - 2) r + b + 2 y
rh = a p
eh = (Q n) s ^ (1 2)
eg = a rh ^ (2 3)
Range(h60).Select
ActiveCell.FormulaR1C1 = Round(eh, 3)
Range(j60).Select
ActiveCell.FormulaR1C1 = Round(eg, 3)
Else
Range(h61).Select
ActiveCell.FormulaR1C1 = NO CUMPLE
Range(d63).Select
ActiveCell.FormulaR1C1 = INGRESE OTRO VALOR
End If
End Sub
Range(e56).Select
Selection.ClearContents
Range(e57).Select
Selection.ClearContents
Range(e58).Select
Selection.ClearContents
Range(e59).Select
Selection.ClearContents
Range(e60).Select
Selection.ClearContents
Range(e62).Select
Selection.ClearContents
Range(h60).Select
Selection.ClearContents
Range(j60).Select
Selection.ClearContents
Range(h61).Select
Selection.ClearContents
Range(d63).Select
Selection.ClearContents
End Sub
Q = Range(e56).Value
r = Range(e58).Value
Z = Range(e57).Value
s = Range(e59).Value
n = Range(e60).Value
y = Range(e62).Value
If (Q = 0) Then
Do
Q = Val(InputBox(Ingrese el valor del caudal (Q) teniendo en cuenta que tiene que
ser mayor que 0))
Loop Until (Q 0)
End If
If (b = 0) Then
Do
b = Val(InputBox(Ingrese el valor de la base (b) teniedo en cuenta que debe ser
mayor a 0 ))
Loop Until (b 0)
End If
If (r = y Or r = 0 Or y = 0) Then
Do
y = Val(InputBox(Ingrese el valor de la pendiente del tirante (y) teniendo en
cuenta que tiene que ser mayor que el radio (r) y mayor que 0 ))
r = Val(InputBox(Ingrese el valor del radio (r) teniendo en cuenta que tiene
que ser menor que el tirante(y) y mayor que 0 ))
Loop Until (r y And r 0 And y 0)
End If
If (s = 0) Then
Do
s = Val(InputBox(Ingrese el valor de la pendiente(S) teniendo en cuenta que tiene
que ser mayor que 0))
Loop Until (s 0)
End If
If (n = 0) Then
Do
n = Val(InputBox(Ingrese el valor del coeficiente de rugosidad(n) teniendo en
cuenta que tiene que ser mayor que 0))
Loop Until (n 0)
End If
Range(e67).Select
ActiveCell.FormulaR1C1 = Q
Range(e68).Select
ActiveCell.FormulaR1C1 = r
Range(e69).Select
ActiveCell.FormulaR1C1 = Z
Range(e70).Select
ActiveCell.FormulaR1C1 = s
Range(e71).Select
ActiveCell.FormulaR1C1 = n
Range(e73).Select
ActiveCell.FormulaR1C1 = y
Pi = 3.141592654
a = (Pi 2 - 2) r ^ 2 + (b + 2 r) y
p = (Pi - 2) r + b + 2 y
rh = a p
End Sub