You are on page 1of 6

Public Class Form1

Dim B, T, B1, TS, A, C, Y, CY, M, N, V, D, O, P, Q, R, X, ee As Decimal


Dim J, H, L, I, F, S, G, W, Z, AV, SV, S1, Y1, Ec, Es, Factor, Wc As Decimal
Dim Filename As String
Dim XI, U, A1 As Decimal

Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As


System.EventArgs)

End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal


e As System.EventArgs) Handles Secty.SelectedIndexChanged
If Secty.Text = "Rectangular" Then
Webbreadth.Visible = False
FlangeDepth.Visible = False
Label21.Visible = False
Label19.Visible = False
Label20.Visible = False
Label18.Visible = False
End If

If Secty.Text = "Flanged" Then


Webbreadth.Visible = True
FlangeDepth.Visible = True
Label21.Visible = True
Label19.Visible = True
Label20.Visible = True
Label18.Visible = True
End If
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button1.Click
B1 = Val(Webbreadth.Text)
T = Val(TotalDepth.Text)
B = Val(TotalBreadth.Text)
TS = Val(FlangeDepth.Text)
A = Val(TensionA.Text)
C = Val(TensionCover.Text)
Y = Val(CompressionA.Text)
CY = Val(CompressionCover.Text)
M = Val(SMoment.Text)
V = Val(ServiceN.Text)

If Secty.Text = "Rectangular" Then


B1 = 0 : TS = 0
Webbreadth.Visible = False
FlangeDepth.Visible = False
Label21.Visible = False
Label20.Visible = False
Label18.Visible = False
End If
N = 8
V = -V
D = T - C
' ANALYSIS OF CONCRETE SECTION TO GET STREESES
'
If Secty.Text = "Flanged" Then GoTo 490
If (V = 0) Then GoTo 320
If (V > 0) Then GoTo 200
V = -V
ee = M / V * 100 + T / 2 - C
O = 1
P = (ee - D) * 3
Q = 6 * N / B * (A * ee + Y * (ee - D + C))
R = -6 * N / B * (A * ee * D + Y * (ee - D + C) * C)
Solution()
If (X < T) Then GoTo 160
J = N * (A - Y) * (T / 2 - C)
H = B * T + N * (A + Y)
L = J / H
I = B * T ^ 3 / 12 + B * T * L ^ 2 + N * A * (T / 2 - C - L) ^ 2 + N * Y *
(T / 2 - C + L) ^ 2
F = V * 1000 / H + V * 1000 * (M / V * 100 + L) * (T / 2 + L) / I
S = V * 1000 / H - V * 1000 * (M / V * 100 + L) * (T / 2 + L) / I
150: G = (S + (F - S) * C / T) * N
W = (S + (F - S) * D / T) * N
GoTo 3000
160: Z = V * ee * 1000
F = Z * X / (B * X ^ 2 / 2 * (D - X / 3) + N * (X - C) * Y * (D - C))
165: W = F * (X - C) / X * N
G = -F * (D - X) / X * N
S = (X - T) / X * F
GoTo 3000
200: ee = M / V * 100 - T / 2 + C
O = 1
P = -3 * (ee + D)
Q = -6 * N / B * (A * ee + Y * (ee + D - C))
R = 6 * N / B * (A * ee * D + Y * (ee + D - C) * C)
Solution()
If (X <= T) Then GoTo 160
210: L = T / 2 + M / V * 100 - C
H = T / 2 - M / V * 100 - C
G = -V * L * 1000 / (D - C) / A
W = -V * H * 1000 / (D - C) / Y
F = (W + (G - W) * D / (D - C)) / N
S = (W - (G - W) * C / (D - C)) / N
GoTo 3000
320: X = -N * (A + Y) / B + ((N * (A + Y) / B) ^ 2 + 2 * N / B * (A * D + Y *
C)) ^ 0.5
F = M * 10 ^ 5 / (B * X / 2 * (D - X / 3) + N * Y * (X - C) / X * (D - C))
GoTo 165
490: If V = 0 Then GoTo 700
If V > 0 Then GoTo 600
500: V = -V
ee = M / V * 100 + T / 2 - C
O = 1
P = 3 * (ee - D)
Q = 6 * N / B1 * (A * ee + Y * (ee - D + C))
R = -6 * N / B1 * (A * ee * D + Y * (ee - D + C) * C)
Solution()
If (X > TS) Then GoTo 560
540: Z = V * ee * 1000
F = Z * X / (B1 * X ^ 2 / 2 * (D - X / 3) + N * (X - C) * Y * (D - C))
GoTo 165
560: O = 1
P = P + 6 * B1 * TS / B
Q = Q - 6 / B * (TS ^ 2 / 2 * (B1 + B) + TS * (B - B1) * (ee - D) + B1 *
TS)
R = R - ((B1 - 4 * B) * TS ^ 3 / 12 + (B1 - B) * TS ^ 2 / 2 * (ee - D) - B1
* TS ^ 2 / 2)
Solution()
If (X > T) Then GoTo 580
570: Z = V * ee * 1000
575: Y1 = TS / 3 * (3 * X - 2 * TS) / (2 * X - TS)
F = (1 + (X - TS) / X) / 2 * TS * B1 * (D - Y1) + (X - TS) ^ 2 / 2 / X * B
* (D - (X + 2 * TS) / 3)
F = F + N * Y * (X - C) / X * (D - C)
F = Z / F
GoTo 165
580: AV = B1 * TS + (T - TS) * B + N * (A + Y)
SV = (B1 - B) * TS * (T - TS) / 2 - N * (A - Y) * (T / 2 - C)
S1 = SV / AV
I = B1 * T ^ 3 / 12 + (B1 - B) * TS ^ 3 / 12 + (B1 - B) * TS * (T - TS) ^ 2
/ 4
I = I + (B * (T - TS) + B1 * TS) * S1 ^ 2 + N * A * (T / 2 - C + S1) ^ 2 +
N * Y * (T / 2 - C - S1) ^ 2
F = V * 1000 / AV + V * (M / V * 100 - S1) * (T / 2 - S1) / I
F = V * 1000 / AV - V * (M / V * 100 - S1) * (T / 2 - S1) / I
GoTo 150
600: ee = M / V * 100 - T / 2 + C
O = 1
P = -3 * (ee + D)
Q = -6 * N / B1 * (A * ee + Y * (ee + D - C))
R = 6 * N / B1 * (A * ee * D + Y * (ee + D - C) * C)
Solution()
If (X <= TS) Then GoTo 540
O = 1
P = P + 6 * B1 * TS / B
Q = Q - 6 / B * (TS ^ 2 / 2 * (B1 + B) + TS * (B1 - B) * (ee + D) + B * TS)
R = R - 6 / B * ((B1 - 4 * B) * TS ^ 3 / 12 - (B1 - B) * TS ^ 2 / 2 * (ee +
D) - B * TS ^ 2 / 2)
Solution()
If (X > T) Then GoTo 210
GoTo 570
700: X = -N * (A + Y) / B1 + ((N * (A + Y) / B1) ^ 2 + 2 * N / B1 * (A * D + Y *
C)) ^ 0.5
If (X > TS) Then GoTo 740
F = M * 10 ^ 5 / (B1 * X / 2 * (D - X / 3) + N * Y * (X - C) / X * (D - C))
GoTo 165
740: X = (B1 * TS ^ 2 / 2 + N * A * D + N * Y * C) / (B1 * TS + N * (A + Y))
Z = M * 10 ^ 5
GoTo 575
Solution()
3000:
SaveFileDialog1.ShowDialog()
MessageBox.Show("Results Created !!!", "Done !!")

End Sub

Sub Solution()
Dim J As Integer
Z = R
If Z = 0 Then GoTo 1005
W = Z / Math.Abs(Z)
GoTo 1010
1005: W = 0
1010: X = 0.0
H = 10.0
For J = 1 To 7
For II = 1 To 20
XI = X + H * II
S = O * XI ^ 3 + P * XI ^ 2 + Q * XI + R
If (S = 0) Then GoTo 1050
U = S / Math.Abs(S)
GoTo 1055
1050: U = 0.0
1055: A1 = U + W
If A1 = 0 Then GoTo 1080
1060: Next II
1080: X = XI - H
H = H / 10.0
Z = O * X ^ 3 + P * X ^ 2 + Q * X + R
If Z = 0 Then GoTo 1090
W = Z / Math.Abs(Z)
GoTo 2000
1090: W = 0
2000: Next J
End Sub

Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As


System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
Dim FileSaveAs As String = SaveFileDialog1.FileName
Dim objwriter As New System.IO.StreamWriter(FileSaveAs)

objwriter.WriteLine(" .....................................................
")
objwriter.WriteLine(" .
.")
objwriter.WriteLine(" . ELASTIC ANALYSIS OF RC SECTION V 0.0
.")
objwriter.WriteLine(" .
.")
objwriter.WriteLine(" .
.")

objwriter.WriteLine(" .....................................................
")
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine(" INPUT DATA :")
objwriter.WriteLine(" ============")
objwriter.WriteLine("")
objwriter.WriteLine(" SIGN CONVENTION :")
objwriter.WriteLine("")
objwriter.WriteLine(" + Ve For Compression (Forces and Stresses)")
objwriter.WriteLine(" - Ve For Tension (Forces and Stresses)")
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine(" MODULAR RATIO ( Es/Ec ) =
" & Format(N, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine(" STRAINING ACTIONS :")
objwriter.WriteLine(" ===================")
objwriter.WriteLine("")
objwriter.WriteLine(" APPLIED SERVICE MOMENT ( MS ) ( Ton.m) =
" & Format(M, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" APPLIED SERVICE NORMAL FORCE ( NS ) ( Ton ) =
" & Format(-V, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine(" SECTION PROPERTIES :")
objwriter.WriteLine(" ====================")
objwriter.WriteLine("")
objwriter.WriteLine(" SECTION TYPE = " & Secty.Text)
objwriter.WriteLine("")
objwriter.WriteLine(" SECTION BREADTH ( Cm ) =
" & Format(B, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" SECTION HEIGHT ( Cm ) =
" & Format(T, "Fixed"))
objwriter.WriteLine("")
If Secty.Text = "Flanged" Then
objwriter.WriteLine(" FLANGE BREADTH
( Cm ) = " & Format(B1, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" FLANGE HEIGHT
( Cm ) = " & Format(TS, "Fixed"))
objwriter.WriteLine("")
End If
objwriter.WriteLine(" TENSION STEEL AREA ( Cm 2) =
" & Format(A, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" COMPRESSION STEEL AREA ( Cm 2) =
" & Format(Y, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" CONCRETE COVER TO C.G. OF TENSION REINF. ( Cm ) =
" & Format(C, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" CONCRETE COVER TO C.G. OF COMPRES.REINF. ( Cm ) =
" & Format(CY, "Fixed"))
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine(" RESULTS :")
objwriter.WriteLine(" =========")
objwriter.WriteLine("")
objwriter.WriteLine("")
objwriter.WriteLine(" NEUTRAL AXIS DEPTH ( Cm ) =
" & Format(X, "fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" TOP OF CONCRETE STRESS ( Kg / Cm 2 ) =
" & Format(F, "fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" BOTTOM OF CONCRETE STRESS ( Kg / Cm 2 ) =
" & Format(S, "fixed"))
objwriter.WriteLine("")
objwriter.WriteLine(" BOTTOM REINFORCEMENT STRESS ( Kg / Cm 2 ) =
" & Format(G, "fixed"))
objwriter.WriteLine("")
If Y <> 0 Then
objwriter.WriteLine(" TOP REINFORCEMENT STRESS ( Kg / Cm
2 ) = " & Format(W, "fixed"))
objwriter.WriteLine("")
End If
objwriter.WriteLine("")
objwriter.Close()
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As


System.EventArgs) Handles Button2.Click
End
End Sub
End Class