Planar Trusses Solution Via Numerical Method
Planar Trusses Solution Via Numerical Method
METHOD
SKMM3032
PROJECT REPORT
“PLANAR TRUSSES”
NAME : NURIZZATI BINTI ROSLAN
IC NUMBER : 951105016716
MATRIC NUMBER : A14KM0176
SECTION :7
FACULTY : FACULTY OF MECHANICAL ENGINEERING
LECTURER’S NAME : DR MASTURA BINTI ABDUL WAHID
0
CONTENT
1.0 INTRODUCTION 2
2.0 OBJECTIVES 3
3.0 PROBLEM STATEMENTS 4
4.0 MATLAB: LU DECOMPOSITION METHOD 6
5.0 MATLAB: GAUSS ELIMINATION METHOD 8
6.0 METHODOLOGY 9
6.1 ALGORITHM 9
6.2 FLOWCHART 14
7.0 RESULTS 16
8.0 ANALYSIS AND DISCUSSIONS 17
8.1 VERIFICATION PROCESS 17
8.2 EXPECTED RESULT 20
8.3 COMPARISON OF CHOSEN METHOD 22
9.0 CONCLUSION 25
10.0 REFERENCES 26
APPENDIX 27
1
1.0 INTRODUCTION
“Trusses” is one of the engineering analysis that involves a lot of calculation.
A truss can be defined as a structure that is composed of slender members, which is two-force-
members, joined together at their end points. Joints are modelled by smooth pin connections.
The trusses members are either under tension due to tensile force or compression due to
compressive load. Trusses are used extensively in building such as airport terminal and aircraft
hangar which required really long span. Pylon tower and bridge are also the application of the
planar trusses. The purposes of using trusses are to provide longitudinal stability and carry the
load that is applied to them.
During the analysis of trusses, when all the trusses members are in one plane, it
is called planar. In this report, we are going to solve a problem which related to planar trusses.
The basic element in planar trusses is the triangle shape made up of 3 members. The 3 members
are joined by pins at their ends constitute a rigid frame. In this case, the structures are extended
about another 8 members that formed 5 rigid triangle shape. Since the length of each member
are the same, hence this trusses are in geometrically similar, which means if the trusses having
the same external load applied, the forces at each member are the equal. In this case, there is
only load for the vertical axis and zero force on the horizontal axis.
Another important concept that we need to look close is either the trusses is in
statically determinate or indeterminate. A truss is said to be rigid and statically determinate,
when the number of members, m along with the number of joints, j satisfies the equation of
𝑚 = 2𝑗 − 3, while if the truss is statically indeterminate it will gives the results as 𝑚 < 2𝑗 − 3
and 𝑚 > 2𝑗 − 3. During analysis of statically determinate, the static equilibrium equation is
sufficient for determining the internal forces and the reaction of the structures, while in
statically indeterminate, the static equilibrium equation is not enough to determine the internal
forces as well as the reaction of each member.
In engineering world, there are many ways to solve problem related to planar
trusses. One that we are going to show in detail is using matrix method.
2
2.0 OBJECTIVES
In this project, there is few objectives that we need to archive throughout the project.
These objectives act as the guidance to complete the requirements needed in this project.
3
3.0 PROBLEM STATEMENTS
In this report, we were asked to calculate the displacement of each member
when certain load is applied to them and the buckling at certain members. The Figure 1 shows
the arrangement of the planar trusses. The details are shown as below;
Outer Diameter: 1 in
Outer diameter: 2 in
Load: 0
4
For member 2,4,6,8,10
Load: -1000 lb
Length: 30 in
5
4.0 MATLAB: LU DECOMPOSITION METHOD
In many applications where linear systems appear, one needs to solve Ax = b
for many different vectors b. For instance, a structure must be tested under several different
loads, not just one. As in the example of a truss, the loading in such a problem is usually
represented by the vector b. Gaussian elimination with pivoting is the most efficient and
accurate way to solve a linear system. Most of the work in this method is spent on the matrix
A itself. If we need to solve several different systems with the same A, and A is big, then we
would like to avoid repeating the steps of Gaussian elimination on A for every different b. This
can be accomplished by the LU decomposition, which in effect records the steps of Gaussian
elimination.
The main idea of the LU decomposition is to record the steps used in Gaussian
elimination on A in the places where the zero is produced. If we also include pivoting, then an
LU decomposition for A consists of three matrices P, L and U such that
P A = LU.
The pivot matrix P is the identity matrix, with the same rows switched as the rows of A are
switched in the pivoting. For instance,
1 0 0
P = [0 0 1]
0 1 0
would be the pivot matrix if the second and third rows of A are switched by pivoting. Matlab
will produce an LU decomposition with pivoting for a matrix A with the command
> [L U P] = lu(A)
where P is the pivot matrix. To use this information to solve Ax = b we first pivot both sides
by multiplying by the pivot matrix:
P Ax = Pb ≡ d.
LUx = d.
6
Then we need only to solve two back substitution problems:
Ly = d
and
Ux = y.
7
5.0 MATLAB: GAUSS ELIMINATION METHOD
Engineers often need to solve large systems of linear equations; for example, in
determining the forces in a large framework or finding currents in a complicated electrical
circuit. The method of Gauss elimination provides a systematic approach to their solution. This
method also is the easiest method to be done. The reason why this system was easy to solve is
that the system was "triangular"; this refers to the equations having the form of a triangle,
because of the lower equations containing only the later variables. When we have form a matrix
with lower or upper triangular, we can easily calculate the unknown by using back substitution.
Hence we get the value of unknown straight away.
There are few methods to get the triangular matrix, for example, in this planar trusses
analysis, we are using Gauss Elimination with Pivoting element. What is mean by pivoting
element? The "pivot" or "pivot element" is an element on the left hand side of a matrix that we
want the elements above and below to be zero. Pivoting works because a common multiple of
two numbers can always be found by multiplying the two numbers together. There is way on
selecting pivot element. First, pick the column with the most zeros in it. Use a row or column
only once and pivot on a one if possible. Next, we should pivot on the main diagonal. The most
important is never pivot on a zero as the calculation will be invalid. Last but not least, never
pivot on the right hand side.
The advantages of using Gauss Elimination is the method is used in finding the inverse
of a matrix and to compute ranks and bases. While the disadvantages are the method does not
generalize in any simple way to higher order tensors and computing the rank of a tensor of
order greater than 2 is a difficult problem. The general equation for Gauss Elimination is
8
6.0 METHODOLOGY
6.1 ALGORITHM
6.1.1 ALGORITHM FOR LU DECOMPOSITION
1. Start
2. Clarify the known parameter and assign their values
b = ((4*l)/E)*[ Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi;];
b
7. Displayed the matrix b.
8. Clarify the number of row and column for matrix A
n=size (A,1);
L=zeros(n);
U=zeros(n);
9
11. Start loop for with j-k:n
for k=1:n
for j=k:n
U(k,j)=A(k,j)-L(k,1:k-1)*U(1:k-1,j);
end;
L(k,k)=1;
for i=k+1:n
L(i,k)=(A(i,k)-L(i,1:k-1)*U(1:k-1,k))/U(k,k);
end
v=zeros(n,1);
v(1)=b(1)/L(1,1);
for i=2:n
v(i)=(b(i)-L(i,1:i-1)*v(1:i-1))/L(i,i);
end
x=zeros(n,1);
x(n)=v(n)/U(n,n);
10
20. Initiate the backward substitution
21. Start loop for i=n-1:-1:1
for i=n-1:-1:1
x(i)=(v(i)-U(i,i+1:n)*x(i+1:n))/U(i,i);
end
11
6.1.2 ALGORITHM FOR GAUSS ELIMINATION
b = ((4*l)/E)*[ Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi;];
b
7. Display as 10 by 1 matrix
8. Clarify the number of row and column for matrix A
-Find size of matrix A
9. Clarify the number of row and column for matrix b
-Find size of matrix b
10. Initialize the matrix x
11. Start the loop with i=1:n-1
12. Clarify the multipliers, m
13. Do for A and b using loop for
for i = 1:n-1
m = -A(i+1:n,i)/A(i,i); % multipliers
A(i+1:n,:) = A(i+1:n,:) + m*A(i,:);
b(i+1:n,:) = b(i+1:n,:) + m*b(i,:);
end;
12
15. Proceed with back substitution
16. Clarify matrix x
x(n,:) = b(n,:)/A(n,n);
for i = n-1:-1:1
x(i,:) = (b(i,:) - A(i,i+1:n)*x(i+1:n,:))/A(i,i);
end
19. End loop
20. Print the result
13
6.2 FLOWCHART
6.2.1. FLOWCHART FOR LU DECOMPOSITION
14
6.2.2. FLOWCHART FOR GAUSS ELIMINATION
15
7.0 RESULTS
I = 0.03091766 in4
Load = 0
16
8.0 ANALYSIS AND DISCUSSIONS
x + y + z = 6
2y + 5z = -4
2x + 5y - z = 27
1 1 1
A = [0 2 5 ]
2 5 −1
6
B = [−4]
27
We are using the inverse matrix to solve this linear equation problem. We can call the
matrices "A", "X" and "B" and the equation becomes:
AX = B
Where;
X is x, y and z, and
B is 6, -4 and 27
17
8.1.1 Verification for LU Decomposition
1 1 1
Since our matrix is 𝐴 = [0 2 5 ], first we need to calculate for matrix L and U by
2 5 −1
using Gauss Elimination method. Let start with matrix L, matrix U is the upper triangular
matrix. In this case, we are using gauss elimination with pivoting element to find L and U.
First, we take our row 1 as pivoting element to change value for n = 2,3 m = 1 as zero.
1 1 1
𝐴 = [0 2 5]
2 5 −1
−2𝑅1 + 𝑅3
1 1 1
𝑈 = [0 2 5]
0 3 −3
−3𝑅1/2 + 𝑅3
1 1 1
𝑈 = [0 2 5 ]
0 0 −10.5
1 1 1
𝐴 = [0 2 5]
2 5 −1
With the same method, we will get the value for L as below
1 0 0
𝐿 = [0 1 0]
2 1.5 1
18
To find the value X, by using the formula X = L-1U-1B
1 0 0 −1 1 1 1 −1 6
X = [0 1 0] [0 2 5 ] [−4]
2 1.5 1 0 0 −10.5 27
5
𝑋=[ 3 ]
−2
Since we have been doing the Gauss Elimination while we’re calculating for LU
Decomposition, hence we’ve explaining some part of the Gauss Elimination. Let just proceed
to
1 1 1 6
𝐴 = [⟨0 2 5 |−4⟩]
2 5 −1 27
−𝑅1 + 𝑅3
1 1 1 6
𝐴 = [⟨0 2 5 |−4⟩]
0 3 −3 15
3𝑅1
− + 𝑅3
2
1 1 1 6
𝐴 = [⟨0 2 5 |−4⟩]
0 0 −10.5 21
Hence, when we proceed to back-ward substitution, we can get the value of X directly.
5
𝑋=[ 3 ]
−2
After we have done the verification process, we can conclude that using LU
Decomposition and Gauss Elimination method can be used to calculate either small size matrix
and large size matrix. This is because the value of X for both method is the same, while the
value of X for planar trusses are also the same. In other words, the value of X for planar trusses
can be accepted and it is almost to the exact value.
19
8.2 EXPECTED RESULT
𝑥 = 𝐴−1 𝑏
Where:
X is the unknowns
After we have performed the method in matlab, the result is as the table above. As we
can see the relative error is less than 1%. The proved that the calculated value is acceptable due
to small relative error.
20
21
8.3 COMPARISON OF CHOOSEN METHOD
In general, Gauss Elimination is easier to do compared to LU Decomposition. Since we
have the same result, this is mean that the relative error is zero between the two method. This
is means that both methods are compatible to be used for this planar trusses analysis. Through
the observation made, the error can be reduced by changing the square root function to a rigid
value which is 0.5. If we denoted the square root function as ½ it will give quite slightly
different answer.
The reason why we choose the second method which is Gauss Elimination is simply
because it required a short time to perform the calculation. During LU Decomposition, after
getting Upper Triangular Matrix, we need to find the Lower Triangular Matrix then only we
can solve using X = L-1U-1B. LU Decomposition required lot of calculation and percentage of
doing mistakes is high compare to Gauss Elimination.
When we were using Gauss Elimination, we only required one triangular matrix and
we can directly calculate for the unknown by using back substitution. That is why the Gauss
Elimination only required short time, while the percentage of making mistake is less than LU
Decomposition.
22
8.4 BUCKLING ANALYSIS
In the analysis of buckling, first we need to calculate the first moment of area, I.
π
I= (14 − 0.784 )
64
I = 0.03091766 𝑖𝑛4
𝜋2 𝐸𝐼
𝑃𝑐𝑟 =
𝑙2
𝜋2 ×30𝐸6×0.0309176
𝑃𝑐𝑟 =
302
Calculation of 𝜃
15
𝜃 = 90 − cos −1 [30]
√3
𝜃= 2
Load = Load x 𝜃
23
We know that if 𝐵𝑢𝑐𝑘𝑙𝑖𝑛𝑔 > 𝑃𝑐𝑟 the truss member will fail. From the analysis of the
buckling, we have found that the buckling of each member is less than the value of Pcr. Thus
all the member will not fail.
24
9.0 CONCLUSION
In this project we can conclude that the value of displacement of each member is
positive which is the member is having tensile stress due to the load applied to them. After we
have analyse for each method, we have found that each of the method have their advantages
and disadvantages. In order to find their differences, we can calculate for each relative error.
Relative error indicates how much one’s method differ from the other. Another method to find
the error of any method is to calculate the exact value by using analytical method.
Since we are using matrix method to solve most of the problem in this project, we have
to look for the reliability analysis of truss structures using matrix method. The resulting
criterion for a statically determinate truss is simple and its failure probability is easily
evaluated. In case of a statically indeterminate truss, however, there are many possible modes
or paths to complete failure of the structure and it is impossible in practice to generate all of
them.
Hence, the failure probability is estimated by evaluating its lower and upper bounds.
The lower bound is evaluated by selecting the dominant modes of failure and calculating their
probabilities. The upper bound is evaluated by assuming that the redundant truss behaves itself
like a statically determinate truss, i.e., the structure fails if any one member is subject to failure.
Numerical examples are provided to demonstrate the applicability of the proposed methods.
25
10.0 REFERENCES
Che Rahim Che The. (2009) Numerical method algorithm and Matlab programming. UTM
Press
Hoffman, J. D. (1992). Numerical Methods for Engineers and Scientist (2nd ed.). Basel, New
York: McGraw-Hill.
Penny, J. E., & Lindfield, G. R. (2000). Numerical methods using Matlab. Upper Saddle River,
NJ: Prentice Hall.
Steven C. Chapra & Raymond P. Canale. (2010) Numerical Methods for Engineers(6th ed.)
New York: Mc Graw-Hill.
26
APPENDIX
27
CODING FOR LU DECOMPOSITION
% Area of trusses 1,2,3,4 and 5 is denoted as Ai
% Area of trusses 6,7,8,9,10 and 11 is denoted as Aj
% Modulus Young, E
E = 30*10^6;
% Length
l = 30;
% Since we're following the equation of [A]x = b , hence we need to clarify all the parameter needed.
% The matrix A is written as below
A = [ (4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) -4*Ai 0 0 0 -Aj 3^0.5*(Aj)
0 0;
28
3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 0 0 3^0.5*(Aj) -3*Aj 0
0;
-4*Ai 0 (4*Ai+4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) -4*Ai 0 -Aj -3^0.5*Aj
-Aj 3^0.5*Aj ;
0 0 3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 -3^0.5*Aj -3*Aj
3^0.5*Aj -3*Aj ;
0 0 -4*Ai 0 (4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) 0 0 -
Aj 3^0.5*Aj ;
0 0 0 0 3^0.5*(Aj -Aj) 3*(Aj+Aj) 0 0 -
3^0.5*Aj -3*Aj ;
-Aj 3^0.5*Aj -Aj -3^0.5*Aj 0 0 (4*Ai+4*Ai+Aj+Aj) -3^0.5*(Aj-
Aj) -4*Ai 0;
3^0.5*Aj -3*Aj -3^0.5*Aj -3*Aj 0 0 -3^0.5*(Aj-Aj) 3*(Aj+Aj)
0 0;
0 0 -Aj 3^0.5*Aj -Aj -3^0.5*Aj -4*Ai 0
(4*Ai+4*Ai+Aj+Aj) -3^0.5*(Aj-Aj) ;
0 0 3^0.5*Aj -3^0.5*Aj 3^0.5*Aj -3*Aj 0 0 -
3*0.5*(Aj-Aj) 3*(Aj+Aj) ; ]
% Calculation for b
% The value of b will be displayed
b = ((4*l)/E)*[ Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi;];
b
% The vector x is the displacements of the trusses at the joints when the load is applied
% Using LU Decomposition method to find the value of x
% Step involved in LU Decomposition
% Step 1 : Find the Upper Matrix (U) and Lower Matrix (L)
n=size (A,1);
L=zeros(n);
U=zeros(n);
for k=1:n
for j=k:n
U(k,j)=A(k,j)-L(k,1:k-1)*U(1:k-1,j);
end;
L(k,k)=1;
29
for i=k+1:n
L(i,k)=(A(i,k)-L(i,1:k-1)*U(1:k-1,k))/U(k,k);
end
end
% The L and U matrix is displayed.
L
U
30
CODING FOR GAUSS ELIMINATION
function x = Gauss(A, b)
% Area of trusses 1,2,3,4 and 5 is denoted as Ai
% Area of trusses 6,7,8,9,10 and 11 is denoted as Aj
% Modulus Young, E
E = 30*10^6;
% Length
l = 30;
% Since we're following the equation of [A]x = b , hence we need to clarify all the parameter needed.
% The matrix A is written as below
A = [ (4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) -4*Ai 0 0 0 -Aj 3^0.5*(Aj)
0 0;
3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 0 0 3^0.5*(Aj) -3*Aj 0
0;
31
-4*Ai 0 (4*Ai+4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) -4*Ai 0 -Aj -3^0.5*Aj
-Aj 3^0.5*Aj ;
0 0 3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 -3^0.5*Aj -3*Aj
3^0.5*Aj -3*Aj ;
0 0 -4*Ai 0 (4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) 0 0 -
Aj 3^0.5*Aj ;
0 0 0 0 3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 -
3^0.5*Aj -3*Aj ;
-Aj 3^0.5*Aj -Aj -3^0.5*Aj 0 0 (4*Ai+4*Ai+Aj+Aj) -3^0.5*(Aj-
Aj) -4*Ai 0;
3^0.5*Aj -3*Aj -3^0.5*Aj -3*Aj 0 0 -3^0.5*(Aj-Aj) 3*(Aj+Aj)
0 0;
0 0 -Aj 3^0.5*Aj -Aj -3^0.5*Aj -4*Ai 0
(4*Ai+4*Ai+Aj+Aj) -3^0.5*(Aj-Aj) ;
0 0 3^0.5*Aj -3^0.5*Aj 3^0.5*Aj -3*Aj 0 0 -
3*0.5*(Aj-Aj) 3*(Aj+Aj) ; ]
% Calculation for b
% The value of b will be displayed
b = ((4*l)/E)*[ Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi;];
b
% The vector x is the displacements of the trusses at the joints when the load is applied
% Using Gauss-Elimination method to get the value of x
n=size(A,1);
L=zeros(n);
U=zeros(n);
% We are using the Gauss Elimination - back subtitution as the second method of analysis
% Solve linear system Ax = b
% using Gaussian elimination without pivoting
% A is an n by n matrix
% b is an n by k matrix (k copies of n-vectors)
% x is an n by k matrix (k copies of solution vectors)
32
m = -A(i+1:n,i)/A(i,i); % multipliers
A(i+1:n,:) = A(i+1:n,:) + m*A(i,:);
b(i+1:n,:) = b(i+1:n,:) + m*b(i,:);
end;
33
VERIFICATION FOR LU DECOMPOSITION
A = [ 1 1 1;
0 2 5;
2 5 -1];
B = [ 6 -4 27];
n=size (A,1);
L=zeros(n);
U=zeros(n);
for k=1:n
for j=k:n
U(k,j)=A(k,j)-L(k,1:k-1)*U(1:k-1,j);
end;
L(k,k)=1;
for i=k+1:n
L(i,k)=(A(i,k)-L(i,1:k-1)*U(1:k-1,k))/U(k,k);
end
end
% The L and U matrix is displayed.
L
U
34
% Step 3 : Use x to solve Ux = v by using backward substituition
% x is the displacement of each member
x=zeros(n,1);
x(n)=v(n)/U(n,n);
for i=n-1:-1:1
x(i)=(v(i)-U(i,i+1:n)*x(i+1:n))/U(i,i);
end
35
VERIFICATION FOR GAUSS ELIMINATION
function x = Gauss(A, b)
A = [ 1 1 1;
0 2 5;
2 5 -1]
b = [ 6 -4 27]
% We are using the Gauss Elimination - back subtitution as the second method of analysis
% Solve linear system Ax = b
% using Gaussian elimination without pivoting
% A is an n by n matrix
% b is an n by k matrix (k copies of n-vectors)
% x is an n by k matrix (k copies of solution vectors)
36
CALCULATION OF BUCKLING
% Area of trusses 1,2,3,4 and 5 is denoted as Ai
% Area of trusses 6,7,8,9,10 and 11 is denoted as Aj
% Modulus Young, E
E = 30*10^6;
% Length
l = 30;
% Since we're following the equation of [A]x = b , hence we need to clarify all the parameter needed.
% The matrix A is written as below
A = [ (4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) -4*Ai 0 0 0 -Aj
3^0.5*(Aj) 0 0;
37
3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 0 0 3^0.5*(Aj) -3*Aj
0 0;
-4*Ai 0 (4*Ai+4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) -4*Ai 0 -Aj -
3^0.5*Aj -Aj 3^0.5*Aj ;
0 0 3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 -3^0.5*Aj -3*Aj
3^0.5*Aj -3*Aj ;
0 0 -4*Ai 0 (4*Ai+Aj+Aj) 3^0.5*(Aj-Aj) 0 0
-Aj 3^0.5*Aj ;
0 0 0 0 3^0.5*(Aj-Aj) 3*(Aj+Aj) 0 0 -
3^0.5*Aj -3*Aj ;
-Aj 3^0.5*Aj -Aj -3^0.5*Aj 0 0 (4*Ai+4*Ai+Aj+Aj) -
3^0.5*(Aj-Aj) -4*Ai 0;
3^0.5*Aj -3*Aj -3^0.5*Aj -3*Aj 0 0 -3^0.5*(Aj-Aj)
3*(Aj+Aj) 0 0;
0 0 -Aj 3^0.5*Aj -Aj -3^0.5*Aj -4*Ai 0
(4*Ai+4*Ai+Aj+Aj) -3^0.5*(Aj-Aj) ;
0 0 3^0.5*Aj -3^0.5*Aj 3^0.5*Aj -3*Aj 0 0 -
3*0.5*(Aj-Aj) 3*(Aj+Aj) ; ]
% Calculation for b
% The value of b will be displayed
b = ((4*l)/E)*[ Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi; Pj; Pi;];
b
% The vector x is the displacements of the trusses at the joints when the load is applied
% Using LU Decomposition method to find the value of x
% Step involved in LU Decomposition
% Step 1 : Find the Upper Matrix (U) and Lower Matrix (L)
n=size (A,1);
L=zeros(n);
U=zeros(n);
for k=1:n
for j=k:n
U(k,j)=A(k,j)-L(k,1:k-1)*U(1:k-1,j);
end;
L(k,k)=1;
38
for i=k+1:n
L(i,k)=(A(i,k)-L(i,1:k-1)*U(1:k-1,k))/U(k,k);
end
end
% The L and U matrix is displayed.
L
U
for i=1:11
I(i)= (pi/64)*(ODi^4-IDi^4);
end
for i=1:11
Pcr(i)=(pi^2)*E*I(i)/(l^2);
39
end
teta=90-acosd(15/30);
for i=6:11
Buckling(i)=(-Pi*cosd(teta));
end
for i=1:5
Buckling(i)=Pj;
end
disp(['Buckling Calculation:']);
fprintf('\n');
for i=1:11
if (Buckling(i)>Pcr(i))
disp (sprintf('The truss of &d will fail',i));
else disp (sprintf('The truss of %d will not fail',i));
end
end
40
INVERSE MATRIX
A= [2.4241 0 -1.2302 0 0 0 -0.5969
1.0339 0 0;
0 3.5814 0 0 0 0 1.0339 -
1.7907 0 0;
-1.2302 0 3.6543 0 -1.2302 0 -0.5969 -
1.0339 -0.5969 1.0339;
0 0 0 3.5814 0 0 -1.0339 -
1.7907 1.0339 -1.7907;
0 0 -1.2302 0 2.4241 0 0
0 -0.5969 1.0339;
0 0 0 0 0 3.5814 0
0 -1.0339 -1.7907;
-0.5969 1.0339 -0.5969 -1.0339 0 0 3.6543
0 -1.2302 0;
1.0339 -1.7907 -1.0339 -1.7907 0 0 0
3.5814 0 0;
0 0 -0.5969 1.0339 -0.5969 -1.0339 -1.2302
0 3.6543 0;
0 0 1.0339 -1.0339 1.0339 -1.7907 0
0 0 3.5814;];
b =[ 0;
-0.0040;
0;
-0.0040;
0;
-0.0040;
0;
-0.0040;
0;
-0.0040;];
x=inv (A)*b
41