home

PDF (letter size)

Derivation Of The Beam Stiffness Matrix


July 7, 2016   Compiled on January 30, 2024 at 2:57am
1 Introduction
2 Direct method
2.1 Examples using the direct beam stiffness matrix
2.1.1 Example 1
2.1.2 Example 2
2.1.3 Example 3
3 Finite elements (adding more elements)
3.1 Example 3 redone with 2 elements
4 Generating shear and bending moments diagrams
5 Finding the stiffness matrix using methods other than direct method
5.1 Virtual work method for derivation of the stiffness matrix
5.2 Potential energy (minimize a functional) method to derive the stiffness matrix
6 References

Chapter 1
Introduction

A short review for solving the beam problem in 2D is given. The deflection curve, bending moment and shear force diagrams are calculated for a beam subject to bending moment and shear force using direct stiffness method and then using finite elements method by adding more elements. The problem is solved first by finding the stiffness matrix using the direct method and then using the virtual work method.

Chapter 2
Direct method

2.1 Examples using the direct beam stiffness matrix
2.1.1 Example 1
2.1.2 Example 2
2.1.3 Example 3

Starting with only one element beam which is subject to bending and shear forces. There are 4 nodal degrees of freedom. Rotation at the left and right nodes of the beam and transverse displacements at the left and right nodes. The following diagram shows the sign convention used for external forces. Moments are always positive when anti-clockwise direction and vertical forces are positive when in the positive y direction.

The two nodes are numbered 1 and 2 from left to right. M1 is the moment at the left node (node 1), M2 is the moment at the right node (node 2). V1 is the vertical force at the left node and V2 is the vertical force at the right node.

The above diagram shows the signs used for the applied forces direction when acting in the positive sense. Since this is a one dimensional problem, the displacement field (the unknown being solved for) will be a function of one independent variable which is the x coordinate. The displacement field in the vertical direction is called v(x). This is the vertical displacement of point x on the beam from the original xaxis. The following diagram shows the notation used for the coordinates.

Angular displacement at distance x on the beam is found using θ(x)=dv(x)dx. At the left node, the degrees of freedom or the displacements, are called v1,θ1 and at the right node they are called v2,θ2. At an arbitrary location x in the beam, the vertical displacement is v(x) and the rotation at that location is θ(x).

The following diagram shows the displacement field v(x)

In the direct method of finding the stiffness matrix, the forces at the ends of the beam are found directly by the use of beam theory. In beam theory the signs are different from what is given in the first diagram above. Therefore, the moment and shear forces obtained using beam theory (MB and VB in the diagram below) will have different signs when compared to the external forces. The signs are then adjusted to reflect the convention as shown in the diagram above using M and V.

For an example, the external moment M1 is opposite in sign to MB1 and the reaction V2 is opposite to VB2. To illustrate this more, a diagram with both sign conventions is given below.

The goal now is to obtain expressions for external loads Mi and Ri in the above diagram as function of the displacements at the nodes {d}={v1,θ1,v2,θ2}T.

In other words, the goal is to obtain an expression of the form {p}=[K]{d} where [K] is the stiffness matrix where {p}={V1,M1,R2,M2}T is the nodal forces or load vector, and {d} is the nodal displacement vector.

In this case [K] will be a 4×4 matrix and {p} is a 4×1 vector and {d} is a 4×1 vector.

Starting with V1. It is in the same direction as the shear force VB1. Since VB1=dMB1dx thenV1=dMB1dx Since from beam theory MB1=σ(x)Iy, the above becomesV1=Iydσ(x)dx But σ(x)=Eε(x) and ε(x)=yρ where ρ is radius of curvature, therefore the above becomesV1=EIddx(1ρ) Since 1ρ=(d2udx2)(1+(dudx)2)3/2 and for a small angle of deflection dudx1 then 1ρ=(d2udx2), and the above now becomesV1=EId3u(x)dx3 Before continuing, the following diagram illustrates the above derivation. This comes from beam theory.

Now M1 is obtained. M1 is in the opposite sense of the bending moment MB1 hence a negative sign is added giving M1=MB1. But MB1=σ(x)Iy thereforeM1=σ(x)Iy=Eε(x)Iy=E(yρ)Iy=EI(1ρ)=EId2wdx2

V2 is now found. It is in the opposite sense of the shear force VB2, hence a negative sign is added giving

V2=VB2=dMB2dx

Since MB2=σ(x)Iy, the above becomesV2=Iydσ(x)dx But σ(x)=Eε(x) and ε(x)=yρ where ρ is radius of curvature. The above becomesV2=EIddx(1ρ) But 1ρ=(d2wdx2)(1+(dwdx)2)3/2 and for small angle of deflection dwdx1 hence 1ρ=(d2udx2) then the above becomesV2=EId3u(x)dx3 Finally M2 is in the same direction as MB2 so no sign change is needed. MB2=σ(x)Iy, thereforeM2=σ(x)Iy=Eε(x)Iy=E(yρ)Iy=EI(1ρ)=EId2udx2

The following is a summary of what was found so far. Notice that the above expressions are evaluates at x=0 and at x=L. Accordingly to obtain the nodal end forces vector {p}(1){p}={V1M1V2M2}={EId3u(x)dx3|x=0EId2udx2|x=0EId3u(x)dx3|x=LEId2udx2|x=L} The RHS of the above is now expressed as function of the nodal displacements v1,θ1,v2,θ2. To do that, the field displacement v(x) which is the transverse displacement of the beam is assumed to be a polynomial in x of degree 3 orv(x)=a0+a1x+a2x2+a3x3(A)θ(x)=dv(x)dx=a1+2a2x+3a3x2

Polynomial of degree 3 is used since there are 4 degrees of freedom, and a minimum of 4 free parameters is needed. Hence(2)v1=v(x)|x=0=a0 And (3)θ1=θ(x)|x=0=a1 Assuming the length of the beam is L, then(4)v2=v(x)|x=L=a0+a1L+a2L2+a3L3 And(5)θ2=θ(x)|x=L=a1+2a2L+3a3L2 Equations (2-5) gives{d}={v1θ1v2θ2}={a0a1a0+a1L+a2L2+a3L3a1+2a2L+3a3L2}=(100001001LL2L3012L3L2){a0a1a2a3} Solving for ai gives{a0a1a2a3}=(100001003L22L3L21L2L31L22L31L2){v1θ1v2θ2}=(v1θ13L2v21Lθ23L2v12Lθ11L2θ1+1L2θ2+2L3v12L3v2)

v(x), the field displacement function from Eq. (A) can now be written as a function of the nodal displacementsv(x)=a0+a1x+a2x2+a3x3=v1+θ1x+(3L2v21Lθ23L2v12Lθ1)x2+(1L2θ1+1L2θ2+2L3v12L3v2)x3=v1+xθ12x2Lθ1+x3L2θ1x2Lθ2+x3L2θ23x2L2v1+2x3L3v1+3x2L2v22x3L3v2

Or in matrix formv(x)=(13x2L2+2x3L3 x2x2L+x3L2 3x2L22x3L3 x2L+x3L2){v1θ1v2θ2}=(1L3(L33Lx2+2x3) 1L2(L2x2Lx2+x3) 1L3(3Lx22x3) 1L2(Lx2+x3)){v1θ1v2θ2}

The above can be written as(5A)v(x)=(N1(x)  N2(x) N3(x) N4(x)){v1θ1v2θ2}v(x)=[N]{d}

Where Ni are called the shape functions. The shape functions are(N1(x)N2(x) N3(x) N4(x))=(1L3(L33Lx2+2x3)1L2(L2x2Lx2+x3)1L3(3Lx22x3)1L2(Lx2+x3)) We notice that N1(0)=1 and N1(L)=0 as expected. Also dN2(x)dx|x=0=1L2(L24Lx+3x2)|x=0=1 And dN2(x)dx|x=L=1L2(L24Lx+3x2)|x=L=0 Also N3(0)=0 and N3(L)=1 and dN4(x)dx|x=0=1L2(2Lx+3x2)|x=0=0 and dN4(x)dx|x=L=1L2(2Lx+3x2)|x=L=1 The shape functions have thus been verified. The stiffness matrix is now found by substituting Eq. (5A) into Eq. (1), repeated below{p}={V1M1V2M2}=(EId3v(x)dx3|x=0EId2vdx2|x=0EId3v(x)dx3|x=LEId2vdx2|x=L) Hence(6){p}={V1M1V2M2}=(EId3dx3(N1v1+N2θ1+N3v2+N4θ2)EId2dx2(N1v1+N2θ1+N3v2+N4θ2)EId3dx3(N1v1+N2θ1+N3v2+N4θ2)EId2dx2(N1v1+N2θ1+N3v2+N4θ2)) But d3dx3N1(x)=1L3d3dx3(L33Lx2+2x3)=12L3

Andd3dx3N2(x)=1L2d3dx3(L2x2Lx2+x3)=6L2

Andd3dx3N3(x)=1L3d3dx3 (3Lx22x3)=12L3

Andd3dx3N4(x)=1L2d3dx3(Lx2+x3)=6L2

For the second derivativesd2dx2N1(x)=1L3d2dx2(L33Lx2+2x3)=1L3(12x6L)

Andd2dx2N2(x)=1L2d2dx2(L2x2Lx2+x3)=1L2(6x4L)

Andd2dx2N3(x)=1L3d2dx2 (3Lx22x3)=1L3(6L12x)

Andd2dx2N4(x)=1L2d2dx2(Lx2+x3)=1L2(6x2L)

Hence Eq. (6) becomes{p}={V1M1V2M2}=(EId3dx3(N1v1+N2θ1+N3v2+N4θ2)|x=0EId2dx2(N1v1+N2θ1+N3v2+N4θ2)|x=0EId3dx3(N1v1+N2θ1+N3v2+N4θ2)|x=LEId2dx2(N1v1+N2θ1+N3v2+N4θ2)|x=L)=(EI(12L3v1+6L2θ112L3v2+6L2θ2)x=0EI(1L3(12x6L)v1+1L2(6x4L)θ1+1L3(6L12x)v2+1L2(6x2L)θ2)x=0EI(12L3v1+6L2θ112L3v2+6L2θ2)x=LEI(1L3(12x6L)v1+1L2(6x4L)θ1+1L3(6L12x)v2+1L2(6x2L)θ2)x=L)(7)=EIL3(126L126L(12x6L)x=0L(6x4L)x=0(6L12x)x=0L(6x2L)x=0126L126L(12x6L)x=LL(6x4L)x=L(6L12x)x=LL(6x2L)x=L){v1θ1v2θ2}

Or in matrix form, after evaluating the expressions above for x=L and x=0 as{V1M1V2M2}=EIL3(126L126L6L4L26L2L212L36L212L36L2(12L6L)L(6L4L)(6L12L)L(6L2L)){v1θ1v2θ2}=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2){v1θ1v2θ2}

The above now is in the form{p}=[K]{d} Hence the stiffness matrix is[K]=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2) Knowing the stiffness matrix means knowing the nodal displacements {d} when given the forces at the nodes. The power of the finite element method now comes after all the nodal displacements v1,θ1, v2,θ2 are calculated by solving {p}=[K]{d}. This is because the polynomial v(x) is now completely determined and hence v(x) and θ(x) can now be evaluated for any x along the beam and not just at its end nodes as the case with finite difference method. Eq. 5A above can now be used to find the displacement v(x) and θ(x) everywhere.v(x)=[N]{d}v(x)=(N1(x)  N2(x) N3(x) N4(x)){v1θ1v2θ2}

To summarise, these are the steps to obtain v(x)

  1. An expression for [K] is found.
  2. {p}=[K]{d} is solved for {d}
  3. v(x)=[N]{d} is calculated by assuming v(x) is a polynomial. This gives the displacement v(x) to use to evaluate the transverse displacement anywhere on the beam and not just at the end nodes.
  4. θ(x)=dv(x)dx=ddx[N]{d} is obtained to evaluate the rotation of the beam any where and not just at the end nodes.
  5. The strain ϵ(x)=y[B]{d} is found, where [B] is the gradient matrix [B]=d2dx2[N].
  6. The stress from σ=Eϵ=Ey[B]{d} is found.
  7. The bending moment diagram from M(x)=EI[B]{d} is found.
  8. The shear force diagram from V(x)=ddxM(x) is found.

2.1 Examples using the direct beam stiffness matrix

2.1.1 Example 1
2.1.2 Example 2
2.1.3 Example 3

The beam stiffness matrix is now used to solve few beam problems. Starting with simple one span beam

2.1.1 Example 1

A one span beam, a cantilever beam of length L, with point load P at the free end

The first step is to make the free body diagram and show all moments and forces at the nodes

P is the given force. M2=0 since there is no external moment at the right end. Hence {p}=[K]{d} for this system is{RM1P0}=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2){v1θ1v2θ2} Now is an important step. The known end displacements from boundary conditions is substituted into {d}, and the corresponding row and columns from the above system of equations are removed1. Boundary conditions indicates that there is no rotation on the left end (since fixed). Hence v1=0 and θ1=0. Hence the only unknowns are v2 and θ2. Therefore the first and the second rows and columns are removed, giving{P0}=EIL3(126L6L4L2){v2θ2} Now the above is solved for {v2θ2}. Let E=30×106 psi (steel), I=57 in4, L=144 in, and P=400 lb, hence

P=400; 
L=144; 
E=30*10^6; 
I=57.1; 
A=(E*I/L^3)*[12       6*L            -12      6*L; 
6*L      4*L^2          -6*L     2*L^2; 
-12     -6*L            12      -6*L; 
6*L      2*L^2          -6*L     4*L^2 
]; 
load=[P;P*L;-P;0]; 
x=A(3:end,3:end)\load(3:end)
 

which gives

x = 
-0.2324 
-0.0024
 

Therefore the vertical displacement at the right end is v2=0.2324 inches (downwards) and θ2=0.0024 radians. Now that all nodal displacements are found, the field displacement function is completely determined.{d}={v1θ1v2θ2}={000.23240.0024} From Eq. 5Av(x)=[N]{d}=(N1(x)  N2(x) N3(x) N4(x)){000.23240.0024}=(1L3(L33Lx2+2x3)  1L2(L2x2Lx2+x3) 1L3(3Lx22x3) 1L2(Lx2+x3)){000.23240.0024}=0.0024L2(Lx2x3)+0.2324L3(2x33Lx2)

But L=144 inches, and the above becomesv(x)=3.9920×108x31.6956×105x2 To verify, let x=144 in the abovev(x=144)=3.9920×10814431.6956×1051442=0.23240

The following is a plot of the deflection curve for the beam

v=@(x) 3.992*10^-8*x.^3-1.6956*10^-5*x.^2 
x=0:0.1:144; 
plot(x,v(x),'r-','LineWidth',2); 
ylim([-0.8 0.3]); 
title('beam deflection curve'); 
xlabel('x inch'); ylabel('deflection inch'); 
grid
 

Now instead of removing rows/columns for the known boundary conditions, a 1 is put on the diagonal. Starting again with{RM1P0}=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2){v1θ1v2θ2} Since v1=0 and θ1=0, then{00P0}=EIL3(1000010000126L006L4L2){00v2θ2} The above system is now solved as before. E=30×106 psi, I=57 in4, L=144 in, P=400 lb

P=400; 
L=144; 
E=30*10^6; 
I=57.1; 
A=(E*I/L^3)*[12       6*L            -12      6*L; 
6*L      4*L^2          -6*L     2*L^2; 
-12     -6*L            12      -6*L; 
6*L      2*L^2          -6*L     4*L^2 
]; 
load=[0;0;-P;0];  %put zeros for known B.C. 
A(:,1)=0; A(1,:)=0; A(1,1)=1;  %put 1 on diagonal 
A(:,2)=0; A(2,:)=0; A(2,2)=1;  %put 1 on diagonal 
A
 

Gives

A = 
1.0e+07 * 
0.0000         0         0         0 
0    0.0000         0         0 
0         0    0.0007   -0.0496 
0         0   -0.0496    4.7583
 

Then

sol=A\load  %SOLVE
                                                                                    
                                                                                    
 

Gives

sol = 
0 
0 
-0.2324 
-0.0024
 

The same solution is obtained as before, but without the need to remove rows/column from the stiffness matrix. This method might be easier for programming than the first method of removing rows/columns.

The rest now is the same as was done earlier and will not be repeated.

2.1.2 Example 2

This is the same example as above, but the vertical load P is now placed in the middle of the beam

In using stiffness method, all loads must be on the nodes. The vector {p} is the nodal forces vector. Hence equivalent nodal loads are found for the load in the middle of the beam. The equivalent loading is the following

Therefore, the problem is as if it was the following problem

Now that equivalent loading is in place, we continue as before. Making a free body diagram showing all loads (including reaction forces)

The stiffness equation is now written as{p}=[K]{d}{RP/2M1PL/8P/2PL/8}=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2){v1θ1v2θ2}

There is no need to determine R and M1 at this point since these rows will be removed due to boundary conditions v1=0 and θ1=0 and hence those quantities are not needed to solve the equations. Note that the rows and columns are removed for the known boundary displacements before solving {p}=[K]{d}. Hence, after removing the first two rows and columns, the above system simplifies to{P/2PL/8}=EIL3(126L6L4L2){v2θ2} The above is now solved for {v2θ2} using the same numerical values for P,E,I,L as in the first example

P=400; 
L=144; 
E=30*10^6; 
I=57.1; 
A=(E*I/L^3)*[12       6*L            -12      6*L; 
6*L      4*L^2          -6*L     2*L^2; 
-12     -6*L            12      -6*L; 
6*L      2*L^2          -6*L     4*L^2 
]; 
load=[-P/2;P*L/8]; 
x=A(3:end,3:end)\load
 

Gives

x = 
-0.072630472854641 
-0.000605253940455
 

Therefore{d}={v1θ1v2θ2}={000.0726304728546410.000605253940455} This is enough to obtain v(x) as before. Now the reactions R and M1 can be determined if needed. Going back to the full {p}=[K]{d}, results in{RP/2M1PL/8P/2PL/8}=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2){000.0726304728546410.000605253940455}=EIL3(0.871573.6315×103L0.43578L1.2105×103L23.6315×103L0.871570.43578L2.421×103L2)

Hence the first equation becomesRP/2=EIL3(0.871573.6315×103L) and since E=30×106 psi (steel) and I=57 in4and L=144 in and P=400 lb, then

R=(30×106)571443(0.871573.6315×103(144))+400/2. ThereforeR=400 lb and M1PL/8=EIL3(0.43578L1.2105×103L2)+PL/8, hence M1=28762 lb-ft Now that all nodal reactions are found, the displacement field is found and the deflection curve can be plotted.v(x)=[N]{d}v(x)=(N1(x)  N2(x) N3(x) N4(x)){v1θ1v2θ2}=(N1(x)  N2(x) N3(x) N4(x)){000.0726304728546410.000605253940455}=( 1L3(3Lx22x3) 1L2(Lx2+x3))(0.0726304728546410.000605253940455)=6.0525×104L2(Lx2x3)+0.07263L3(2x33Lx2)

Since L=144 inches, the above becomesv(x)=6.0525×104(144)2((144)x2x3)+0.07263(144)3(2x33(144)x2)=1.9459×108x36.3047×106x2

The following is the plot

clear all; close all; 
v=@(x) 1.9459*10^-8*x.^3-6.3047*10^-6*x.^2 
x=0:0.1:144; 
plot(x,v(x),'r-','LineWidth',2); 
ylim([-0.8 0.3]); 
title('beam deflection curve'); 
xlabel('x inch'); ylabel('deflection inch'); 
grid
 

2.1.3 Example 3

Assuming the beam is fixed on the left end as above, but simply supported on the right end, and the vertical load P now at distance a from the left end and at distance b from the right end, and a uniform distributed load of density m lb/in is on the beam.

Using the following values: a=0.625L,b=0.375L,E=30×106 psi (steel), I=57 in4, L=144 in, P=1000 lb, m=200 lb/in.

In the above, the left end reaction forces are shown as R1 and moment reaction as M1 and the reaction at the right end as R2. Starting by finding equivalent loads for the point load P and equivalent loads for for the uniform distributed load m. All external loads must be transferred to the nodes for the stiffness method to work. Equivalent load for the above point load is

Equivalent load for the uniform distributed loading is

Using free body diagram, with all the loads on it gives the following diagram (In this diagram M is the reaction moment and R1,R2 are the reaction forces)

Now that all loads are on the nodes, the stiffness equation is applied{p}=[K]{d}{R1Pb2(L+2a)L3mL2MPab2L2mL212R2Pa2(L+2b)L3mL2Pa2bL2+mL212}=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2){v1θ1v2θ2}

Boundary conditions are now applied. v1=0,θ1=0,v2=0. Therefore the first, second and third rows/columns are removed givingPa2bL2+mL212=EIL34L2θ2 Hence θ2=(Pa2bL2+mL212)(L4EI) Substituting numerical values for the above as given at the top of the problem results inθ2=((1000)(0.625(144))2(0.375(144))(144)2+(200)(144)212)(1444(30×106)(57))=7.7199×103rad

Hence the field displacement u(x) is now foundv(x)=[N]{d}v(x)=(N1(x)  N2(x) N3(x) N4(x)){v1θ1v2θ2}=(N1(x)  N2(x) N3(x) N4(x)){0007.7199×103}= 1L2(Lx2+x3)(7.7199×103)=3.7229×107x35.361×105x2

And a plot of the deflection curve is

clear all; close all; 
v=@(x) 3.7229*10^-7*x.^3-5.361*10^-5*x.^2 
x=0:0.1:144; 
plot(x,v(x),'r-','LineWidth',2); 
ylim([-0.5 0.3]); 
title('beam deflection curve'); 
xlabel('x inch'); ylabel('deflection inch'); 
grid
 

Chapter 3
Finite elements (adding more elements)

3.1 Example 3 redone with 2 elements

Finite elements generated displacements are smaller in value than the actual analytical values. To improve the accuracy, more elements are added. To add more elements, the beam is divided into 2,3,4 and more beam elements. To show how this works, example 3 above is solved again using two elements. It is found that displacement field v(x) becomes more accurate (By comparing the the result with the exact solution based on using the beam 4th order differential equation. It is found to be almost the same with only 2 elements)

3.1 Example 3 redone with 2 elements

The first step is to divide the beam into two elements and number the degrees of freedom and global nodes as follows

There is 6 total degrees of freedom. two at each node. Hence the stiffness matrix for the whole beam (including both elements) will be 6 by 6. For each element however, the same stiffness matrix will be used as above and that will remain as before 4 by 4.

The stiffness matrix for each element is found and then the global stiffness matrix is assembled. Then {pglobal}=[Kglobal]{dglobal} is solved as before.  The first step is to move all loads to the nodes as was done before. This is done for each element. The formulas for equivalent loads remain the same, but now L becomes L/2. The following diagram show the equivalent loading for P

The equivalent loading for distributed load m is

Now the above two diagrams are put together to show all equivalent loads with the original reaction forces to obtain the following diagram

{p}=[K]{d} for each element is now constructed. Starting with the first element(R1m(L2)2M1m(L2)212Pb2(L2+2a)(L/2)3m(L2)2m(L2)212m(L2)212Pab2(L2)2)=EI(L2)3(126(L2)126(L2)6(L2)4(L2)26(L2)2(L2)2126(L2)126(L2)6(L2)2(L2)26(L2)4(L2)2){v1θ1v2θ2} And for the second element(Pb2(L2+2a)(L/2)3m(L2)2m(L2)212m(L2)212Pab2(L2)2R3Pa2(L2+2b)(L2)3m(L2)2m(L2)212+Pa2b(L2)2)=EI(L2)3(126(L2)126(L2)6(L2)4(L2)26(L2)2(L2)2126(L2)126(L2)6(L2)2(L2)26(L2)4(L2)2){v2θ2v3θ3} The 2 systems above are assembled to obtain the global stiffness matrix equation giving(R1m(L2)2M1m(L2)2122Pb2(L2+2a)(L2)32m(L2)22Pab2(L2)2R3Pa2(L2+2b)(L2)3m(L2)2m(L2)212+Pa2b(L2)2)=EI(L2)3(126(L2)126(L2)006(L2)4(L2)26(L2)2(L2)200126(L2)12+126(L2)+6(L2)126(L2)6(L2)2(L2)26(L2)+6(L2)4(L2)2+4(L2)26(L2)2(L2)200126(L2)126(L2)006(L2)2(L2)26(L2)4(L2)2){v1θ1v2θ2v3θ3} The boundary conditions are now applied giving v1=0,θ1=0 since the first node is fixed, and v3=0. And putting 1 on the diagonal of the stiffness matrix corresponding to these known boundary conditions results in(002Pb2(L2+2a)(L/2)32m(L/2)22Pab2(L/2)20m(L2)212+Pa2b(L2)2)=EI(L2)3(1000000100000024006(L2)0008(L2)202(L2)2000010006(L2)2(L2)204(L2)2)(00v2θ20θ3) As was mentioned earlier, another method would be to remove the rows/columns which results in(2Pb2(L2+2a)(L/2)32m(L2)22Pab2(L2)2m(L2)212+Pa2b(L2)2)=EI(L2)3(2406(L2)08(L2)22(L2)26(L2)2(L2)24(L2)2)(v2θ2θ3) Giving the same solution. There are 3 unknowns to solve for. Once these unknowns are solved for, v(x) for the first element and for the second element are fully determined. The following code displays the deflection curve for the above beam

clear all; close all; 
P=400; 
L=144; 
E=30*10^6; 
I=57.1; 
m=200; 
a=0.125*L; 
b=0.375*L; 
A=E*I/(L/2)^3*[1       0        0       0        0     0; 
0       1        0       0        0     0; 
0       0        24      0        0    6*L/2; 
0       0        0   8*(L/2)^2    0 2*(L/2)^2; 
0       0        0       0        1     0; 
0       0      6*L/2  2*(L/2)^2   0  4*(L/2)^2]; 
A 
load = [0; 
0; 
-(m*L/2) - 2*P*b^2*(L/2+2*a)/(L/2)^3; 
-2*P*a*b^2/(L/2)^2; 
0; 
P*a^2*b/(L/2)^2+(m*(L/2)^2)/12] 
sol=A\load
 

Gives

A = 
1.0e+08 * 
0.0000         0         0         0         0         0 
0    0.0000         0         0         0         0 
0         0    0.0011         0         0    0.0198 
0         0         0    1.9033         0    0.4758 
0         0         0         0    0.0000         0 
0         0    0.0198    0.4758         0    0.9517 
load = 
0 
0 
-15075 
-8100 
0 
87750 
sol = 
0 
0 
-0.2735 
-0.0019 
0 
0.0076
 

The above solution gives v2=0.2735 in (downwards displacement) and θ2=0.0019 radians and θ3=0.0076 radians. v(x) polynomial is now found for each elementvelem1(x)=(N1(x)  N2(x) N3(x) N4(x)){v1θ1v2θ2}(N1(x)  N2(x) N3(x) N4(x)){00v2θ2}=( 1(L2)3(3(L2)x22x3) 1(L2)2((L2)x2+x3))(0.27350.0019)=2.188L3(2x332Lx2)0.0076L2(x312Lx2)

The above polynomial is the transverse deflection of the beam for the region 0x L/2. v(x) for the second element is found in similar wayvelem2(x)=(N1(x)  N2(x) N3(x) N4(x)){v2θ20θ3}=(N1(x)  N2(x) N3(x) N4(x))(0.27350.001900.0076)=(N1(x)  N2(x) N4(x))(0.27350.00190.0076)=(1(L2)3((L2)33(L2)x2+2x3)  1(L2)2((L2)2x2(L2)x2+x3) 1(L2)2((L2)x2+x3))(0.27350.00190.0076)

Hence velem2(x)=0.0304L2(x312Lx2)0.0076L2(14L2xLx2+x3)2.188L3(18L332Lx2+2x3) Which is valid for L/2x L. The following is a plot of the deflection curve using the above 2 equations

When the above plot is compared to the case with one element, the deflection is seen to be larger now. Comparing the above to the analytical solution shows that the deflection now is almost exactly the same as the analytical solution. Hence by using only two elements instead of one element, the solution has become more accurate and almost agrees with the analytical solution.

The following diagram shows the deflection curve of problem three above when using one element and two elements on the same plot to help illustrate the difference in the result more clearly.

The analytical deflection for the beam in problem three above (fixed on the left and simply supported at the right end) when there is uniformly loaded with w lbs per unit length is given by v(x)=wx248EI(3L25Lx+2x2) While the analytical deflection for the same beam but when there is a point load P at distance a from the left end is given by v(x)=P(La3(3Lx)x2+L2(3(La)(Lx)x2+2Lxa3)) Therefore, the analytical expression for deflection is given by the sum of the above expressions, givingv(x)=wx248EI(3L25Lx+2x2)P(La3(3Lx)x2+L2(3(La)(Lx)x2+2Lxa3)) Where xa means it is zero when xa is negative. In other words xa=(xa)UnitStep(xa)

The following diagram is a plot of the analytical deflection with the two elements deflection calculated using Finite elements above.

In the above, the blue dashed curve is the analytical solution, and the red curve is the finite elements solution using 2 elements. It can be seen that the finite element solution for the deflection is now in a very good agreement with the analytical solution.

Chapter 4
Generating shear and bending moments diagrams

After solving the problem using finite elements and obtaining the field displacement function v(x) as was shown in the above examples, the shear force and bending moments along the beam can be calculated. Since the bending moment is given by M(x)=EId2v(x)dx2 and shear force is given by V(x)=dMdx=EId3v(x)dx3 then these diagrams are now readily plotted as shown below for example three above using the result from the finite elements with 2 elements. Recalling from above that v(x)=2.188L3(2x332Lx2)0.0076L2(x312Lx2)0.0304L2(x312Lx2)0.0076L2(14L2xLx2+x3)2.188L3(18L332Lx2+2x3)}0xL/2L/2xL HenceM(x)=EI0.0076(6xL)L2+2.188(12x3L)L30.0076(6x2L)L2+0.0304(6xL)L22.188(12x3L)L3}0xL/2L/2xL using E=30×106 psi and I=57 in4 and L=144 in, the bending moment diagram plot is

The bending moment diagram clearly does not agree with the bending moment diagram that can be generated from the analytical solution given below (generated using my other program which solves this problem analytically)

The reason for this is because the solution v(x) obtained using the finite elements method is a third degree polynomial and after differentiating twice to obtain the bending moment (M(x)=EId2vdx2) the result becomes a linear function in x while in the analytical solution case, when the load is distributed, the solution v(x) is a fourth degree polynomial. Hence the bending moment will be quadratic function in x in the analytical case.

Therefore, in order to obtain good approximation for the bending moment and shear force diagrams using finite elements, more elements will be needed.

Chapter 5
Finding the stiffness matrix using methods other than direct method

5.1 Virtual work method for derivation of the stiffness matrix
5.2 Potential energy (minimize a functional) method to derive the stiffness matrix

There are three main methods to obtain the stiffness matrix

  1. Variational method (minimizing a functional). This functional is the potential energy of the structure and loads.
  2. Weighted residual. Requires the differential equation as a starting point. Approximated in weighted average. Galerkin weighted residual method is the most common method for implementation.
  3. Virtual work method. Making the virtual work zero for an arbitrary allowed displacement.

5.1 Virtual work method for derivation of the stiffness matrix

In virtual work method, a small displacement is assumed to occur. Looking at small volume element, the amount of work done by external loads to cause the small displacement is set equal to amount of increased internal strain energy. Assuming the field of displacement is given by u={u,v,w} and assuming the external loads are given by {p} acting on the nodes, hence these point loads will do work given by {δd}T{p} on that unit volume where {d} is the nodal displacements. In all these derivations, only loads acting directly on the nodes are considered for now. In other words, body forces and traction forces are not considered in order to simplify the derivations.

The increase of strain energy is {δε}T{σ} in that same unit volume.

Hence, for a unit volume {δd}T{p}={δε}T{σ} And for the whole volume(1){δd}T{p}=V{δε}T{σ}dV Assuming that displacement can be written as a function of the nodal displacements of the element results inu=[N]{d} Therefore δu=[N]{δd}(2){δu}T={δd}T[N]T

Since {ε}={u} then {ε}=[N]{d}= [B]{d} where B is the strain displacement matrix [B]=[N], hence{ε}=[B]{d}{δε}=[B]{δd}(3){δε}T={δd}T[B]T

Now from the stress-strain relation {σ}=[E]{ε}, hence(4){σ}=[E][B]{d} Substituting Eqs. (2,3,4) into (1) results in{δd}T{p}V{δd}T[B]T[E][B]{d}dV=0 Since {δd} and {d} do not depend on the integration variables they can be moved outside the integral, giving{δd}T({p}{d}V[B]T[E][B]dV)=0 Since the above is true for any admissible δd then the only condition is that {p}={d}V[B]T[E][B]dV This is in the form P=KΔ, therefore [K]=V[B]T[E][B]dV knowing [B] allows finding [k] by integrating over the volume. For the beam element though, u=v(x) the transverse displacement. This means [B]=d2dx2[N]. Recalling from the above that for the beam element,[N]=(1L3(L33Lx2+2x3) 1L2(L2x2Lx2+x3) 1L3(3Lx22x3) 1L2(Lx2+x3)) Hence [B]=d2dx2[N]=(1L3(6L+12x) 1L2(4L+6x) 1L3(6L12x) 1L2(2L+6x)) Hence[K]=V[B]T[E][B]dV=V{1L3(6L+12x)1L2(4L+6x) 1L3(6L12x)1L2(2L+6x)}E(1L3(6L+12x) 1L2(4L+6x) 1L3(6L12x) 1L2(2L+6x))dV=EI0L{1L3(6L+12x)1L2(4L+6x) 1L3(6L12x)1L2(2L+6x)}(1L3(6L+12x) 1L2(4L+6x) 1L3(6L12x) 1L2(2L+6x))dx=EI0L(1L6(6L12x)21L5(4L6x)(6L12x)1L6(6L12x)21L5(2L6x)(6L12x)1L5(4L6x)(6L12x)1L4(4L6x)21L5(4L6x)(6L12x)1L4(2L6x)(4L6x)1L6(6L12x)21L5(4L6x)(6L12x)1L6(6L12x)21L5(2L6x)(6L12x)1L5(2L6x)(6L12x)1L4(2L6x)(4L6x)1L5(2L6x)(6L12x)1L4(2L6x)2)dx=EI(12L36L212L36L26L24L6L22L12L36L212L36L26L22L6L24L)=EIL3(126L126L6L4L26L2L2126L126L6L2L26L4L2)

Which is the stiffness matrix found earlier.

5.2 Potential energy (minimize a functional) method to derive the stiffness matrix

This method is very similar to the first method actually. It all comes down to finding a functional, which is the potential energy of the system, and minimizing this with respect to the nodal displacements. The result gives the stiffness matrix.

Let the system total potential energy by called Π and let the total internal energy in the system be U and let the work done by external loads acting on the nodes be Ω, thenΠ=UΩ Work done by external loads have a negative sign since they are an external agent to the system and work is being done onto the system. The internal strain energy is given by 12V{σ}T{ε}dV and the work done by external loads is {d}T{p}, hence(1)Π=12V{σ}T{ε}dV{d}T{p} Now the rest follows as before. Assuming that displacement can be written as a function of the nodal displacements {d}, hence u=[N]{d} Since {ε}={u} then {ε}=[N]{d}= [B]{d} where B is the strain displacement matrix [B]=[N], hence{ε}=[B]{d} Now from the stress-strain relation {σ}=[E]{ε}, hence(4){σ}T={d}T[B]T[E] Substituting Eqs. (2,3,4) into (1) results inΠ=12V{d}T[B]T[E][B]{d}dV{d}T{p} Setting Π{d}=0 gives0={d}V[B]T[E][B]dV{p} Which is on the form P=[K]D which means that[K]=V[B]T[E][B]dV As was found by the virtual work method.

Chapter 6
References

  1. A first course in Finite element method, 3rd edition, by Daryl L. Logan
  2. Matrix analysis of framed structures, 2nd edition, by William Weaver, James Gere

1Instead of removing rows/columns for known boundary conditions, we can also just put a 1 on the diagonal of the stiffness matrix for that boundary conditions. I will do this example again using this method