beam analysis using the stiffness method in matlab program

14
Beam Analysis Using The Stiffness Matrix MATLAB Project Report MATLAB Project Report This MATLAB project work is to analyze the beam using Stiffness Method. Analysis is done for the simply supported beam with cantilever imposed to the point load at the far end of cantilever. Submitted to: Parag Pradeep Bhagat Submitted by: C1318-A17 & C1318-A25

Upload: upadesh-shrestha

Post on 25-Oct-2015

538 views

Category:

Documents


10 download

DESCRIPTION

This MATLAB project work is to analyze the beam using Stiffness Method. Analysis is done for the simply supported beam with cantilever imposed to the point load at the far end of cantilever.

TRANSCRIPT

Page 1: Beam Analysis Using the Stiffness Method in MATLAB Program

Beam Analysis Using The Stiffness Matrix

MATLAB Project Report

MATLAB

Project

Report This MATLAB project work is to analyze

the beam using Stiffness Method.

Analysis is done for the simply

supported beam with cantilever imposed

to the point load at the far end of

cantilever.

Submitted to: Parag Pradeep Bhagat Submitted by: C1318-A17 & C1318-A25

Page 2: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 2

Beam Analysis Using the Stiffness Method in MATLAB Program

1.1 General Description:-

Here we will explain the basic fundamentals of using the stiffness method for analyzing

beam structures. It will be shown that this method, although tedious to do by hand, is

quite suited for use on a computer. So we choose MATLAB as our programming

language for the analysis of beam using the stiffness method.

1.2 Preliminary Concept and Definition:-

Member and Node Identification: In order to apply the stiffness method to beam, we must first determine how to subdivide the beam into its component finite element. In general, each element must be free from load and have prismatic cross section. For this reason the node of each element are located at the support or point where member are connected together, where external force is applied, where cross sectional area suddenly changes, or where vertical or rotational displacement at a point is to be determined. For example, consider a continuous beam as shown in Fig.1a. The given continuous beam is divided into three beam elements as shown in Fig.1b. It is noticed that, in this case, nodes are located at the supports. Thus each span is treated as an individual beam. However sometimes it is required to consider a node between support points. This is done whenever the cross sectional area changes suddenly or if it is required to calculate vertical or rotational displacements at an intermediate point. Such a division is shown in Fig.1c. If the axial deformations are neglected then each node of the beam will have two degrees of freedom: a vertical displacement (corresponding to shear) and a rotation (corresponding to bending moment). In Fig.1b, numbers enclosed in a circle represents beam numbers. The beam is divided into three beam members. Hence, there are four nodes and eight degrees of freedom. The possible displacement degrees of freedom of the beam are also shown in the figure. Let us use lower numbers to denote unknown degrees of freedom (unconstrained degrees of freedom) and higher numbers to denote known (constrained) degrees of freedom. Such a method of identification is adopted in this course for the ease of imposing boundary conditions directly on the structure stiffness matrix. However, one could number sequentially as shown in Fig.1d. This is preferred while solving the problem on a computer.

Fig: - 1a

Page 3: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 3

Fig: - 1b

Fig: - 1c

Fig: - 1d

In the above figures, single headed arrows are used to indicate translational and double headed arrows are used to indicate rotational degrees of freedom.

Page 4: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 4

Beam Member Stiffness Matrix: In this part we will develop the stiffness matrix from beam element or member having constant cross- sectional area and reference from the local X’,Y’,Z’, coordinate system. Fig...2 show a prismatic beam of a constant cross section that is fully restrained at ends in local orthogonal co-ordinate system x' y' z'. The beam ends are denoted by nodes j and k. The x’ axis coincides with the centroidal axis of the member with the positive sense being defined from j to k . Let L be the length of the member, A area of cross section of the member and is the moment of inertia about Z’ axis is IXX.

Fig 2

Two degrees of freedom (one translation and one rotation) are considered at each end of the member. Hence, there are four possible degrees of freedom for this member and hence the resulting stiffness matrix is of the order 4X4. In this method counterclockwise moments and counterclockwise rotations are taken as positive. The positive sense of the translation and rotation are also shown in the figure. Displacements are considered as positive in the direction of the coordinate axis. The elements of the stiffness matrix indicate the forces exerted on the member by the restraints at the ends of the member when unit displacements are imposed at each end of the member. Let us calculate the forces developed in the above beam member when unit displacement is imposed along each degree of freedom holding all other displacements to zero. Now impose a unit displacement along y' axis at j end of the member while holding all other displacements to zero as shown in Fig. 3a. This displacement causes both shear and moment in the beam. The restraint actions are also shown in the figure. By definition they are elements of the member stiffness matrix. In particular they form the first column of element stiffness matrix. In Fig. 3b, the unit rotation in the positive sense is imposed at j end of the beam while holding all other displacements to zero.

Page 5: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 5

Fig 3 a &b

In Fig.3c, unit displacement along axis at end is imposed and corresponding restraint actions are calculated. Similarly in Fig. 3d, unit rotation about ' axis at end is imposed and corresponding stiffness coefficients are calculated

Fig .3c

Page 6: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 6

Fig 3.d

By superposition, if the above result in figs 3 a,b & 3 c,d the resulting four load- displacement relations for the member can be express in the matrix form as

This may also be written in compact form as,

{q}= [k] {u'} or Q = KD …………………. (A) Once the structure stiffness matrix is determined, the load at nodes of the beam can be related to the displacement using above equation (A) Here q and u’ are column Matrix that represent both the known and unknown loads and displacements. The unknown displacement u’ are determined from the first of these equation. Using these values, the support reaction Q are computed for the second equation

Page 7: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 7

Procedure for analysis: The following method provide a means of determining displacement, support reaction, and internal loadings for the member or finite elements of a statically determinate or in determinate beam. Notation: Divide the beam into finite element and arbitrarily identify each element and its node. Use a number written in circle for node and number written in square for member. Usually an element extends between points of support, points of concentrated loads, and joints or points where internal loadings or displacement are to be determined. Specify the near and far end of each element symbolically by directing an arrow along the element, with head directed towards the far end At each nodal point specify numerically the y and z code numbers. In all cases use the lowest code number to identify the degree of freedom, followed by the remaining or highest number to identify the degrees of freedom that are constrained. From the problem, establish the known displacement U’ and known external loads Q. Include any reverse fixed end loadings if an element support an intermediate load. Structural Stiffness matrix Apply equation A to determine the stiffness matrix for each element express in global co ordinate system. After each member stiffness matrix is determined, and row s and column are identified with the appropriate code numbers, assemble the matrix to determine the structure stiffness matrix K as a partial check, the member and structure stiffness matris should be symmetrical. Displacement and load Partition the structure stiffness equation and carry out the matrix multiplication in order to determine the unknown displacement U ’and support reactions Q. The Internal shear and moment q at the end of each beam element can be determined from Q=Ku’+q, accounting for the additional fixed end loadings.

Page 8: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 8

Example 1 Analyze the continuous beam shown in Fig. 28.1a. Assume that the supports are unyielding. Also assume that EI is constant for all members.

The numbering of joints and members are shown in Fig. 28.1b. The possible global degrees of freedom are shown in the figure. Numbers are put for the unconstrained degrees of freedom first and then that for constrained displacements.

The given continuous beam is divided into three beam elements Two degrees of freedom (one translation and one rotation) are considered at each end of the member. In the above figure, double headed arrows denote rotations and single headed arrow

represents translations. In the given problem some displacements are zero, i.e. u3 = u4

= u5 = u6 = u7 = u8 =0 from support conditions.

In the case of beams, it is not required to transform member stiffness matrix from local co-ordinate system to global co-ordinate system, as the two co-ordinate system are parallel to each other. Example:-Determine the reaction at the support of the beam shown in figure below, with its constant EI, length AB=2and BC=2, A being Hinge Joint, B being roller Joint. 5KN

Page 9: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 9

2

5 6 4 3

1

5 kN

2

Solution:- Notation, The Beam has two elements and three nodes, which are shown in fig below. The code 1 through 6 is indicated such that the lowest number 1-4 identify unconstrained degrees of freedom. The Known Load and displacement Matrix are,

Q= [0 -5 0 0] D= [0 0] 1 2 3 4 6 7

I.e. here numbers in the parenthesis are load and matrix which is column matrix in general.

1 Member stiffness matrices: Each of two member stiffness matrices is determined from equation A described above, note carefully how code numbers for each column and rows are established. 6 4 5 3 1.5 1.5 -1.5 1.5 6 K1= EI 1.5 2.0 -1.5 1.0 4 -1.5 -1.5 1.5 -1.5 5 1.5 1.0 -1.5 2.0 3 5 3 2 1 1.5 1.5 -1.5 1.5 5 K2= EI 1.5 2.0 -1.5 1.0 3 -1.5 -1.5 1.5 -1.5 2 1.5 1.0 -1.5 2.0 1 Displacements and Loads: We can now assemble these element in to the structure stiffness matrix, for example, element K11= 0+2=2, K55=1.5+1.5=3, etc so on. As Q=KD

1

1 2

3

Page 10: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 10

1 2 3 4 5 6 0 2.0 -1.5 1.0 0.0 1.5 0.0 D1 -5 -1.5 1.5 -1.5 0.0 -1.5 0.0 D2 0 = EI 1.0 -1.5 4.0 1.0 0.0 1.5 D3 0 0.0 0.0 1.0 2.0 -1.5 1.5 D4 Q5 1.5 -1.5 0.0 -1.5 3.0 -1.5 0.0 Q6 0.0 0.0 1.5 1.5 -1.5 1.5 0.0 The matrix is partitioned as shown. Carrying out multiplications for first four rows we have

0 = 2D1- 1.5D2+D3+0 (-5/EI) = -1.5D1+1.5D2-1.5D3+0 0 = D1-1.5D2+4D3+D4 0 = 0+0+D3+2D4 Solving, D1= (-16.67/EI) D2= (-26.67/EI) D3 = (-6.67/EI) D4= (3.33/ EI) Using the result, and multiplying the last two rows give, Q5= 1.5 EI (-16.67/EI) -1.5 EI (-26.67/EI)+0.0 – 1.5EI ( 3.33/EI) 10.0 KN Q6 = 0.0+0.0+ 1.5 EI (- 6.67/ EI)+ 1.5 EI ( 3.33/EI) -5.0 KN

1.3 MATLAB Code for Solving the Problem:-

%This MATLAB code will apply the stiffness method for beam analysis. %The beam is supposed to be simply supported with cantilever imposed to %point load on the far end of cantiliver. %Start of the code clc clear all close all % Input the number of nodes on any beam system. n = input('Input the number of node in the Beam ='); for i=1:n-1 display(sprintf('Enter the EI value for member #%d',i)); EI(i,1) = input('EI='); end

Page 11: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 11

% Input the length of each member. for i=1:n-1 display(sprintf('Enter the Length of member #%d',i)); len(i,1) = input('Length='); end %Enter the point load display('Enter the point load'); p=input('Load(P)='); display('Hit "Enter" to continue'); pause % Computing the elements of matrix for i=1:n-1 q1=(12*EI(i,1)/len(i,1).^3); q2=(6*EI(i,1)/len(i,1).^2); q3=(4*EI(i,1)/len(i,1)); q4=(2*EI(i,1)/len(i,1)); q5=-(12*EI(i,1)/len(i,1).^3); q6=-(6*EI(i,1)/len(i,1).^2); % Displaying stiffness matrix of each members display(sprintf('The Stiffness Matrix K %d',i')); S=[q1 q2 q5 q2;q2 q3 q6 q4;q5 q6 q1 q6;q2 q4 q6 q3] end display('Hit "Enter" to continue'); pause %Generating joint stiffness matrix display('The generated Joint Stiffness Matrix is:'); A=[q3 q6 q4 0 q2 0;q6 q1 q6 0 q5 0;q4 q6 q3+q3 q4 q6+q2 q2;zeros(1,2) q4 q3

q6 q2;q2 q5 q6+q2 q6 q1+q1 q5;zeros(1,2) q2 q2 q5 q1] display('Hit "Enter" to continue'); pause %Generating the load matrix display('and the Load Matrix is'); B=[0; -p; zeros(2,1)] display('Hit "Enter" to continue'); pause %Spliting the joint stiffness matrix in 4 x 4 matrix display('Spliting the Joint Stiffness Matrix in 4x4 Matrix'); C=A(1:4,1:4) display('Hit "Enter" to continue'); pause %Solving the matrix A and B to get the element of stiffness matrix display('On solving we get the Displacement Matrix is'); D=inv(A(1:4,1:4))*B; fprintf('D1 = %5.3f D2 = %5.3f D3 = %5.3f D4 = %5.3f

\n\n',D(1),D(2),D(3),D(4))

display('Hit "Enter" to continue');

pause

%Calculating the loads on the joints of the beam

display('The loads(kN) on the joint of beams are');

Q5=A(5,1:4)*D;

Q6=A(6,1:4)*D;

fprintf('Q5 = %5.3fkN & Q6 = %5.3fkN \n\n',Q5,Q6)

%End of the code %=========================================================================

Page 12: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 12

1.4 Using the script

Step 1: Type the file name kmat in MATLAB command window and hit enter.

>>project ↵

Step 2: Input the total number of nodes in the beam Enter the number of total nodes

Total Nodes = 3 ↵

Step 3: Input the EI value of each member Enter the EI value for member #1

EI=1000 ↵

Enter the EI value for member #2

EI=1500 ↵

Step 4: Input the length of each member

Enter the length of member #1

L=2 ↵

Enter the length of member #2

L=3 ↵

Step 5: Enter the point load Enter the point load

Load(P)=5 ↵ Hit "Enter" to continue ↵

Step 6: Hit “Enter” to generate the stiffness matrix for each member

The Stiffness Matrix K 1

S =

1.5000 1.5000 -1.5000 1.5000

1.5000 2.0000 -1.5000 1.0000

-1.5000 -1.5000 1.5000 -1.5000

1.5000 1.0000 -1.5000 2.0000

Page 13: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 13

The Stiffness Matrix K 2

S =

1.5000 1.5000 -1.5000 1.5000

1.5000 2.0000 -1.5000 1.0000

-1.5000 -1.5000 1.5000 -1.5000

1.5000 1.0000 -1.5000 2.0000

Hit "Enter" to continue ↵

Step 7: Hit “Enter” to generate the Joint Stiffness Matrix

The generated Joint Stiffness Matrix is:

A =

2.0000 -1.5000 1.0000 0 1.5000 0

-1.5000 1.5000 -1.5000 0 -1.5000 0

1.0000 -1.5000 4.0000 1.0000 0 1.5000

0 0 1.0000 2.0000 -1.5000 1.5000

1.5000 -1.5000 0 -1.5000 3.0000 -1.5000

0 0 1.5000 1.5000 -1.5000 1.5000

Hit "Enter" to continue ↵

Step 8: Hit “Enter” to generate Load Matrix

and the Load Matrix is

B =

0

-5

0

0

Hit "Enter" to continue ↵

Step 9: Hit “Enter” to split the Joint Stiffness Matrix in 4x4 matrix

Splitting the Joint Stiffness Matrix in 4x4 Matrix

C =

2.0000 -1.5000 1.0000 0

-1.5000 1.5000 -1.5000 0

1.0000 -1.5000 4.0000 1.0000

0 0 1.0000 2.0000

Hit "Enter" to continue ↵

Page 14: Beam Analysis Using the Stiffness Method in MATLAB Program

[BEAM ANALYSIS USING THE STIFFNESS METHOD] [MATLAB Project Report]

Submitted to Parag Pradeep Bhagat Submitted by C1318-A17 & C1318-A25 14

Step 10: Hit “Enter” to solve the spitted Joint Stiffness Matrix(4x4) and Load Matrix (4X1) forming the Displacement Matrix of size 4x1. On solving we get the Displacement Matrix Element

D1 = -16.667 D2 = -26.667 D3 = -6.667 D4 = 3.333

Hit "Enter" to continue ↵

Step 11: Hit “Enter” to generate the load on the beam in near and intermediate end by multiplying Displacement Matrix and the last two row of Joint Stiffness Matrix with four element of column. The loads(kN) on the joint of beams are

Q5 = 10.000kN & Q6 = -5.000kN