You are on page 1of 6

Structural Engineering

Lab
Visual Basic Project for solution of 4 variables simultaneous
Equations

Submitted By :

Submitted To:

M Umar Ramzan
2008-civil-54

Sir Asad Gillani

Private Sub Command1_Click()


Dim a11 As Integer, a12 As Integer, a13 As Integer, a14 As Integer, a15 As Integer,
a21 As Integer, a22 As Integer, a23 As Integer, a24 As Integer, a25 As Integer, a31
As Integer, a32 As Integer, a33 As Integer, a34 As Integer, a35 As Integer, a41 As
Integer, a42 As Integer, a43 As Integer, a44 As Integer, a45 As Integer
Text1.Text = a11
Text2.Text = a12
Text3.Text = a13
Text4.Text = a14
Text5.Text = a15
Text6.Text = a21
Text7.Text = a22
Text8.Text = a23
Text9.Text = a24
Text10.Text = a25
Text11.Text = a31

Text12.Text = a32
Text13.Text = a33
Text14.Text = a34
Text15.Text = a35
Text16.Text = a41
Text17.Text = a42
Text18.Text = a43
Text19.Text = a44
Text20.Text = a45
b15 = 1
b12 = (a12 / a15)
b13 = a13 / a15
b14 = a14 / a15
b25 = a25 * a15 - a25
b22 = a22 * a12 - a22
b23 = a23 * a13 - a23
b24 = a24 * a14 - a24
b35 = a35 * a15 - a35
b32 = a32 * a12 - a32
b33 = a33 * a13 - a13
b34 = a34 * a14 - a34
b45 = a45 * a15 - a45
b42 = a42 * a12 - a42
b43 = a43 * a13 - a43
b44 = a44 * a14 - a44
c11 = 1

c12 = a12 / a11


c13 = a13 / a11
c14 = a14 / a11
c21 = a21 * a11 - a21
c22 = a22 * a12 - a22
c23 = a23 * a13 - a23
c24 = a24 * a14 - a24
c35 = a31 * a11 - a31
c32 = a32 * a12 - a32
c33 = a33 * a13 - a13
c34 = a34 * a14 - a34
c45 = a41 * a15 - a41
c42 = a42 * a12 - a42
c43 = a43 * a13 - a43
c44 = a44 * a14 - a44
a = b33 * b44 - b34 * b43
b = b32 * b44 - b34 * b42
c = b32 * b43 - b33 * b42
l = c33 * c44 - c34 * c43
m = c32 * c44 - c34 * c42
n = c32 * c43 - c33 * c42
d1 = b22 * a - b23 * b + b24 * c
d11 = c22 * l - c23 * m + c24 * n
X1 = d1 / d11
d = a33 * a44 - a34 * a43
e = (a35 - (a31 * X1)) * a44 - (a45 - (a41 * X1) * aa34)

f = (a35 - (a31 * X1) * a43) - (a45 - (a41 * X1) * a33)


p = a33 * a44 - a34 * a43
q = a32 * a44 - a34 * a42
r = a32 * a43 - a33 * a42
d2 = (a25 - a21) * d - a23 * e + a24 * f
d21 = a22 * p - a23 * q + a24 * f
X2 = d2 / d21
g = ((a35 - (a31 * X1) - (a32 * X2)) * a44) - (a45 - (a41 * X1) - (a42 * X2)) * a44
s = (a32 * a44) - (a42 * a34)
x3 = g / s
x4 = (a15 / a14) - (a11 / a14) * X1 - (a12 / 14) * X2 - (a13 / a14) * x3
X1 = Text21.Text
X2 = Text22.Text
x3 = Text23.Text
x4 = Text24.Text
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""

Text10.Text = ""
Text11.Text = ""
Text12.Text = ""
Text13.Text = ""
Text14.Text = ""
Text15.Text = ""
Text16.Text = ""
Text17.Text = ""
Text18.Text = ""
Text19.Text = ""
Text20.Text = ""
End Sub
Private Sub Command3_Click()
End
End Sub

You might also like