Form1 Form1: "Viaje Redondo"

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 14

TONELADA MILLA RADIO BUTTON IF ELSEIF TONELADA MILLA CON IF BOTONES

Public Class Form1


Dim OPER As String
Public Class Form1
Dim H1 As Single
Dim Wc, Ws, H1, H2, TM As Single
Dim H2 As Single
Dim tipo_op, msj As String
Dim WS1 As Single
Private Sub Button1_Click()
Dim WS2 As Single
Wc = Val(TextBox2.Text)
Dim WC As Single
Ws = Val(TextBox1.Text)
Dim TM As Single
H1 = Val(TextBox3.Text)
Private Sub Button1_Click()
H2 = Val(TextBox4.Text)
H1 = CSng(TextBox1.Text)
tipo_op = TextBox5.Text
H2 = CSng(TextBox2.Text)
If tipo_op = "viaje redondo" Then
WS1 = CSng(TextBox3.Text)
TM = 2 * Ws * H1
WS2 = CSng(TextBox4.Text)
Else
WC = CSng(TextBox5.Text)
If tipo_op = "perforacion" Then
If RadioButton1.Checked = True Then
TM = 2 * (2 * Ws * H2 - 2 * Ws * H1)
TM = 2 * WS1 * H1
Else
Label7.Text = "TM viaje redondo"
If tipo_op = "bajada de caneria" Then
ElseIf RadioButton2.Checked = True Then
TM = Wc * H1
TM = 2 * (2 * WS2 * H2 - 2 * WS1 * H1)
Else
Label7.Text = "TM perforacion"
msj = "colocar una de las
ElseIf RadioButton3.Checked = True Then
operaciones"
TM = WC * H1
End If
Label7.Text = "TM bajada caeria"
End If
Else
End If
End If
Label7.Text = CStr(TM)
Label8.Text = TM
Label8.Text = CStr(msj)
End Sub
End Sub
Private Sub Button2_Click()
Private Sub Button2_Click()
TextBox1.Text = ""
TextBox2.Text = ""
TextBox2.Text = ""
TextBox1.Text = " "
TextBox3.Text = ""
TextBox3.Text = " "
TextBox4.Text = ""
TextBox4.Text = " "
TextBox5.Text = ""
TextBox5.Text = " "
Label7.Text = ""
Label7.Text = " "
Label8.Text = ""
Label8.Text = " "
End Sub
End Sub
Private Sub Button3_Click()
Private Sub Button3_Click()
End
End
End Sub
End Sub
End Class
End Class
TONELADA MILLA SELECT CASE TONELADA MILLA SELECT CASE RADIOBUTTON

Public Class Form1


Public Class Form1
Dim OPER As String
Dim Ws, Wc, H1, H2, TM As Single
Dim H1 As Single
Private Sub calcular(ByVal top As String)
Dim H2 As Single
Ws = Val(Txt_Ws.Text)
Dim WS1 As Single
Wc = Val(Txt_Wc.Text)
Dim WS2 As Single
H1 = Val(Txt_H1.Text)
Dim WC As Single
H2 = Val(Txt_H2.Text)
Dim TM As Single
Select top
Private Sub Button1_Click()
Case "perforacion"
OPER = TextBox6.Text
TM = 2 * Ws * H1
H1 = Val(TextBox1.Text)
Case "bajada c"
H2 = Val(TextBox2.Text)
TM = 2 * (2 * Ws * H2 - 2 * Ws * H1)
WS1 = Val(TextBox3.Text)
Case "viaje redondo"
WS2 = Val(TextBox4.Text)
TM = Wc * H1
WC = Val(TextBox5.Text)
End Select
Select Case OPER
Txt_TM.Text = CStr(TM)
Case "VR"
End Sub
TM = 2 * WS1 * H1
Private Sub RadioButton1_CheckedChanged( )
Label6.Text = "TM VIAJE REDONDO ="
Call calcular(RadioButton1.Text)
Case "P"
End Sub
TM = 2 * (2 * WS2 * H2 - 2 * WS1 * H1)
Private Sub RadioButton2_CheckedChanged( )
Label6.Text = "PERFORACION "
Call calcular(RadioButton2.Text)
Case "BC"
End Sub
TM = WC * H1
Private Sub RadioButton3_CheckedChanged( )
Label6.Text = " TM BAJADA DE CAERIA "
Call calcular(RadioButton3.Text)
Case Else
End Sub
Label7.Text = " ERROR"
Private Sub Btn_Limpiar_Click( )
End Select
Txt_H1.Text = ""
Label7.Text = TM
Txt_H2.Text = ""
End Sub
Txt_TM.Text = ""
Private Sub Button3_Click()
Txt_Wc.Text = ""
End
Txt_Ws.Text = ""
End Sub
End Sub
Private Sub Button2_Click()
Private Sub Btn_Salir_Click( )
TextBox1.Text = ""
End
TextBox2.Text = ""
End Sub
TextBox3.Text = ""
End Class
TextBox4.Text = ""
TextBox5.Text = ""
TextBox6.Text = ""
Label6.Text = ""
Label7.Text = ""
End Sub
End Class
VF RADIOBUTTON Case "EA"
DM = CSng(InputBox("Diam.Mayor", "", ""))
DME = CSng(InputBox("Diam.Menor=", "", ""))
VEL = (Q*159*1000 /(2.54 ^
3))/(3.14*0.25*(DM^2- DME^2))
Case Else
MsgBox("ERROR")
End Select
Label3.Text = VEL
End Sub
Public Class Form1
Private Sub Button2_Click( )
Dim Q, DMA, dme, ID, Vf As Single
TextBox1.Text = ""
Private Sub RadioButton1_CheckedChanged ( )
Label3.Text = ""
ID = Val(TextBox4.Text)
End Sub
Q = Val(TextBox1.Text)
Private Sub Button3_Click( )
Vf = (Q / (3.1416 * 0.25 * ID ^ 2))
End
Label7.Text = CStr(Vf)
End Sub
End Sub
End Class
Private Sub RadioButton3_CheckedChanged()
VELOCIDAD DE FLUJO SELECT CASE
DMA = Val(TextBox3.Text)
dme = Val(TextBox4.Text)
Vf = (Q) / (3.1416 * 0.25 * ((DMA ^ 2) -
(dme ^ 2)))
Label7.Text = CStr(Vf)
End Sub
End Class
VELOCIDAD FLUJO SELEC CASE INPUTBOX

Public Class Form1


Dim Q, ID, OD, DM, VF As Single
Dim seccion As String
Private Sub Button1_Click( )
Q = Val(TextBox1.Text)
ID = Val(TextBox2.Text)
OD = Val(TextBox3.Text)
DM = Val(TextBox4.Text)
Public Class Form1 seccion = TextBox5.Text
Dim Q As Single Select Case seccion
Dim SECCION As String Case "interior"
Dim ID As Single VF = (Q / ((3.1416 / 4) * ID ^ 2))
Dim DM As Single Case "espacio"
Dim DME As Single VF = (Q / ((3.1416 / 4) * ((DM ^ 2) - (OD ^ 2))))
Dim VEL As Single End Select
Private Sub Button1_Click() Label6.Text = CStr(VF)
Q = CSng(InputBox("CAUDAL(BPM)=", "", "")) End Sub
SECCION = TextBox1.Text Private Sub Button2_Click()
Select Case SECCION end
Case "INT" End Sub
ID = CSng(InputBox("ID(pulg)=", "", "")) End Class
VEL = (Q * 159 * 1000 / (2.54 ^ 3)) / (3.14 *
0.25 * ID ^ 2)
VELOCIDAD DE FLUJO IF
PROFUNDIDAD DEL BIT

Public Class Form1


Dim Q, ID, OD, V As Single
Dim tipo_op, M As String
Private Sub Button1_Click()
Q = Val(TextBox1.Text)
ID = Val(TextBox2.Text)
OD = Val(TextBox3.Text) Public Class Form1
tipo_op = TextBox4.Text Dim longi() As Single
If tipo_op = "INT_HTA" Then Dim profbit() As Single
V = Q / ((3.14 / 4) * (ID ^ 2)) Dim prof As Single
Else Dim n As Integer
If tipo_op = "EA" Then Dim i As Integer
V = Q / ((3.14 / 4) * ((OD ^ 2) - (ID ^ 2))) Private Sub Button1_Click()
Else n = Val(TextBox1.Text)
M = "COLOCAR EA O INT_HTA" ReDim longi(n)
End If DataGridView1.RowCount = n
End If DataGridView1.ColumnCount = 3
Label5.Text = CStr(V) ReDim profbit(n)
Label7.Text = CStr(M) prof = 0
End Sub For i = 0 To n - 1
Private Sub Button2_Click( ) longi(i) = Val(InputBox("introducir la long" +
TextBox1.Text = "" CStr(i), ","))
TextBox2.Text = "" profbit(i) = prof + longi(i)
TextBox3.Text = "" DataGridView1.Item(0, i).Value = i
TextBox4.Text = "" DataGridView1.Item(1, i).Value = longi(i)
Label5.Text = "" DataGridView1.Item(2, i).Value =
Label7.Text = "" profbit(i)
End Sub prof = prof + longi(i)
Private Sub Button3_Click() Next
End End Sub
End Sub Private Sub Button2_Click()
End Class End
End Sub
End Class
CALCULO DE CE PARCIAL REDIMENSIONANDO Next
UNA MATRIZ End Sub
Public Class Form1 Private Sub Button4_Click()
Dim I As Byte End Sub
Dim producto, suma As Single Private Sub Label1_Click()
Private Sub Button3_Click() End Sub
End End Class
End Sub
Private Sub Button1_Click()
REM CALCULANDO el valor especifico PROMEDIO DE NOTAS
parcial Public Class Form1
suma = 0 Dim nota1, nota2 As Byte
For I = 0 To 14 Dim promedio As Single
producto = Val(DataGridView1.Item(1, Private Sub calcular_Click()
I).Value) * Val(DataGridView1.Item(2, I).Value) nota1 = Val(Tbnota1.Text)
DataGridView1.Item(3, I).Value = producto nota2 = Val(Tbnota2.Text)
suma = suma + producto promedio=(Val(Tbnota1.Text)+Val(Tbnota2.Text
Next ))/2
REM mostrar el resultado Lbpromedio.Text = promedio
DataGridView1.Item(2, 15).Value = "Ce If promedio >= 51 Then
mezcla" Lbobservac.Text = "aprovado"
DataGridView1.Item(3, 15).Value = suma ElseIf promedio > 40 Then
End Sub Lbobservac.Text = "repeche"
Private Sub Form1_Load() ElseIf promedio = 0 Then
DataGridView1.RowCount = 18 Lbobservac.Text = "abandono"
REM colocamos los componentes hasta el Else
carbono 10 Lbobservac.Text = "reprovado"
With DataGridView1 End If
.Item(0, 0).Value = "1" End Sub
.Item(0, 1).Value = "2" Private Sub Button2_Click()
.Item(0, 2).Value = "C3" End
.Item(0, 3).Value = "iC4" End Sub
.Item(0, 4).Value = "nC4" End Class
.Item(0, 5).Value = "iC5"
.Item(0, 6).Value = "nC5"
.Item(0, 7).Value = "C6"
.Item(0, 8).Value = "C7"
.Item(0, 9).Value = "C8"
.Item(0, 10).Value = "C9"
.Item(0, 11).Value = "C10"
.Item(0, 12).Value = "CO2"
.Item(0, 13).Value = "H2S"
.Item(0, 14).Value = "N2"
.Item(0, 15).Value = "TOTAL"
End With
End Sub
Private Sub Button2_Click()
For I = 0 To 14
With DataGridView1
.Item(1, I).Value = ""
End With
PMA Y D GAS Next
GEg = PMa / CSng(28.97)
Dgas = GEg * CSng(0.93)
Label3.Text = CStr(PMa)
Label4.Text = CStr(GEg)
End If
For i = 0 To 9
DataGridView1.Item(4, i).Value = VR(i)
Next
End Sub
Public Class Form1 Private Sub Button2_Click()
Dim fracc(10), NORM(10), PM(10), VR(10) As End
Single End Sub
Dim i As Integer End Class
Private Sub Form1 PRESION HIDROSTATICA (Data grid y Radionbutton)
DataGridView1.ColumnCount = 5 Public Class Form1
DataGridView1.RowCount = 11 Dim H(0 To 10), PH(0 To 10) As Single
DataGridView1.Item(0, 0).Value = "H2S" Dim D, PF, Prof As Single
DataGridView1.Item(0, 1).Value = "N2" Private Sub Button1_Click()
DataGridView1.Item(0, 2).Value = "CO2" Data.Item(0, 0).Value = "profundiad"
DataGridView1.Item(0, 3).Value = "C1" Data.Item(1, 0).Value = "presion"
DataGridView1.Item(0, 4).Value = "C2" Prof = Val(Tbh.Text)
DataGridView1.Item(0, 5).Value = "C3" PF = Val(Tbpf.Text)
DataGridView1.Item(0, 6).Value = "C4" If RadioButton1.Checked = True Then
DataGridView1.Item(0, 7).Value = "C5" D=8
DataGridView1.Item(0, 8).Value = "C6" ElseIf RadioButton2.Checked = True Then
DataGridView1.Item(0, 9).Value = "C7*" D=9
DataGridView1.Item(0, 10).Value = ElseIf RadioButton3.Checked = True Then
"sumatoria" D = 10
End Sub ElseIf RadioButton4.Checked = True Then
Private Sub Button1_Click() D = 11
Dim suma, PMa, GEg, Dgas As Single End If
suma = 0 For i = 1 To 10
PMa = 0 H(i) = Prof * i
For i = 0 To 10 PH(i) = 0.052 * H(i) * D
fracc(i) = CSng(DataGridView1.Item(1, i).Value) Data.Item (1,i).value+
PM(i) = CSng(DataGridView1.Item(3, i).Value) If PF > PH(10) Then
suma = suma + fracc(i) Tbcom.Text = " no se fractura"
Next ElseIf PF < PH(10) Then
DataGridView1.Item(1, 10).Value = CStr(suma) Tbcom.Text = "se fractura"
If suma = CSng(1) Then End If
For i = 0 To 10 Next
VR(i) = fracc(i) * PM(i) End Sub
PMa = PMa + VR(i) Private Sub Button2_Click()
Next End
Else End Sub
For i = 0 To 9 Private Sub Form1_Load()
NORM(i) = fracc(i) * (1 / suma) Data.ColumnCount = 2
DataGridView1.Item(2, i).Value = NORM(i) Data.RowCount = 10
VR(i) = NORM(i) * PM(i) End Sub
PMa = PMa + VR(i) End Class
PMA Y GEG DATAGRIDVIEW IF Next
DataGridView1.Item(1, 10).Value = suma
If suma = 1 Then
VR(i) = fracc(i) * PM(i)
PMa = PMa + VR(i)
Else
For i = 1 To 9
NORM(i) = fracc(i) * (1 / suma)
VR(i) = PM(i) * NORM(i)
PMa = PMa + VR(i)
DataGridView1.Item(2, i).Value = NORM(i)
DataGridView1.Item(4, i).Value = VR(i)
Next
End If
Public Class Form1 GEg = PMa / 28.97
Dim fracc(9), PM(9), NORM(9), VR(9) As Dgas = GEg / 0.93
Single lbl_pma.Text = CStr(PMa)
Dim i As Integer lbl_geg.Text = CStr(GEg)
Private Sub Form1_Load() End Sub
DataGridView1.ColumnCount = 5 End Class
DataGridView1.RowCount = 11
DataGridView1.Item(0, 1).Value = "H2S" CALCULO DE PRESION INPUTBOX
DataGridView1.Item(0, 2).Value = "CO2"
DataGridView1.Item(0, 3).Value = "C1"
DataGridView1.Item(0, 4).Value = "C2"
DataGridView1.Item(0, 5).Value = "C3"
DataGridView1.Item(0, 6).Value = "C4"
DataGridView1.Item(0, 7).Value = "C5"
DataGridView1.Item(0, 8).Value = "C6"
DataGridView1.Item(0, 9).Value = "C7"
Public Class Form1
DataGridView1.Item(0, 0).Value =
Dim D1, D2, D3, ProfT As Single
"Componente"
Dim N As Integer
DataGridView1.Item(1, 0).Value =
Private Sub Form1
"FRACCION"
D1 = Val(InputBox("Densidad1",
DataGridView1.Item(2, 0).Value =
"Calculo de Presin", ""))
"NORMALIZAR"
D2 = Val(InputBox("Densidad2",
DataGridView1.Item(3, 0).Value = "PM"
"Calculo de Presin", ""))
DataGridView1.Item(4, 0).Value = "VR"
D3 = Val(InputBox("Densidad3",
DataGridView1.Item(0, 10).Value = "sumar"
"Calculo de Presin", ""))
End Sub
ProfT = Val(InputBox("Profundidad",
Private Sub Button1_Click()
"Calculo de Presin", ""))
Dim suma, PMa, GEg, Dgas, s As Single
N = Val(ProfT / 100)
For i = 1 To 9
DG.RowCount = N
fracc(i) = CSng(DataGridView1.Item(1, i).Value)
End Sub
PM(i) = CSng(DataGridView1.Item(3, i).Value)
Private Sub Button1_Click(ByVal sender As
Next
System.Object, ByVal e As System.EventArgs)
suma = 0
Handles Button1.Click
PMa = 0
End Sub
For i = 1 To 9
End Class
suma = suma + fracc(i)
PESO MOLECULAR APARENTE Y GE
Next
For I = 0 To 7 - 1
If SUMA = 1 Then
NORM(I) = FRACC(I)
DataGridView1.Item(3, I).Value = NORM(I)
Else
NORM(I) = FRACC(I) / SUMA
DataGridView1.Item(3, I).Value = NORM(I)
End If
PMNORM(I) = NORM(I) * PM(I)
Public Class Form1 DataGridView1.Item(5, I).Value =
Dim COMP(7) As String PMNORM(I)
Dim PORC(7) As Single SUM = SUM + PMNORM(I)
Dim FRACC(7) As Single SUMPROD = SUM
Dim NORM(7) As Single Next
Dim PM(7) As Single Label1.Text = SUMPROD
Dim PMNORM(7) As Single GE = SUMPROD / 28.97
Dim GE As Single Label2.Text = GE
Dim PMAP As Single End Sub
Dim I As Integer Private Sub Button3_Click( )
Dim SUMA As Single For I = 0 To 7 - 1
Dim SUMAFRACC(7) As Single With DataGridView1()
Dim SUMAPMFRACC As Single .Item(0, I).Value = ""
Dim PMC7 As Single .Item(1, I).Value = ""
Dim SUM As Single .Item(2, I).Value = ""
Dim SUMPROD As Single .Item(3, I).Value = ""
Private Sub Form1 .Item(4, I).Value = ""
DataGridView1.RowCount = 7 .Item(5, I).Value = ""
DataGridView1.ColumnCount = 6 End With
End Sub Next
Private Sub Button1_Click( ) Label2.Text = ""
SUMA = 0 Label1.Text = ""
SUM = 0 End Sub
For I = 0 To 7 - 1 Private Sub Button2_Click()
COMP(I) =CStr(InputBox("INTRODUZCA End
EL COMP"+CStr(I),"","")) End Sub
DataGridView1.Item(0, I).Value = COMP(I) End Class
PM(I) = Val(InputBox("INTRODUZCA EL
PM" +CStr(I), "", ""))
DataGridView1.Item(4, I).Value = PM(I)
PORC(I) = Val(InputBox("INTRO PORCENTA
DEL COMP" + CStr(I), "", ""))
DataGridView1.Item(1, I).Value = PORC(I)
FRACC(I) = PORC(I) / 100
DataGridView1.Item(2, I).Value =
FRACC(I)
SUMAFRACC(I) = SUMA + FRACC(I)
SUMA = SUMAFRACC(I)
FACTOR VOLUMETRICO BG GRADIENTE DE TEMPERATURA

Public Class Form1 Public Class Form1


Dim factor(10) As Single Dim GRAT As Single
Dim presion, factorbg, zeta, temp As Single Dim PROF_F As Single
Dim i As Byte Dim PROF() As Single
Sub calcular() Dim TEMP() As Single
presion = CSng(txt_presion.Text) Dim I As Integer
zeta = CSng(txt_zeta.Text) Dim N As Integer
temp = InputBox("introducir temp. de yac Private Sub Button1_Click()
(F)", "the best", "") GRAT = Val(TextBox1.Text)
temp = temp + 460 PROF_F = Val(TextBox2.Text)
dg.ColumnCount = 3 N = PROF_F / 100
dg.RowCount = 11 ReDim PROF(N)
dg.Item(0, 0).Value = "zeta" ReDim TEMP(N)
dg.Item(1, 0).Value = "presion" DataGridView1.RowCount = N
dg.Item(2, 0).Value = "Bg" DataGridView1.ColumnCount = 2
factorbg = (presion * 520) / (zeta * temp * 14.7) For I = 0 To N - 1
txt_factor.Text = Str(factorbg) PROF(I) = PROF_F - (I * 100)
For i = 1 To 10 DataGridView1.Item(0, I).Value = PROF(I)
factorbg = (presion * 520) / (zeta * temp * 14.7) TEMP(I) = GRAT * PROF(I)
factor(i) = factorbg DataGridView1.Item(1, I).Value = TEMP(I)
dg.Item(2, i).Value = CStr(factor(i)) Next
dg.Item(1, i).Value = presion End Sub
dg.Item(0, i).Value = zeta
presion = presion + 20 Private Sub Button2_Click()
zeta = zeta + 0.01 For I = 0 To N - 1
Next With DataGridView1()
End Sub .Item(0, I).Value = ""
Private Sub btn_calcular_Click() .Item(1, I).Value = ""
Call calcular() End With
End Sub Next
Private Sub btn_finalizar_Click( ) TextBox1.Text = ""
End TextBox2.Text = ""
End Sub End Sub
End Class Private Sub Button3_Click()
End
End Sub
End Class
CALCULO DE LOS GPM Private Sub Button2_Click()
For i = 0 To N - 1
With DataGridView1()
.Item(0, i).Value = ""
.Item(1, i).Value = ""
.Item(2, i).Value = ""
.Item(3, i).Value = ""
.Item(4, i).Value = ""
End With
Next
Public Class Form1 TextBox1.Text = ""
Dim COMP() As String Label4.Text = ""
Dim FM() As Single End Sub
Dim PM() As Single Private Sub Button3_Click()
Dim DENS() As Single End
Dim GPM() As Single End Sub
Dim i As Integer End Class
Dim N As Integer GRADIENTE DE TEMPERATURA
Dim GPMi() As Single
Public Class Form1
Dim GPMT As Single
Dim Gradt As Single
Private Sub Button1_Click(ByVal sender As
Dim Tamb As Single
Object, ByVal e As System.EventArgs) Handles
Dim Proft As Single
Button1.Click
Dim T() As Single
N = Val(TextBox1.Text)
Dim n As Integer
DataGridView1.RowCount = N
Dim i As Integer
DataGridView1.ColumnCount = 5
Dim PROF() As Single
ReDim COMP(N)
Private Sub Button1_Click()
ReDim FM(N)
Gradt = Val(TextBox1.Text)
ReDim PM(N)
Tamb = Val(TextBox2.Text)
ReDim DENS(N)
Proft = Val(TextBox3.Text)
ReDim GPMi(N)
n = Proft / 100
ReDim GPM(N)
ReDim T(n)
For i = 0 To N - 1
ReDim PROF(n)
COMP(i) = CStr(InputBox("INTRODUZCA
DataGridView1.ColumnCount = 2
EL COMP" + CStr(i), "", ""))
DataGridView1.RowCount = n
DataGridView1.Item(0, i).Value = COMP(i)
For i = 0 To n - 1
FM(i) = Val(InputBox("FRACCION
PROF(i) = 100 * i
MOLAR" + CStr(i), "", ""))
T(i) = Gradt * PROF(i) * Tamb
DataGridView1.Item(1, i).Value = FM(i)
DataGridView1.Item(0, i).Value = PROF(i)
PM(i) = Val(InputBox("PESO
DataGridView1.Item(1, i).Value = T(i)
MOLECULAR" + CStr(i), "", ""))
Next
DataGridView1.Item(2, i).Value = PM(i)
End Sub
DENS(i) = Val(InputBox("DENSIDAD"
Private Sub Button2_Click()
+ CStr(i), "", ""))
TextBox1.Text = ""
DataGridView1.Item(3, i).Value = DENS(i)
TextBox2.Text = ""
GPMi(i) = 2.62599999999* (DENS(i) / PM(i))
TextBox3.Text = ""
GPM(i) = GPMi(i) * FM(i)
End Sub
DataGridView1.Item(4, i).Value = GPM(i)
Private Sub Button3_Click()
GPMT = GPMT + GPM(i)
End
Label4.Text = GPMT
End Sub
Next
End Clas
End Sub
FACTOR VOLUMETRICO DEL GAS RUMBO Y AZIMUT

Public Class Form1


Dim BG(0 To 10 - 1) As Single Public Class Form1
Dim PRESION(0 To 10 - 1) As Single Dim RUM As Single
Dim T_YAC As Single Dim AZ As Single
Dim P_YAC As Single Dim POSI As Single
Dim Z_YAC As Single Private Sub Button1_Click()
Dim PSC_Y As Single AZ = Val(TextBox1.Text)
Dim TSC_Y As Single RUM = Val(TextBox2.Text)
Dim I As Integer If AZ <= 90 Then
Private Sub Button1_Click() RUM = AZ
DataGridView1.RowCount = 10 TextBox3.Text = "NOR-ESTE"
P_YAC = Val(TextBox1.Text) ElseIf AZ <= 180 Then
T_YAC = Val(TextBox2.Text) RUM = 180 - AZ
Z_YAC = Val(TextBox3.Text) TextBox3.Text = "SUR-ESTE"
PSC_Y = Val(TextBox4.Text) ElseIf AZ <= 270 Then
TSC_Y = Val(TextBox5.Text) RUM = AZ - 180
For I = 0 To 10 - 1 TextBox3.Text = "SUR-OESTE"
PRESION(I) = (P_YAC) - ((P_YAC / 10) * (I - 1)) ElseIf AZ < 360 Then
BG(I) = Math.Round((PSC_Y * Z_YAC * T_YAC) / RUM = 360 - AZ
(TSC_Y * PRESION(I)), 5) TextBox3.Text = "NOR-OESTE"
DataGridView1.Item(0, I).Value = PRESION(I) ElseIf AZ = 360 Then
DataGridView1.Item(1, I).Value = BG(I) RUM = 360 - AZ
Next TextBox3.Text = "NORTE"
End Sub Else
Private Sub Button2_Click() MsgBox("ERROR")
For I = 0 To 10 - 1 End If
With DataGridView1() TextBox2.Text = RUM
.Item(0, I).Value = "" End Sub
.Item(1, I).Value = "" Private Sub Button2_Click()
End With TextBox1.Text = ""
Next TextBox2.Text = ""
TextBox1.Text = "" TextBox3.Text = ""
TextBox2.Text = "" End Sub
TextBox3.Text = "" Private Sub Button3_Click(ByVal sender As
TextBox4.Text = "" Object, ByVal e As System.EventArgs) Handles
TextBox5.Text = "" Button3.Click
End Sub End
Private Sub Button3_Click() End Sub
End End Class
End Sub
End Class
PESO MOLECU APAREN Y GE RADIO BUTTON PROFUNDI VS PRESION EN FUN GE

Public Class Form1


Public Class Form1
Dim PROF_FINAL As Single
Dim FM(0 To 5 - 1) As Single
Dim PROF() As Single
Dim PM(0 To 5 - 1) As Single
Dim PRESION() As Single
Dim YPM(0 To 5 - 1) As Single
Dim GE_GAS As Single
Dim GED As Single
Dim I As Integer
Dim DENS As Single
Dim N As Integer
Dim PMAP As Single
Private Sub Button1_Click()
Dim SUMAYPM As Single
PROF_FINAL = Val(TextBox1.Text)
Dim I As Integer
GE_GAS = Val(TextBox3.Text)
Private Sub Button1_Click()
N = (PROF_FINAL) / 100
If RadioButton1.Checked = True Then
ReDim PROF(N)
GED = CSng(InputBox("Inrt.laGE del gas","",""))
ReDim PRESION(N)
PMAP = GED * 28.969999999999999
DataGridView1.RowCount = N
DENS = GED * 8.3300000000000001
DataGridView1.ColumnCount = 2
Else
For I = 0 To N - 1
SUMAYPM = 0
PROF(I) = PROF_FINAL - (I * 100)
For I = 0 To 5 1
DataGridView1.Item(0, I).Value = PROF(I)
FM(I) = Val(InputBox("INTRO FM" + Str(I),"",""))
If GE_GAS > 0.80000000000000004 Then
PM(I) = Val(InputBox("INTRO PM" + Str(I), "",
PRESION(I) = (10 / 100) * PROF(I)
""))
Else
YPM(I) = FM(I) * PM(I)
PRESION(I) = (9 / 100) * PROF(I)
Next
End If
PMAP = SUMAYP
DataGridView1.Item(1, I).Value =
DENS = (PMAP / 28.96) * 8.33
PRESION(I)
End If
Next
Label2.Text = "PMaparente=" + Str(PMAP)
End Sub
Label3.Text = "Densidad=" + Str(DENS)
Private Sub Button2_Click()
End Sub
End
Private Sub Button2_Click()
End Sub
Label2.Text = ""
End Class
Label3.Text = ""
End Sub

Private Sub Button3_Click()


End
End Sub
End Class
PM INPUT BOX dg_datos.Item(2, i).Value = mz(i)
Next
lbl_dg.Text = CStr(dg)
lbl_ge.Text = CStr(ge)
lbl_pma.Text = CStr(pma)
End SuB
Private Sub btn_calcular_Click()
Call cargarvalores()
Call calcular()
Public Class Form1 Call mostrar()
Dim frac(), pm(), mz() As Single End Sub
Dim s, pma, ge, dg As Single End Class
Dim i, n As Byte PRESION DE BURBUJA
Sub cargarvalores() Public Class Form1
n = CSng(txt_n.Text) Dim pform As Single
ReDim frac(n) Dim dens As Single
ReDim pm(n) Dim proftot As Single
ReDim mz(n) Dim prof() As Single
For i = 0 To n - 1 Dim psup() As Single
frac(i) = CSng(InputBox("Intro Dim pfondo() As Single
Carbono" + CStr(i), "Peso Molecular", "")) Dim h As Single
pm(i) = CSng(InputBox("introduzca Dim i As Integer
peso Molecular" + CStr(i), "Peso Molecular", Dim intervalo As Single
"")) Private Sub Form1_Load()
Next ReDim psup(10)
End Sub ReDim pfondo(10)
Sub calcular() ReDim prof(10)
pma = 0 DataGridView1.RowCount = 11
s=0 DataGridView1.ColumnCount = 3
For i = 0 To n - 1 End Sub
s = s + frac(i) Private Sub Button1_Click()
Next pform = Val(TextBox1.Text)
If s = 0 Then dens = Val(TextBox2.Text)
Else proftot = Val(TextBox3.Text)
For i = 0 To n - 1 h = proftot
frac(i) = frac(i) * 1 / s intervalo = h / 10
Next For i = 0 To 10
End If prof(i) = proftot - ((proftot / 10) * i)
For i = 0 To n - 1 psup(i) = pform + 0.052 * dens * prof(i)
mz(i) = frac(i) * pm(i) pfondo(i) = pform - (0.052 * dens *
pma = pma + mz(i) (intervalo * (i)))
Next DataGridView1.Item(0, i).Value = prof(i)
ge = pma / 28.97 DataGridView1.Item(1, i).Value = psup(i)
dg = ge * 1.013 DataGridView1.Item(2, i).Value =
End Sub pfondo(i)
Sub mostrar() Next
dg_datos.ColumnCount = 3 End Sub
dg_datos.RowCount = n Private Sub Button2_Click()
For i = 0 To n - 1 End
dg_datos.Item(0, i).Value = frac(i) End Sub
dg_datos.Item(1, i).Value = pm(i) End Class
PMA Y DENSIDAD DEL GAS INPUTBOX
Next
PMAP = SUMAYPM
DENS = (PMAP / 28.96) * 8.33
Label2.Text = "PMaparente" + Str(PMAP)
Label3.Text = "Densidad" + Str(DENS)
End Sub
End Class

VELOCIDAD DE FLUJO IMPUTBOX


Public Class Form1
Dim Q, ID, OD, DM, VF As Single
Public Class Form1 Dim interior, anular As String
Dim FM(0 To 10 - 1) As Single Private Sub Form1_Load()
Dim NORM(0 To 10 - 1) As Single ID = Val(InputBox("ID", "calculo de VF", ""))
Dim PM(0 To 10 - 1) As Single Q = Val(InputBox("coloque caudal")) VF =
Dim YPM(0 To 10 - 1) As Single Val(InputBox("VELOCIDAD DE FLUJO", "VF",
Dim DENS As Single (Q /(3.1456 * 0.25 * ID ^ 2))))
Dim PMAP As Single End Sub
Dim SUMAFM As Single End Class
Dim SUMAYPM As Single
Dim I As Integer

Private Sub Button1_Click()


SUMAFM = 0
For I = 0 To 10 - 1
FM(I) = Val(InputBox("INTR la FM del C" +
CStr(I), "", ""))
PM(I) = Val(InputBox("INTR la PM del C" +
CStr(I), "", ""))
SUMAFM = SUMAFM + FM(I)
Next
If SUMAFM = 1 Then
For I = 0 To 10 - 1
NORM(I) = FM(I)
Next
Else
For I = 0 To 10 - 1
NORM(I) = FM(I) / SUMAFM
Next
End If
SUMAYPM = 0
For I = 0 To 10 - 1
YPM(I) = NORM(I) * PM(I)
SUMAYPM = SUMAYPM + YPM(I)

You might also like