You are on page 1of 9

Dr Yousif Hummaida Ahmed

Gauss-Jordan Elimination for Solving Simultaneous Linear Equations

Consider a set of 4 linear equations, the first equation has coefficients a11, a12,a13, a14
corresponding to independent variables x1, x2, x3 and x4 and the constant on RHS is a15
respectively , the remaining equations as follows:

a 11 x 1+ a12 x 2+ a13 x 3+a 14 x 4=a 15

a 21 x 1+a 22 x 2+a 23 3+a 24 x 4=a25

a 31 x 1+a 32 x 2+a 33 3+a 34 x 4=a 35

a 41 x 1+ a 42 x 2+a 43 3+ a 44 x 4=a 45

NB We need a set of 4 simultaneous linear equations to solve for 4 independent variables

Step 1

Arrange your coefficients in a matrix (say matrix A) as follows

a 11 a 12 a 13 a 14 a 15−−−−( a1)

a 21 a 22 a 23 a 24 a 25−−−−(a2)

a 31 a 32 a33 a34 a 35−−−−(a 3)

a 41a 42 a 43 a 44 a 45−−−−( a5)

The first elimination is obtained by dividing equation (a1) by the coefficient of variable x1 (i.e. the
pivot= a11) to obtain first row of matrix (B)

1 b 12b 13 b 14 b 15−−−−(b 1)

Where b12= a12/a11, b13= a13/a11 , b14= a14/a11 and b15=a15/a11

(1st elimination is concerned with coefficients of column 1 of original matrix multiplied by first row
of Matrix B)

The second row of matrix (B) is obtained by subtracting a21 * (first row of matrix (B) ; i.e. equation
b1) from the corresponding values of equation (a2) as follows:

b21= a21-a21*(b11=1)=0, b22=a22-a21*b12, b23=a23- * a21*b13, b24=a24-a21*b14 and b25=a25-


a21*b15 to result in:

0 b 22 b 23 b 24 b 25−−−−(b 2)

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

The third row of matrix (B) is obtained by subtracting a31 * (first row of matrix (B) ; i.e. equation b1)
from the corresponding values of equation (a3) as follows:

b31= a31-a31*(b11=1)=0, b32=a32-a31*b12, b33=a33-a31*b13, b34=a34-a31*b14 and b35=a35-


a31*b15 to result in:

0 b 32 b 33 b 34 b 35−−−−( b 3)

The 4th row of matrix (B) is obtained by subtracting a41 * (first row of matrix (B) ; i.e. equation b1)
from the corresponding values of equation (a4) as follows:

B41= a41-a41*(b11=1)=0, b42=a42-a41*b12, b43=a43-a41*b13, b44=a44-a41*b14 and b45=a45-


a41*b15 to result in:

0 b 42b 43 b 44 b 45−−−−(b 4)

The matrix (B) construction is linked to 1 st elimination which is obtained by first calculating 1 st row of
matrix (B) and then use coefficients of 1 st column of matrix (A) (a21, a31 and a41) as fixed
multipliers to 1st row of matrix (B) to obtain 2nd, 3rd and 4th rows of it, the resultant matrix (B) is :

1 b 12b 13 b 14 b 15−−−−(b 1)

0 b 22 b 23 b 24 b 25−−−−(b 2)

0 b 32 b 33 b 34 b 35−−−−( b 3)

0 b 42b 43 b 44 b 45−−−−(b 4)

The 2nd elimination is started by using equation b2 as pivotal equation divided by its pivot b22 to
obtain equation c2 as follows:

0 1 c 23 c 24 c 25−−−−(c 2)

Where c23 = b23/b22, c24= b24/b22 and c25=b25/b22

The construction of 1st, 3rd and 4th rows of matrix (C) is obtained by using coefficients of 2 nd column of
matrix (B) (b12, b32 and b42) as fixed multipliers to 2st row of matrix (C) and subtracting it from
corresponding values of matrix (B) to obtain 1 st , 3rd and 4th rows of Matrix C, as follows:

The 1st row of matrix (C) is obtained by subtracting b12 * (2 nd row of matrix (C) ; i.e. equation c2)
from the corresponding values of equation (b1) as follows:

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

c11= b11(=1)-b12*(C21=0)=1, c12=b12-b12*(c22=1) = 0, c13=b13-b12*c23, c14=b14-b12*c24 and


c15=b15-b12*c25 to result in:

1 0 c 13 c 14 c 15−−−−(c 1)

The 3rd row of matrix (C) is obtained by subtracting b32 * (2 nd row of matrix (C) ; i.e. equation c2)
from the corresponding values of equation (b3) as follows:

C31= b31(=0)-b32*(C21=0)=0, c32=b32-b32*(c22=1) = 0, c33=b33-b32*c23, c14=b14-b12*c24 and


c15=b15-b12*c25 to result in:

0 0 c 33 c 34 c 35−−−−( c 3)

The 4th row of matrix (C) is obtained by subtracting b42 * (2 nd row of matrix (C) ; i.e. equation c2)
from the corresponding values of equation (b4) as follows:

C41= b41(=0)-b42*(C21=0)=0, c42=b42-b42*(c22=1) = 0, c43=b43-b42*c23, c14=b14-b12*c24 and


c15=b15-b12*c25 to result in:

0 0 c 43 c 44 c 45−−−−(c 4)

The resultant matrix (C) is:


1 0 c 13 c 14 c 15−−−−(c 1)

0 1 c 23 c 24 c 25−−−−(c 2)

0 0 c 33 c 34 c 35−−−−( c 3)

0 0 c 43 c 44 c 45−−−−(c 4)

The 3rd elimination is started by using equation c3 as pivotal equation and divide by the pivot c33 to
obtain equation d3 as follows:

0 0 1 d 34 d 35−−−−(d 3)

Where d34 =c34/c33 and d35= c35/c33

The construction of 1st, 2nd and 4th rows of matrix (D) is obtained by using coefficients of 3 nd column
of matrix (C) (c13, c23 and b43) as fixed multipliers to 3rd row of matrix (D) and subtracting it from
corresponding values of matrix (C) to obtain 1 st , 3rd and 4th rows of Matrix C respectively.

The 1st row of matrix (D) is obtained by subtracting c13 * (3 rd row of matrix (D) ; i.e. equation d3)
from the corresponding values of equation (c1) as follows:

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

d11= c11(=1)-c13*(d31=0)=1, d12=c12(=0)-c13*(d32=0) = 0, d13=c13-c13*(d33=1)=0, d14=c14-


c13*d34 and d15=c15-c13*d35 to result in:

1 0 0 d 14 d 15−−−−(d 1)

The 2st row of matrix (D) is obtained by subtracting c23 * (3 rd row of matrix (D) ; i.e. equation d3)
from the corresponding values of equation (c3) as follows:

d21= c21(=0)-c23*(d31=0)=0, d22=c22(=1)-c23*(d32=0) = 1, d23=c23-c23*(d33=1)=0, d24=c24-


c23*d34 and d25=c25-c23*d35 to result in:

0 1 0 d 24 d 25−−−−(d 2)

The 4th row of matrix (D) is obtained by subtracting c43 * (3 rd row of matrix (D) ; i.e. equation d3)
from the corresponding values of equation (c4) as follows:

d41= c41(=0)-c43*(d31=0)=0, d42=c42(=0)-c43*(d32=0) = 0, d43=c43-c43*(d33=1)=0, d44=c44-


c43*d34 and d45=c45-c43*d35 to result in:

0 0 0 d 44 d 45−−−−(d 4)

The resultant matrix D is:

1 0 0 d 14 d 15−−−−(d 1)

0 1 0 d 24 d 25−−−−(d 2)

0 0 1 d 34 d 35−−−−(d 3)

0 0 0 d 44 d 45−−−−(d 4)

The 4th elimination is started by using equation d4 as pivotal equation and divide by the pivot d44 to
obtain equation e4 as follows:

0 0 0 1 e 45−−−−(e 4)

The construction of 1st, 2nd and 3rd rows of matrix (e) is obtained by using coefficients of 4 th column
of matrix (D) (d14, d24 and d34) as fixed multipliers to 4th row of matrix (E) and subtracting it from
corresponding values of matrix (D) to obtain 1 st , 2nd and 3rd rows of Matrix E respectively.

The 1st row of matrix (E) is obtained by subtracting d14 * (4 th row of matrix (E) ; i.e. equation e4)
from the corresponding values of equation (d1) as follows:

e11= d11(=1)-d14*(e41=0)=1, e12=d12(=0)-d14*(e42=0) = 0, e13=(d13=0)-d14*(d43=0)=0,


e14=d14=0-d14*(e44 =1) and e15=d15-d14*e45 to result in:

1 0 0 0 e 15−−−−( e 1)

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

The 2nd row of matrix (E) is obtained by subtracting d24 * (4 th row of matrix (E) ; i.e. equation e4)
from the corresponding values of equation (d2) as follows:

e21= d21(=0)-d24*(e41=0)=0, e22=d22(=1)-d24*(e42=0) = 1, e23=(d23=0)-d24*(d43=0)=0, e24=d24-


d24*(e44 =1) =0 and e25=d25-d24*e45 to result in:

0 1 0 0 e 25−−−−(e 2)

The 3nd row of matrix (E) is obtained by subtracting d34 * (4 th row of matrix (E) ; i.e. equation e4)
from the corresponding values of equation (d3) as follows:

e31= d31(=0)-d34*(e41=0)=0, e32=d32(=0)-d34*(e42=0) = 0, e33=(d33=1)-d34*(d43=0)=1, e34=d34-


d34*(e44 =1) =0 and e25=d35-d34*e45 to result in:

0 0 1 0 e 35−−−−(e 3)

The elements of the 5th column of Matrix (E) is the solution for x1, x2, x3 and x4 (observe that it
diagonal elements =1 for the first 4 column and all other elements =0 apart from the):

1 0 0 0 e 15−−−−( e 1)

0 1 0 0 e 25−−−−(e 2)

0 0 1 0 e 35−−−−(e 3)

0 0 0 1 e 45−−−−(e 4)

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

Matrix displacement Method of Truss Analysis

Notation X1 for Global horizontal displacement (X) and X2 for Global vertical displacement (Y)
corresponding to local node denoted 1, however, I prefer to denote ∆x m ∆ym corresponding to
local end 1 and ∆xn ∆yn corresponding to local end 2, where X and Y are global axes and m and n
denotes the Global number of nodes corresponding to local nodes 1 and 2 respctively.

Degree of freedoms= number of unknown unrestrained displacement of the joints= N(umber) which
a structure can exercise to show its displeasure or technically named deformation response

Number of independent forces in members for trusses=NF = number of members

Number of reactions =NR (note Reactions are dependent on Fs, thus could be computed /calculated
from from equilibrium of joints at supports), for hand computation the equilibrium of the joints
where reaction are unknown yt the displacement are known could be neglected or not considered

Number of joints = NJ

Number of indeterminacy =NI= NF+NR-2NJ

Static or physics state for a truss, 2NJ=NP+NR

NI= NF+NR-2NJ=NF+NR-NP-NR=

Local and global axes

Local axes are parallel and perpendicular to each member; this depends on the inclination of the
member to the X -Y Global axes

For local axes usually denoted by +ve direction (small x) from node 1 to node 2 and small y-axis
which is perpendicular to x-axis, i.e. to the member.

The deformation matrix: denoted matrix B of a truss expresses the elongation in the member (NF) in
terms of the joints free displacement (NP);NB known displacement are not included for hand
computations, but could be set for computer programming, B size for the whole structure is NFxNP

eNFx1 = BNFxNP XNPx1

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

1 α

To fulfil definition of a truss loads can be applied only at the joints. Then at a maximum , there can
be both horizontal and vertical forces applied to every joint in a truss. Although forces applied in any
direction at a hinged support or applied in a direction perpendicular to the rolling surface of a roller
support, will not affect forces in the bars or the deformed shape of the truss. Thus there can be a
non zero force in the direction of every degree of freedom and the external force system can be
expressed by a column matrix with number of rows = degree of freedoms denoted NP,
mathematically speaking there is a one-to-one correspondence between the Ps and Xs.

5.2 [ID] Matrix


4 Because of the boundary condition restraints, the total structure number of active degrees of freedom
(i.e unconstrained) will be less than the number of nodes times the number of degrees of freedom per
node.
5 To obtain the global degree of freedom for a given node, we need to define an [ID] matrix

such that:
ID has dimensions l × k where l is the number of degree of freedom per node, and k is the
number of nodes).
ID matrix is initialized to zero.
1. At input stage read ID(idof,inod) of each degree of freedom for every node such that:
ID(idof, inod) = _ 0 if unrestrained d.o.f.
1 if restrained d.o.f.
(5.1)
2. After all the node boundary conditions have been read, assign incrementally equation
numbers
(a) First to all the active dof
(b) Then to the other (restrained) dof.
(c) Multiply by -1 all the passive dof.
Note that the total number of dof will be equal to the number of nodes times the number
of dof/node NEQA.
3 . The largest positive global degree of freedom number will be equal to NEQ (Number Of
Equations), which is the size of the square matrix which will have to be decomposed.

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

For example, for the frame shown in Fig. 5.1:


1. The input data file may contain:
Victor Saouma Matrix Structural Analysis

D r af t5.3
Node No. [ID]T
LM V ect or 5–3

1000
2110
3000
4100
2. At this stage, the [ID] matrix is equal to:
ID = 
0101
0100
0000

(5.2)
3. After we determined the equation numbers, we would have:
ID = 
1 −10 5 −12
2 −11 6 8
3479

(5.3)
5.3 LM Vector
7The LM vector of a given element gives the global degree of freedom of each one of the element
degree of freedom’s. For the structure shown in Fig. 5.1, we would have:
_LM_ = _ −10 −11 4 5 6 7 _ element 1 (2 → 3)
_LM_ = _ 5 6 7 1 2 3_ element 2 (3 → 1)
_LM_ = _ 1 2 3 −12 8 9 _ element 3(1 → 4)

5.4A ssembly of Global Stiffness Matrix


8 As for the element stiffness matrix, the global stiffness matrix [K] is such that Kij is the force
in degree of freedom i caused by a unit displacement at degree of freedom j.
9 Whereas this relationship was derived from basic analysis at the element level, at the structure

level, this term can be obtained from the contribution of the element stiffness matrices [Ke]
(written in global coordinate system).
10 For each Kij term, we shall add the contribution of all the elements which can connect degree

of freedom i to degree of freedom j, assuming that those forces are readily available from the
individual element stiffness matrices written in global coordinate system.
11 Kij is non-zero if and only if degree of freedom i and degree of freedom j are connected by

an element or share a node.


12 There are usually more than one element connected to a dof. Hence, individual element

stiffness matrices terms must be added up.

Because each term of all the element stiffness matrices must find its position inside the global
stiffness matrix [K], it is found computationally most effective to initialize the global stiffness
matrix [KS]NEQA×NEQA to zero, and then loop through all the elements, and then through
each entry of the respective element stiffness matrix Ke
ij .
14 The assignment of the element stiffness matrix term Ke

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street
Dr Yousif Hummaida Ahmed

ij (note that e, i, and j are all known


since we are looping on e from 1 to the number of elements, and then looping on the rows and
columns of the element stiffness matrix i, j) into the global stiffness matrix KS
kl is made through
the LM vector (note that it is k and l which must be determined).
15 Since the global stiffness matrix is also symmetric, we would need to only assemble one side

of it, usually the upper one.


16 Contrarily to Matrix Structural Analysis, we will assemble the full augmented stiffness matrix.

17 The algorithm for this assembly is illustrated in Fig. 5.2.

Example 5-1: Global Stiffness Matrix Assembly


Assemble the global stiffness matrix in terms of element 2 and 3of the example problem
shown in Fig. 5.1.

Solution:
Given the two elements 2 and 3, their respective stiffness matrices in global coordinate systems may
be symbolically represented by:
5 6 7 1 2 3 → structure d.o.f. LM
1 2 3 4 5 6 → element d.o.f.
51abcdef
62ghijk
[Ke
2] = 7 3 l m n o
14pqr
25st
36u
and
1 2 3 -12 8 9 → structure d.o.f. LM
1 2 3 4 5 6 → element d.o.f.
11ABCDEF
22GHIJK
[Ke
3] = 33 L M N O
-12 4 P Q R
85ST
96U

Structures and Materials Section, Civil Engineering Department, Faculty of Engineering, University of
Khartoum, Sudan, P.O.Box 321, Osman Digna Street

You might also like