0% found this document useful (0 votes)
72 views97 pages

Final Project 2021

The document describes a project report submitted by three students for their degree in civil engineering. It discusses shear force and bending moment diagrams, which are important tools in structural analysis and design. The report specifically examines Macaulay's method, which is a graphical technique for determining shear forces and bending moments at different points along a beam. It also demonstrates how to generate shear force and bending moment diagrams using MATLAB, a computer programming software.

Uploaded by

Timothy Umpo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views97 pages

Final Project 2021

The document describes a project report submitted by three students for their degree in civil engineering. It discusses shear force and bending moment diagrams, which are important tools in structural analysis and design. The report specifically examines Macaulay's method, which is a graphical technique for determining shear forces and bending moments at different points along a beam. It also demonstrates how to generate shear force and bending moment diagrams using MATLAB, a computer programming software.

Uploaded by

Timothy Umpo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 97

DISCONTINUITY FUNCTION FOR DETERMINATION OF

SHEAR FORCE AND BENDING MOMENT WITH IT’S


IMPLEMENTATION IN MATLAB

A PROJECT REPORT

SUBMITTED IN PARTIAL FULFILLMENT OF REQUIREMENT FOR THE

AWARD OF

DEGREE IN CIVIL ENGINEERING

BY

NAKO UMPO D/17/CE/107

SUMEET KUMAR JHA D/18/CE/201

MEDDAK DOJI D/18/CE/213

Under the guidance of

Mr. S. K. SAHU

Department of Civil Engineering

NORTH EASTERN REGIONAL INSTITUTE OF SCIENCE AND TECHNOLOGY

(DEEMED TO BE UNIVERSITY)

Nirjuli, Arunachal Pradesh-791109

June 2021

i
ACKNOWLEDGEMENT

It is always pleasure to remind the fine people in NERIST for their sincere guidance we received to
uphold our Project as well as programming skills.

First of all, thanks to our parents for giving enthusiasm, encouragement and support to us without
whom this Project would not have been completed properly to this extent.

Secondly, we had like to express our deepest thanks to our project guide Associate Professor Mr.
S.K. Sahu for his invaluable assistance and guidance towards our project work. It is he who holds the
full credit to bring this project to completion.

Thirdly, our special thanks to Prof. Dr. Ajay Bharti, HOD Civil Engineering department
NERIST,for other assets of the department for carrying out the project.

Finally, we appreciate all other unnamed persons who helped us in various ways.

Place: NERIST, Nirjuli

Date: 5th JUNE 2021

NAKO UMPO D/17/CE/107

SUMEET KUMAR JHA D/18/CE/201

MEDDAK DOJI D/18/CE/213

ii
iii
ABSTRACT

Shear force and Bending moment diagram is one of the most important tool used in structural
analysis, which help us to perform structural design by determining value of shear force and bending
moment at various point of a structural element such as a beam. These diagram helps us to determine
the size, shape and material of a member in a structure so that the given sets of loads can be
withstood without any structural failure.

The most common applications of shear force and bending moment diagram is to determine the
value of slope and deflection, which can be easily determined by methods like moment area method,
conjugate beam methods or Macaulay’s method. The type of reinforcement, the amount of
reinforcement and the position of reinforcement in any civil engineering structure is totally
dependent upon the amount of moment acting and the position of moment i.e where it is acting.
Stirrups or shear reinforcement provided in any civil engineering structure is based on the amount of
shear force acting upon it

By analyzing the shear force diagram and bending moment diagram we get the ideas where the shear
force and bending moment is maximum and minimum. There are various types of beam and each
beam has various bending moment and shear force diagram. The shear force and bending moment
diagram varies according to load and boundary conditions. In the report Macaulay’s method has
been explained and some examples for better understanding of the method has also been solved. The
use of Macaulay’s method through MATLAB has also been elucidated in chapter 3 along with some
series of examples where the SFDs and BMDs were generated using MATLAB.

iv
TABLE OF CONTENT

Contents Page
Chapter 1 SHEAR FORCE AND BENDING MOMENT DIAGRAM

1.1 Definition of beam 1


1.2 Types of Beams 1
1.3 Statically indeterminate beam 3
1.4 Bending moment 4
1.5 Shearing Force 4
1.6 Shear stress in beams 4
1.7 Examples 5
Chapter 2 MACAULAY’S METHOD

2.1 Introduction to Macaulay’s method 11


2.2 Rules of Macaulay’s method 12
2.3 Examples 14
2.4 Steps for macaulay’s method 28

Chapter 3 SFD AND BMD THROUGH COMPUTER PROGRAM

3.1 Introduction to Computer program MATLAB 29


3.2 Examples 31
3.3 Macaulay methods using MATLAB 66
3.4 Program for singularity function 68

Chapter 4 CONCLUSION

4.1 Conclusion 91
4.2 Scope 91

References 92

v
Chapter 1
SHEAR FORCE AND BENDING MOMENT DIAGRAM

1.1 Definition of beam


A bar subjected to forces or couples that lie in a plane containing the longitudinal axis of the bar is
called beam. The forces are understood to act perpendicular to the longitudinal axis.

1.2 Types of beams

Cantilever beam
If a beam is supported at only one ends in such a manner that axis of the beam cannot be rotated at
that point. Such beam is called Cantilever beam.

Simply supported beam


A beam that is freely supported at both ends is called simple beams. The term freely supported
means that the end supports are capable of exerting only forces upon the bar and not capable of
exerting any moment.

Overhanging beam
A beam freely supported at two points and having one or both ends extending beyond their support
is called an overhanging beam.

1
All the beams considered above, the cantilever, simple beams, and overhanging beams are In
which the reactions at the support may be determine by the equations of static equilibrium. Such
beams are said to be statically determinate.

2
1.3 STATICALLY INDETERMINATE BEAMS
If the number of reactions exerted upon the beams exceed the number of equations of static
equilibrium, then the static equilibrium must be supplemented by equations based upon the
deformations of the beams. In this case the beams is said to be statically indeterminate. An example
of statically indeterminate beam is shown in figure

It is desirable to study the internal stresses across the section at D, located at a distance x from the left
end of the beam. To do this let us consider the beam to be cut at D and the portion of the beam to the
right of D is removed. The portion removed must be replaced by the effect it exerted upon the portion
to the left of D and this effect will consist of a vertical shearing force together with a couple, as
represented by the vector V and M, respectively in the free body diagram of the left portion of the
beam as shown in the above figure.

3
1.4 BENDING MOMENT
The algebraic sum of the moment of the external forces to one side of the section D about an axis
through D is called the bending moment at D. This is represented by

R1x-P1(x-a)-P2(x-b)
For the loading considered above

1.5 SHEARING FORCE


the algebraic sum of all the vertical forces to one side, say the left side, of section D is called the
shearing force at that section. This is represented by R1-P1-P2 for the above loading. The shearing
force is opposite in direction to the resisting shear of the same magnitude

1.6 SHEAR STRESS IN BEAMS


Stresses associated with variations of bending moment along with the axis of the beam. Shear force is
related to change in bending moment between adjacent sections. When a beam subjected to non-
uniform bending then the normal stress associated with bending moment which are obtained from the
flexure formula

In case of non-uniform bending, both the bending moment (M) and the shear force (V) act on the
cross sections. Bending stress are associated with bending moment (M) and shear stresses are
associated with shear force (V)

4
5
Zone x V(x) M(x)

𝑊𝑥
i 0<𝑥<𝑎 𝑉(𝑥)= −𝑤𝑥 𝑀(𝑥)= −
2

𝑙 𝑊
ii 𝑎<𝑥<𝑙+𝑎 𝑉(𝑥)=𝑊(𝑎+ −𝑥) 𝑀(𝑥)= (𝑥(𝑙+2𝑎−𝑥)−𝑎(𝑙+2𝑎))
2 2

𝑊
iii (𝑙+𝑎)<𝑥<(𝑙+2𝑎) 𝑉(𝑥)=𝑊(2𝑎+𝑙−𝑥) 𝑀(𝑥)= − (𝑙+2𝑎−𝑥2)
2

6
7
8
9
Range Equation of SF (kN) Equation of BM (kNm)

0 to 20 -47.50 -47.50x

20 to 40 -47.50 -47.50x + 400

40 to 50 -30x + 1500 -15x2 + 1500x - 37500

10
Chapter 2
MACAULAY’S METHOD

2.1 Introduction to Macaulay’s method

William Herrick Macaulay was a British mathematician. He introduced the equation to find out the
Slope and Deflection of beam. Macaulay’s method is also called as the double integration method.
This method is a technique used in structural analysis to determine the deflection of Euler Bernoulli’s
beam. Use of Macaulay’s technique is very convenient in cases of discontinuous and/or discrete
loading. Concentrated forces and couples can be represented using singularity functions, whereas

distributed loads (udl and uvl) on beams can be efficiently described using Macaulay functions In .
this method, bending moment at any section is expressed in the systematic order. In Macaulay’s
method, we used the double integration concept to get slope and deflection respectively.

Slope is obtained by integrating bending moment and then deflection is obtained by integrating slope
equation. The section x is to be taken in the last portion of the beam. In this method, bending moment
due to each force or UDL is separated by compartment lines. Macaulay’s method enables us to write a
11
single equation for bending moment for the full length of the beam. When coupled with the Euler-
Bernoulli theory, we can then integrate the expression for bending moment to find the equation for
deflection using the double integration method. Macaulay developed a method based on discontinuity
function and that is convenient to express shear, bending moment, rotation and deflection. A single
equation is written for the complete length of the beam which has been explained in section 2.3.
2.2 Rules of Macaulay’s Method
For integral values of n ≥ 0, the Macaulay’s functions ⟨𝑥 − 𝑎⟩𝑛 are defined by the following expressions:

0, 𝑓𝑜𝑟 𝑥 < 𝑎
⟨𝑥 − 𝑎⟩𝑛 = { n=0,1,2…..
(𝑥 − 𝑎)𝑛 𝑓𝑜𝑟 𝑥 ≥ 𝑎
The rules of integration for discontinuity functions are given as

𝑛 ⟨𝑥 − 𝑎⟩𝑛+1 , 𝑓𝑜𝑟 𝑛 ≤ 0
∫⟨𝑥 − 𝑎⟩ 𝑑𝑥 = { 1
(𝑥 − 𝑎)𝑛+1 𝑓𝑜𝑟 𝑛 > 0
𝑛+1

12
–1
–M0 x-a

P0 x –a 0

2.3 Examples
13
2.3 Examples
Example 2.3.1
Construct the load function p(x) and then to perform the required integrations to get V(x) and
M(x), from the following Figure.
16 kN
8 kN/m

4m 2m
2m

Solution,
Taking the moment of forces about the A
( ∑M )A = 0;
(8 kN/m)(4 m)(2 m) + (16 kN)(6 m) - By(4 m) = 0
By = 40 kN
( ∑M )B = 0;
Ay (4 m) - (8 kN/m)(4 m)(2 m) + (16 kN)(2 m) = 0
Ay = 8 kN
P(x) = 8 < x-0 >-1 – 8[< x-0 >0 - < x-4 >0 ] + 40< x-4 >-1 -16< x-6 >-1 .................... (1)
Integrating eq. 1 for shear force
V(x) = 8 < x >0 – 8[< x >1 - < x-4 >1] + 40< x-4 >0 -16< x-6 >0 .............................(2)
Again integrating eq. 2 for bending moment
M(x) = 8 < x >1 – 8[1< x >2 - 1< x-4 >2] + 40< x-4 >1 -16< x-6 >1 ........................ (3)
2 2

Calculation Table 2.3.1


Distance (X) in m 0.001 1 2 3 3.99 4.001 5 6.00

Shear Force V (x) in kN 8 0 -8 -16 -24 16 16 16

Bending Moment M (x) in kNm 0 4 0 -12 -32 -32 -16 0

14
Example 2.3.2

Construct the load function p(x) and then to perform the required integrations to get V(x) and
M(x), from the following Figure.

15
Solution
0.800 x 5 = 4 kN @ 2.5
0.5 x 0.800 x 5 = 2N @ 3.333
Total load = 0.6000
X = distance from left end.
( 0.40 x 2.5 ) + ( 0.20 x 3.333 ) = 0.60 x X
X = 2.77
Taking the moment of forces about the A
∑MA = 0
RB x 5 = 0.60 x 2.77
RB = 3.333 kN
RA = 2.667 kN

P(x) = 2.667< x – 0 >-1 – 0.80< x – 0 >0 - 0.800< x – 0 >1 + 3.333< x – 5 >-1 ............... (1)
5
Integrating eq. 1 for shear force
V(x) = 2.667< x – 0 >0 – 0.80< x – 0 >1 - 0.800< x – 0 >2 + 3.333< x – 5 >0 ................... (2)
10
Again integrating eq. 2 for bending moment
M(x) = 2.667< x – 0 >1 – 0.800< x – 0 >2 - 0.800< x – 0 >3 + 3.333< x – 5 >1
2 30
Calculation Table 2.3.2

Distance (X) in m 0.0001 1 2 2.99 3 4 5

Shear Force V (x) in kN 2.66 1.78 0.74 -0.458 -0.46 -1.82 -3.333

Bending Moment M (x) in


0 2.24 3.52 3.685 3.681 2.561 0
kNm

16
Example 2.3.3
Construct the load function p(x) and then to perform the required integrations to get V(x) and M(x), from
the following Figure.

Solution;
∑Fy = 0,
By – 2 – 0.5(1 + 3) x 6 = 0
By = 14 kN
+ ∑MB = 0;
MB – 2 x 6 – 1 x 6 x 3 – 0.5 x 6 x 2 x 2 = 0
MB = 42 kNm
Now V(x),
2
P(x) = -1< x – 0 >0 – 2< x – 0 >-1 + (− )< x – 0 >1 + 14< x – 6 >-1 + 42< x – 6 >-2
6
1
V(x) = -1< x – 0 > – 2< x – 0 > + (− )< x – 0 >2 + 14< x – 6 >0 + 42< x – 6 >-1
1 0
6
Checking,
V (0) = 0,
1
V (6) = -1< 6 – 0 >1 – 2< 6 – 0 >0 + (− )< 6 – 0 >2 + 14< 6 – 6 >0
6
V (6) = - 6 -2 - 1 x 36 + 14 x 0
6
V (6) = -14 kN
1
M(x) = -1< x – 0 >2 – 2< x – 0 >1 + (− )< x – 0 >3 + 14< x – 6 >1 + 42< x – 6 >0
2 18
Checking,
M (0),
1
M(6) = -1< 6 – 0 >2 – 2< 6 – 0 >1 + (− )< 6 – 0 >3 + 14< 6 – 6 >1 + 42< 6 – 6 >0
2 18
M(6) = -1 x 36 – 2 x 6 - 1 63
2 18
M(6) = - 42 kNm

17
Calculation Table 2.3.3
Distance (X) in m 0.001 1 2 3 4 5 5.999

Shear Force V (x) in kN -2 -3.16 -4.67 -6.5 -8.667 -11.167 -14

Bending Moment M (x) in kNm 0 -2.555 -6.444 -12 -14.55 -29.44 -42

6m

-
2k SHEAR FORCE
N - DIAGRAM
3.16
kN
-
4.67kN -6.5
kN
-8.667
kN

-11.167
kN
-
14kN

-
2.55kN
m
-
6.444kNm -12
kNm
BENDING MOMENT
-14.55 DIAGRAM
kNm

-29.44
kNm
18
Example 2.3.4

For the simply supported beam shown in the Fig. draw shear force
and bending moment diagram

10 20 20 kN
Taking moment about A,we have
Ey*5 = (10*1)+(20*2)+(20*3) B C D E
A
Ey=22 kN
From thrust equations we have
Ay+Ey=50 kN
Ay =28 kN 1m 1m 1m 2m
A =28 kN
By referring from table,we can write
P(x)=28<x-0>-1-10<x-1>-1-20<x-2>-1-20<x-3>-1+22<x-5>-1
V(x)= 28<x-0>0-10<x-1>0-20<x-2>0-20<x-3>0+22<x-5>0
M(x)= 28<x-0>1-10<x-1>1-20<x-2>1-20<x-3>1+22<x-5>1

Calculation Table 2.3.4

Distance (x) 0+ 1 2 3 4 5- 5+
V (x) kN 28 28 18 -2 -22 -22 -22
M (x) 0 28 46 44 22 0 0
kNm

28 kN 28 kN

18 kN

2 kN
22kN Shear force diagram
1m 1m 1m 2m

19
Bending Moment diagram
46 kNm
44 kNm
28 kNm
22 kNm

1m 1m 1m 2m

20
Example 2.3.5

An L-shaped frame BD is welded to the beam AC in Fig.2. A downward vertical load


P is applied at D as shown. Neglecting the width of the connection at B,
determine the shear force and bending moment expressions and also draw their
SFD and BMD
a
D
Taking moment about A we have,
B
Cy*5a=P(2a)+Pa C
Cy=3P/5 A
Cy=3P/5 kN
2a 3a

P
Now, Ay+Cy=P
Ay = P-3P/5 Pa

Ay=2P/5 B
C

From table we have, 2a 3a

Po(x) = 2P/5<x-0>-1-P<x-2a>-1+Pa<x-2a>-2+Pa<x-2a>-2+3P/5<x-5a>-1
Vo(x)= 2P/5<x-0>0-P<x-2a>0+Pa<x-2a>--1+Pa<x-2a>-1+3P/5<x-5a>o
Mo(x)= 2P/5<x-0>1-P<x-2a>1+Pa<x-2a>o+Pa<x-2a>0+3P/5<x-5a>-1

Calculation Table 2.3.5

x 0+ 2a- 2a+ 5a

V(x) 2P/5 2P/5 -3P/5 -3P/5


M(x) 0 0.7999P 0.80001P+Pa 0

2P/5

SHEAR FORCE DIAGRAM

2a 3a

3P/5
21
0.800004P+Pa Bending moment diagram

0.799999P

0 0

2a 3a

22
Example 2.3.6

.
Plot the shear force diagram and the moment diagram for the beam AC in Fig.

3 kN/m 2 kN/m

A
B C

3m 3m

=2*3=6 k N @ 1.5 m from A


=.5*1*3= 1.5 k N @ 1m from A.
C.G of the above loading will act at
7.5 k N
Taking moment=about
(6*1.5)+(1.5*1) 7.5 * dA, We have
3 kN/m 2 kN/m
C *6=7.5* 1.4
d =y1.4 m from A
Cy = 1.75 kN
A Ay +Cy = 7.5 kN
B C
1.4m Ay = 5.75 kN
3m 3m

From table 1 we have,


1
Po(x)= 5.75<x-0>-1-3<x-0>0+3<x-3>0+( )<x-0>1-1<x-3>0-(1)<x-3>1+1.75<x-6>-1
1
Vo(x)= 5.75<x-0>0-3<x-0>1+3<x-3>1+( 3)<x-0>2-1<x-3>1- 13)<x-3>2+1.75<x-6>0
(
6 6

1 1 1
Mo(x)= 5.75<x-0>1- 3 <x-0>2+3 <x-3>2+( ) <x-0>3 - <x-3>2-( )<x-3>3+1.75<x-6>1
2 2 18 2 18

23
Calculation Table 2.3.6

Distance (X) 0+ 1 2 3- 3+ 4 5 6

V (X) kN 5.75 2.916666 0.416667 -1.74999 -1.75 -1.75 -1.75 -1.75

M (X) kNm 0 4.30555 5.9444 5.25 5.249 3.5 1.75 0

5.75 kN
2.91666kN

0.416667 kN
SHEAR FORCE DIAGRAM

-1.74999 kN -1.75 kN -1.75 kN

6m

4.3055 5.9444
kNm kNm 5.250
kNm
3.5
kNm 1.75
kNm

0. kNm 0 kNm
6m

BENDING MOMENT DIAGRAM


24
Example 2.3.7

Two beam segments, AC and CD, are connected together at C by a frictionless pin as
shown in Fig. Segment CD is cantilevered from a rigid support at D, and segment
AC has a roller support at A. (a) Determine the reactions at A and D. (b) Draw SFD
and BMD diagram

∑Fy=0
Ay + Dy = 6 kN + 20 kN
∑MA = 0
(6*4)+(2*10)*(8+5)-Dy*18+MD= 0
18 Dy- MD= 284 kN
6 kN

2 kN/m

A E
D D
B C

4m 4m 5m 5m

Taking moment about hinge at C


Ay*8-24=0
6kN
Ay=3 and Dy = 23 kN
18 Dy - MD=284 k N m
MD=130 k N m

4m 4m
Ay

From table we have,


Po(x)=3<x-3>-1-6<x-4>-1-2<x-8>0+23<x-18>-1-130<x-18>-2 Vo(X)=
3<x-3>0-6<x-4>0-2<x-8>1+23<x-18>0-130<x-18>-1 Mo(X)=
3<x-3>1-6<x-4>1-<x-8>2+23<x-18>1-130<x-18>0

25
CALCULATION TABLE 2.3.7

x 0 2 4 6 8- 8+ 10 12 14 16 18
+

V (x) 3 3 -3 -3 -3 -5 -7 -11 -15 -19 -23

M (x) 0 6 12 6 0.00003 0.00005 -10 -28 -54 -88 -130

26
6kN
130 kNm

2 kN/m

A E

B C

5m 5m
4m 4m

3 kN

-3 kN

SHEAR FORCE DIAGRAM -23 kN

12 kN m

0 kNm

BENDING MOMENT DIAGRAM

27
2.4 Steps for Macaulay’s Method

W1 W2 W3
X

a1
a2
a3

𝑨𝒚 x 𝑩𝒚
X
Figure: showing a Simply Supported Beam carrying concentrated load

We have following information from above figure.


W1, W2, and W3 are the load acting on the beam AB.
a1, a2, and a3 are distance of point load W1, W2, and W3 respectively from support A.
Calculation of support reactions i.e. 𝐴𝑌 & 𝐵𝑦 .
Take a section X-X at a distance small x from left support.
The equation for loading at any distance x is given by
𝑤(𝑥) = −𝑊1 ⟨𝑥 − 𝑎1 ⟩−1 − 𝑊2 ⟨𝑥 − 𝑎2 ⟩−1 − 𝑊3 ⟨𝑥 − 𝑎3 ⟩−1
The equation for shear at any distance x is given by
V(𝑥) = 𝐴𝑦 − 𝑊1 ⟨𝑥 − 𝑎1 ⟩0 − 𝑊2 ⟨𝑥 − 𝑎2 ⟩0 − 𝑊3 ⟨𝑥 − 𝑎3 ⟩0
The equation for Bending moment at any distance x is given by
M(𝑥) = 𝐴𝑦 𝑥 − 𝑊1 ⟨𝑥 − 𝑎1 ⟩1 − 𝑊2 ⟨𝑥 − 𝑎2 ⟩1 − 𝑊3 ⟨𝑥 − 𝑎3 ⟩1

Find constant by applying Boundary Condition:

At x = 0 ; y = 0, V = 𝐴𝑦 and M = 0.
At x = L ; y = 0, V = 𝐴𝑦 − 𝑊1 − 𝑊2 − 𝑊3 = −𝐵𝑦 and M = 0.
Applying boundary condition in deflection equation one at a time to get on constants C1 & C2,
Once C1 & C2 are known then put their values in equation (2) & (3) respectively. Hence, we will get the slope
upon integrating it once & deflection equation on integrating it the second time.

28
Chapter 3
SFD AND BMD THROUGH COMPUTER PROGRAMS

3.1 Introduction to computer program MATLAB


These days the use of computer has become very integral in civil engineering or any other sort of
engineering related things. The hefty calculations that are involved in everyday civil related
problems are too large to be handled manually which have given rise to many programs and
softwares that can efficiently do these calculations to give the desired results. One such very
powerful software is MATLAB that can process many mathematical calculations and processes very
effectively that too to a great extent not achieved by other similar softwares like excel. MATLAB is
an acronym of Matrix laboratory that uses matrices to perform all it’s complex calculations.
MATLAB is very popular among the research scholars due to it’s very powerful mathematical
features embedded into it that enables it to make plots, solve very tough equations to a great
accuracy, program animations, GUIs (Graphical User Interface) etc. Unlike many other
programming language that are very difficult to understand, MATLAB uses programming language
that can be easily understood by a person with very basic programming language.

Some of the advantages of MATLAB are as follows


1. MATLAB is very easy to use.
2. It is platform independent.
3. MATLAB has large number of predefined functions that reduces the length of code thereby
making it more concise.
4. It is a kind of interpreter language as it’s program have a language that anyone with basic
knowledge of programming can interpret it very easily.

29
Along with their advantages MATLAB also has some disadvantages and they are listed as follows
1. MATLAB executes slowly.
2. It has a very large size.
3. MATLAB official license is very costly.

30
3.2 Examples
Shown below are some examples of FBD (Free Body diagram), SFD (Shear force diagram) and
BMD (Bending moment diagram) prepared automatically by MATLAB.

Example 3.2.1: A Simply supported beam of length 10 m having equal overhangs of 5m on both
sides carries u.d.l of 10 kN/M Over it’s complete length. Draw it’s FBD SFD and BMD.

Solution:
10(kN/M)

5m 10m 5m

31
32
MATLAB generated code for the above problem is as follows
function [varargout] = SFBM( varargin)
%SFBM calculates the shear force and bending moment, plot the diagram and
%computes the equations of the lines.
global Name nc nd nm Cload Dload Mload Cloc Dolce Bloc Xload DistFfun ....
DistPoly Xtick YtickSF YtickBM DeciPlace TypeF TypeM TypeD EqRange

N = nargin;
NP = 1000;

33
DeciPlace = 2;
Name = varargin{1};
Length = varargin{2}(1);
if numel(varargin{2}) == 1
Supports = 0;
else
Supports = varargin{2}(2:end);
end
Support1 = Supports(1);
M = 0; % sum moment about support 1.
F = 0; % sum vertical forces .
nc = numel(varargin{2}) - 1; nd = 0; nm = 0;
DistFfun = {}; DistPoly = {}; Xload = [0,varargin{2}];
Cload = {}; Dload = {}; Mload = {};
Cloc = {}; Dloc = {}; Mloc = {};
Xtick = []; YtickSF = []; YtickBM = [];
TypeF = []; TypeM = []; TypeD= [];
for n = 3:N
LoadCell = varargin{n};
type = LoadCell{1};
load = LoadCell{2};
loc = LoadCell{3};
Xload = union(Xload, loc);
if strcmp(type,'CF')
Mcl = load*(loc - Support1);
M = M + Mcl;
Fcl = load;
F = F + Fcl;
Cload = [Cload;{load}];
Cloc = [Cloc;{loc}];
TypeF = [TypeF,'a'];
nc = nc + 1;
elseif strcmp(type,'DF')
if (numel(load) == 1) load = repmat(load,size(loc)); end
p = polyfit(loc - Support1, load, numel(loc) - 1);
DistPoly = [DistPoly, {p}];
power = numel(p) - 1: -1: 0;
Ffun = @(x) sum(p.*(x - Support1).^(power + 1)./(power + 1));
DistFfun = [DistFfun, {Ffun}];
Fbl = Ffun(loc(end)) - Ffun(loc(1));
F = F + Fbl;
Mfun = @(x) sum(p.*(x - Support1).^(power + 2)./(power + 2));
Mbl = Mfun(loc(end)) - Mfun(loc(1));
M = M + Mbl;
Dload = [Dload;{load}];
Dloc = [Dloc;{loc}];
TypeD = [TypeD,'a'];
nd = nd + 1;
elseif strcmp(type,'M')
M = M + load;

34
Mload = [Mload;{load}];
Mloc = [Mloc;{loc}];
TypeM = [TypeM,'a'];
nm = nm + 1;
end
end
Xload = Round(Xload,2);
if numel(varargin{2}) == 1
TypeD = [TypeD,'r'];
p = -F/Length;
power = numel(p) - 1: -1: 0;
Dload = [Dload;{[p, p]}];
Dloc = [Dloc;{[0,Length]}];
DistPoly = [DistPoly, {p}];
Ffun = @(x) sum(p.*(x - Support1).^(power + 1)./(power + 1));
DistFfun = [DistFfun, {Ffun}];
Xload = [Xload,Length];
nd = nd + 1;
elseif (numel(Supports) > 1)
B = -M/(Supports(2) - Support1); % Reaction B
A = -(F + B); % Reaction A
Cload = [{A};Cload;{B}];
TypeF = ['r',TypeF,'r'];
Cloc = [{Supports(1)};Cloc;{Supports(2)}];
else
if Support1 > 0
A = -F; % Reaction A
Cload = [Cload;{A}];
TypeF = [TypeF,'r'];
Cloc = [Cloc;{Support1}];
Mload = [Mload;{-M}];
TypeM = [TypeM,'r'];
Mloc = [Mloc;{Support1}];
else
A = -F; % Reaction A
Cload = [{A};Cload];
TypeF = ['r',TypeF];
Cloc = [{Support1};Cloc];
Mload = [{-M};Mload];
TypeM = ['r',TypeM];
Mloc = [{Support1};Mloc];
end
nm = nm + 1;
end
NewCcrossed = 0; NewMcrossed = 0;
function [sf, bm] = SF(x)
sf = 0; bm = 0;
NewCcrossed = 0; NewMcrossed = 0;
for i = 1:nc
if x > Cloc{i}

35
if i > Ccrossed
Ccrossed = i; NewCcrossed = 1;
end
sf = sf + Cload{i};
end
end

for i = 1:nd
loc = Dloc{i};
if x > loc(1)
Ffun = DistFfun{i};
sf = sf + Ffun(min([x,loc(end)])) - Ffun(loc(1));
end
end

for i = 1:nm
if x > Mloc{i}
if i > Mcrossed
Mcrossed = i; NewMcrossed = 1;
end
bm = bm - Mload{i};
end
end
end
EqRange = [0;cell2mat([Cloc(:); Mloc(:)]);Length]';
for n = 1:numel(Dloc)
EqRange = [EqRange,Dloc{n}];
end
EqRange = unique(EqRange);
dx = Length/NP;
X = 0; base = 0;
Ccrossed = 0; Mcrossed = 0;
ShearF = 0;
BendM = 0;
for n = 1:NP + 2
xx = (n - 1)*dx;
[sf,bm] = SF(xx);
% handling discontinuities
if(NewCcrossed || NewMcrossed)
if (NewCcrossed && NewMcrossed)
[sfc,bmc] = SF(Cloc{Ccrossed}); xc = Cloc{Ccrossed};
sfc2 = sfc + Cload{Ccrossed}; bmc2 = bmc - Mload{Mcrossed};
elseif (NewCcrossed && ~NewMcrossed)
[sfc,bmc] = SF(Cloc{Ccrossed}); xc = Cloc{Ccrossed};
sfc2 = sfc + Cload{Ccrossed}; bmc2 = bmc;
elseif (~NewCcrossed && NewMcrossed)
[sfc,bmc] = SF(Mloc{Mcrossed}); xc = Mloc{Mcrossed};
sfc2 = sfc; bmc2 = bmc - Mload{Mcrossed};
end
X = [X; xc; xc]; Xtick = [Xtick; xc; xc];

36
ShearF = [ShearF; sfc; sfc2]; YtickSF = [YtickSF; sfc; sfc2];
BendM = [BendM; base + bmc; base + bmc2]; YtickBM = [YtickBM; base + bmc; base + bmc2];
end
if n > 1 && n < NP + 2
X = [X;xx];
ShearF = [ShearF; sf];
base = base + 0.5*dx*(sf + ShearF(end - 1));
BendM = [BendM; bm + base];
end
end
SpecialPoints(X, ShearF, BendM);
Diagrams(X, ShearF, BendM)
varargout = {X, ShearF, BendM};
end

Example 3.2.2

The simply supported beam is subjected to uniform load over a segment DB together with
concentrated load at C. 12kN
Draw SFD and BMD

10 KN/m

A 2.5 metres B 1 metre C 1 metre D

Solution:

37
38
39
Example 3.2.3

A simply supported bean is subjected to a uniformly distributed load and a moment as shown below.

Draw the SFD and BMD.


400kNm 30 kN /m

20m 20m 10m


Solution:

40
41
Example 3.2.4
Draw SFD and BMD of the following simply supported beam with loading as shown below.

800 N 2000N 1000N


C A D B E
5m
3m 8m 2m

Solution:

42
43
Example 3.2.5
Draw SFD and BMD of the following simply supported beam with loading as shown below.

4kN 6kN 8kN


0
j 30 600 450

2m 2m 2m 2m

Solution:

44
45
The following problem is an example where there is an indeterminate beam in which there
are four unknowns, but since the two unknowns have already been predetermined and given
in the question, the remaining only two reactions need to be determined and the problem
becomes similar to that of a statically determinate beam. Finally, for each case SFD and
BMD were drawn using singularity function.
Example 3.2.6

10 k N/m

A B C D

4m 4m 4m

Number of unknown
reaction=4
Degree of indeterminacy = 2
Given two information compute the remaining information

Knowing that Evaluate


(i) Ay= 16 k N, By =44 k N Cy Dy MB MC
(ii) Ay= 16 k N, Cy =44 k N By Dy MB MC
(iii) Ay= Dy = 16 Kn By Cy MB MC
(iv) By= Cy = 44 Kn Ay Dy MB MC
(v) Ay= 16 k N, MB = 16 k N . m By Cy Dy MC
(vi) Ay= 16 k N, Mc = 16 k N . m By Cy Dy MB
(vii) By= 44 k N, MB = 16 k N . m Ay Cy Dy MC
(viii) By= 44 k N, Mc = 16 k N . m Ay Cy Dy MB
Ay By Cy Dy

Solution:
The matlab program which has been used in order to determine the unknown reactions is
presentedbelow along with the results of case (i), case(iv), case(vi) and case(ix).
The MATLAB program code:
%% solving for the reactions when other values are known for a simply supported beam
having threespans loaded by a udl
%% If known reactions are Ay&By then enter 1,
%% If known reactions are Ay&Cy then enter 2,
46
%% If known reactions are Ay&Dy then enter
%% If known reactions are By&Cy then enter 4,
%% If known reactions are Ay&M_B then enter 5,
%% If known reactions are Ay&M_C then enter 6,
%% If known reactions are By&M_B then enter 7,
%% If known reactions are By&M_C then enter 8,
%% If known reactions are M_B&M_C then enter 9,
L = input('enter the total length of span of the beam in
meters')L1 = input('enter the length of each span')
W = input('enter the value of uniformly distributed load throughout in kN/m')
M = input('enter the no for known reactions in the following way like Ay&By
then 1')if M == 1
Ay = input('enter the known reaction
Ay') By = input('enter the known
reaction By') disp('The value of M_B
is')
M_B =((W*L1)/2 - Ay)*L1
disp('The value of M_C is')
M_C = (W*L1+2*M_B/L1 - By)*L1
disp('The value of Dy
is')Dy= 0.5*W*L1-
M_C/L1
disp('The value of Cy is')
Cy= W*L1+(2*M_C-M_B)/L1
% SFBM('case 1',[12,4,8,12],{'CF',Ay,0},{'CF',By,4},{'CF',Cy,8},{'CF',Dy,12},{'DF',-
10,[0,12]})
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V
)hold on
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-

47
8).*(x>8);plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment

48
grid on
elseif M == 2
Ay = input('enter the known reaction Ay')
Cy = input('enter the known reaction Cy')
disp('The value of M_B is')
M_B =((W*L1)/2 - Ay)*L1
disp('The value of M_C is')
M_C = (W*L1+2*M_B/L1 - By)*L1
disp('The value of By is')
By= W*L1+2*M_B/L1-M_C/L1
disp('The value of Dy is')
Dy= 0.5*W*L1-M_C/4
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V)
hold on
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-8).*(x>8);
plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
elseif M == 3
Ay = input('enter the known reaction Ay')
Dy = input('enter the known reaction Dy')
disp('The value of M_B is')
M_B =((W*L1)/2 - Ay)*L1
disp('The value of M_C is')
M_C = (W*L1+2*M_B/L1 - By)*L1
disp('The value of By is')
By= W*L1+2*M_B/L1-M_C/L1

49
disp('The value of Cy is')
Cy= W*L1+(2*M_C-M_B)/L1
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V)
hold on
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-8).*(x>8);
plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
elseif M == 4
By = input('enter the known reaction By')
Cy = input('enter the known reaction Cy')
disp('The value of M_C is')
M_C = (2*Cy+By-3*W*L1)*(L1/3)
disp('The value of Dy is')
Dy = 0.5*W*L1-M_C/L1
disp('The value of M_B is')
M_B = (W*L1+2*M_C/L1-Cy)*L1
disp('The value of Ay is')
Ay= 0.5*W*L1-M_B/L1
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V)
hold on
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-8).*(x>8);
plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment')

50
grid on
elseif M == 5
Ay = input('enter the known reaction Ay')
M_B = input('enter the known reaction M_B')
disp('The solution is not possible for this combination')
elseif M == 6
Ay = input('enter the known reaction Ay')
M_C = input('enter the known reaction M_C')
disp('The value of M_B is')
M_B =((W*L1)/2 - Ay)*L1
disp('The value of By is')
By= W*L1+2*M_B/L1-M_C/L1
disp('The value of Cy is')
Cy= W*L1+(2*M_C-M_B)/L1
disp('The value of Dy is')
Dy = 0.5*W*L1-M_C/L1
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V)
hold on
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-8).*(x>8);
plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
elseif M == 7
By = input('enter the known reaction By')
M_B = input('enter the known reaction M_B')
disp('The value of M_C is')
M_C = (W*L1+2*M_B/L1 - By)*L1

51
disp('The value of Ay is')
Ay= 0.5*W*L1-M_B/L1
disp('The value of Cy is')
Cy= W*L1+(2*M_C-M_B)/L1
disp('The value of Dy is')
Dy = 0.5*W*L1-M_C/L1
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V)
hold on
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-8).*(x>8);
plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
elseif M == 8
By = input('enter the known reaction By')
M_C = input('enter the known reaction M_C')
disp('The value of M_B is')
M_B =(By+M_C/L1-W*L1)*L1/2
disp('The value of Ay is')
Ay= 0.5*W*L1-M_B/L1
disp('The value of Cy is')
Cy= W*L1+(2*M_C-M_B)/L1
disp('The value of Dy is')
Dy = 0.5*W*L1-M_C/L1
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V)
hold on

52
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-8).*(x>8);
plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
elseif M == 9
M_B = input('enter the known reaction M_B')
M_C = input('enter the known reaction M_C')
disp('The value of Ay is')
Ay= 0.5*W*L1-M_B/L1
disp('The value of By is')
By= W*L1+2*M_B/L1-M_C/L1
disp('The value of Cy is')
Cy= W*L1+(2*M_C-M_B)/L1
disp('The value of Dy is')
Dy = 0.5*W*L1-M_C/L1
x = linspace(0,12);
V = Ay*(x>0)-W*(x-0).*(x>0)+By*(x>4)+Cy*(x>8)-Dy*(x>12);
plot(x,V)
hold on
M = Ay*x-0.5*W*(x-0).^2.*(x>0)+By*(x-4).*(x>4)+Cy*(x-8).*(x>8);
plot(x,M)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
end

The Results:
Result for case (i)
>> threemomentequation

53
enter the total length of span of the beam in meters12

L = 12

enter the length of each span4

L1 =

enter the value of uniformly distributed load throughout in kN/m10

W=

10

enter the no for known reactions in the following way like Ay&By then 11

M=

enter the known reaction Ay16

Ay =

16

enter the known reaction By44

54
By =

44

The value of M_B is

M_B =

16

The value of M_C is

M_C =

16

The value of Dy is

Dy =

16

The value of Cy is

Cy =

44

>>

55
Result for case (iv)
>> threemomentequation
enter the total length of span of the beam in meters12

L=

12

enter the length of each span4

L1 =

enter the value of uniformly distributed load throughout in kN/m10

56
W=

10

enter the no for known reactions in the following way like Ay&By then 14

M=

enter the known reaction By44

By =

44

enter the known reaction Cy44

Cy =

44

The value of M_C is

M_C =

16

The value of Dy is

57
Dy =

16

The value of M_B is

M_B =

16

The value of Ay is

Ay =

16

>>

58
Result for case (vi)
>> threemomentequation
enter the total length of span of the beam in meters12

L=

12

enter the length of each span4

L1 =

59
enter the value of uniformly distributed load throughout in kN/m10

W=

10

enter the no for known reactions in the following way like Ay&By then 16

M=

enter the known reaction Ay16

Ay =

16

enter the known reaction M_C16

M_C =

16

The value of M_B is

M_B =

16

60
The value of By is

By =

44

The value of Cy is

Cy =

44

The value of Dy is

Dy =

16

>>

61
Result for case (ix)
>> threemomentequation
enter the total length of span of the beam in meters12

L=

12

enter the length of each span4

L1 =

enter the value of uniformly distributed load throughout in kN/m10

62
W=

10

enter the no for known reactions in the following way like Ay&By then 19

M=

enter the known reaction M_B16

M_B =

16

enter the known reaction M_C16

M_C =

16

The value of Ay is

Ay =

16

The value of By is

63
By =

44

The value of Cy is

Cy =

44

The value of Dy is

Dy =

16

>>

64
65
3.3 Macaulay’s method using MATLAB
Macaulay method is very well suited for computer use as it involves singularity function that
can be very easily be programmed using various computer soft wares available in the market.
Following is an example where the solution of a simply supported beam is obtained for
various zones using Macaulay method in MATLAB.

Example 3.2.5
Draw SFD and BMD of the following simply supported beam with loading as shown below.

4kN 8kN 6kN


j 300 600 450

2m 2m 2m 2m

Firstly, we determine the reactions at the supports by hand calculation. We then use those
reactions in the MATLAB program to plot the shear force diagram and bending moment
diagram and the codeused in matlab and the figures generated are shown below.

>> R1 =

6.02R1 =

6.0200

>> R2 =

7.15R2 =

7.1500

>> x = linspace(0,8);
>> V = R1*(x>0)-2*(x>2)-6.928*(x>4)-4.243*(x>6)-7.15*(x>8)
>> plot(x,V)

66
The shear force diagram generated is as follows

>> M = R1*x-2*(x-2).*(x>2)-6.928*(x-4).*(x>4)-4.243*(x-6).*(x>6);
>> plot(x,M)

67
%% Shown below is the MATLAB code for finding out the shear force and bending
moment atvarious x for the problem given in Example 3.2.1

x1 = input ('enter the value of


x')if 0 < x1 & x1 <= 2
V1 = 0;
M1 = 10;
disp('The value of bending moment
is: ')disp(M1);
disp('The value of shear force
is: ')disp(V1);
elseif 2 <x1 & x1 <=
4V2 = -7.071;
M2 = 30-10*x1;
disp('The value of bending moment
is: ')disp(M2);
disp('The value of shear force
is: ')disp(V2);
elseif 4<x1 &
x1<6V3 = 0;
M3 = -10;
disp('The value of bending moment
is: ')disp(M3);
disp('The value of shear force
is: ')disp(V3);
elseif x1==6
y1 = input('enter the value of
y')if 0<y1 & y1<1
V4 = 10;
M4 = -10*y1;
68
disp('The value of bending moment
is: ')disp(M4)
disp('The value of shear force
is: ')disp(V4)
en
dend

69
3.4 Program for singularity function

%% complete macaulay function


disp('Note: This sign convention is to be used throughout the span')

disp('+ve for clockwise moment and +ve for loads acting upward')

n = input('enter the total no of nodes \n')


for i=1:n-1
fprintf('Please enter the length of span %d\n',i);
length(i) = input('');
L = sum(length)
end

fprintf('The total length of beam is %d\n', L);

disp('enter the acting reactions at the nodes')

for i=1:n
fprintf('Please enter the horizontal support reactions for node number %d\n',i);
X(i) = input('');
end
for i=1:n
fprintf('Please enter the vertical support reactions for node number %d\n',i);
Y(i) = input('');
end
for i=1:n
fprintf('Please enter the moment reactions at support for node number %d\n',i);
M(i) = input('');
end
disp('enter the loads acting on the span')
for i=1:3
fprintf('Please enter the magnitudes of the concentrated moments %d\n',i);
CM(i) = input('');
end
for i=1:3
fprintf('Please enter the positions of the concentrated moments %d\n',i);
Mx(i) = input('');
end
%
for i=1:3
fprintf('Please enter the magnitudes of the concentrated loads %d\n',i);
C(i) = input('');
end
for i=1:3
fprintf('Please enter the position of the concentrated load from the extreme left node %d\n',i);
p(i) = input('');
end

fprintf('Please enter the magnitudes of the udl acting on the span %d\n');
U = input('');

70
fprintf('Please enter the distance of the starting point of the udl acting on the span %d\n');
U1 = input('');

fprintf('Please enter the distance of the ending point of the udl acting on the span %d\n');
U2 = input('');

syms x
syms y
fprintf('Here the variable y has been particularly assigned to numerical value of 0\n')
disp('The expression for P(x)\n')
if n == 2
%p = Y(1)*(x-0)^-1 + M(1)*(x-0)^-2 + CM(1)*(x-Mx(1))^-2 + CM(2)*(x- Mx(2))^-2 + CM(3)*(x-
Mx(3))^-2 + C(1)*(x-p(1))^-1 + C(2)*(x-p(2))^-1 + C(3)*(x-p(3))^-1 + U(1)*(x-U1(1))^0 - U(1)*(x-U2(1))^0
+ U(2)*(x-U1(2))^0 - U(2)*(x-U2(2))^0 + U(3)*(x-U1(3))^0 - U(3)*(x-U2(3))^0 + V1(1)*(x-V11(1))^0 +
(V2(1)-V1(1))/(V22(1)-V11(1))*(x-V11(1))^1 - V1(1)*(x-V22(1))^0 - (V2(1)-V1(1))*(x-V22(1))^0 -(V2(1)-
V1(1))/(V22(1)-V11(1))*(x-V22(1))^1 + M(2)*(x-L)^-2 + Y(2)*(x-L)^-1
p = Y(1)*(x-0)^-1 + M(1)*(x-0)^-2 + CM(1)*(x-Mx(1))^-2 + CM(2)*(x- Mx(2))^-2 + CM(3)*(x-Mx(3))^-2
+ C(1)*(x-p(1))^-1 + C(2)*(x-p(2))^-1 + C(3)*(x-p(3))^-1 + U*(x-U1)^y - U(1)*(x-U2)^y + M(2)*(x-L)^-2 +
Y(2)*(x-L)^-1

elseif n == 3
L1 = input('enter the length of the span 1')
%L2 = input('enter the length of the span 2')
p = Y(1)*(x-0)^-1 + M(1)*(x-0)^-2 + CM(1)*(x-Mx(1))^-2 + CM(2)*(x- Mx(2))^-2 + CM(3)*(x-Mx(3))^-
2 + C(1)*(x-p(1))^-1 + C(2)*(x-p(2))^-1 + C(3)*(x-p(3))^-1 + U*(x-U1)^y - U*(x-U2)^y + Y(2)*(x-L1)^-1
+ M(2)*(x-L1)^-2 + M(3)*(x-L)^-2 + Y(3)*(x-L)^-1

elseif n == 4
L1 = input('enter the length of the span 1')
L2 = input('enter the length of the span 2')
p = Y(1)*(x-0)^-1 + M(1)*(x-0)^-2 + CM(1)*(x-Mx(1))^-2 + CM(2)*(x- Mx(2))^-2 + CM(3)*(x-Mx(3))^-
2 + C(1)*(x-p(1))^-1 + C(2)*(x-p(2))^-1 + C(3)*(x-p(3))^-1 + U*(x-U1)^y - U*(x-U2)^y + Y(2)*(x-L1)^-1 +
M(2)*(x-L1)^-2 + M(3)*(x-(L1+ L2))^-2 + Y(3)*(x-(L1+ L2))^-1 + M(4)*(x-L)^-2 + Y(4)*(x-L)^-1

elseif n ==5
L1 = input('enter the length of the span 1')
L2 = input('enter the length of the span 2')
L3 = input('enter the length of the span 3')
p = Y(1)*(x-0)^-1 + M(1)*(x-0)^-2 + CM(1)*(x-Mx(1))^-2 + CM(2)*(x- Mx(2))^-2 + CM(3)*(x-
Mx(3))^-2 + C(1)*(x-p(1))^-1 + C(2)*(x-p(2))^-1 + C(3)*(x-p(3))^-1 + U*(x-U1)^y - U*(x-U2)^y + Y(2)*(x-
L1)^-1 + M(2)*(x-L1)^-2 + M(3)*(x-(L1+ L2))^-2 + Y(3)*(x-(L1+ L2))^-1 + M(4)*(x-(L1+ L2+L3))^-2 +
Y(4)*(x-(L1+ L2+L3))^-1 + M(5)*(x-L)^-2 + Y(5)*(x-L)^-1

end

p1 = input('enter the first term of p(x)')


n1 = input('enter the power of the macaulay bracket')
c1 = input('enter the distance at which the load acts')
d1 = input('enter the numerical multiplier i.e 2 if 2*(x-1)^-1\n')
if n1 == 0
71
v1 = d1*(x-c1)^(n1+1)
M1 = int(V1)
elseif n1>0
v1 = int(p1)%+ %(-c1)^(n1+1) /n1+1
M1 = int(v1)
elseif n1 == -1
v1 = d1*(x-c1)^(n1+1)
M1 = d1*(x-c1)^(n1+2)
elseif n1 == -2
v1 = (n1+1)*(int(p1))
M1 = d1*(x-c1)^(n1+2)
elseif n1< -2
v1 = (n1+1)*(int(p1))%+ (-c1)^(n1+1) /n1+1)
M1 = (n1+2)*int(v1)
end

p2 = input('enter the second term of p(x)')


n2 = input('enter the power of the macaulay bracket')
c2 = input('enter the distance at which the load acts')
d2 = input('enter the numerical multiplier i.e 2 if 2*(x-1)^-1\n')
if n2 == 0
v2 = d2*(x-c1)^(n1+1)
M2 = d2*(x-c1)^(n1+2)
elseif n2>0
v2 = int(p2)%+ %(-c1)^(n1+1) /n1+1
M2 = int(v2)
elseif n2 == -1
v2 = d2*(x-c2)^(n2+1)
M2 = d2*(x-c2)^(n2+2)
elseif n2 == -2
v2 = (n2+1)*(int(p2))
M2 = d2*(x-c2)^(n2+2)
elseif n2< -2
v2 = (n2+1)*(int(p2))%+ (-c1)^(n1+1) /n1+1)
M2 = (n2+2)*int(v2)
end

p3 = input('enter the third term of p(x)')


n3 = input('enter the power of the macaulay bracket')
c3 = input('enter the distance at which the load acts')
d3 = input('enter the numerical multiplier i.e 2 if 2*(x-1)^-1\n')
if n3 == 0
v3 = d3*(x-c1)^(n1+1)
M3 = int(V3)
elseif n3>0
v3 = int(p3)%+ %(-c1)^(n1+1) /n1+1
M3 = int(v3)
elseif n3 == -1
v3 = d3*(x-c3)^(n3+1)
M3 = d3*(x-c3)^(n3+2)
elseif n3 == -2
v3 = (n3+1)*(int(p3))
M3 = d3*(x-c3)^(n3+2)
elseif n3< -2
72
v3 = (n3+1)*(int(p3))%+ (-c1)^(n1+1) /n1+1)
M3 = (n3+2)*int(v3)
end

i = input('enter 1 if there exists more terms or enter 2 if there exists no more terms\n')
if i==1
p4 = input('enter the fourth term of p(x)\n')
n4 = input('enter the power of the macaulay bracket')
c4 = input('enter the distance at which the load acts')
d4 = input('enter the numerical multiplier i.e 2 if 2*(x-1)^-1\n')
if n4 == 0
v4 = d4*(x-c4)^(n4+1)
M4 = (d4/(n4+2))*(x-c4)^(n4+2)
elseif n4>0
v4 = int(p4)%+ %(-c1)^(n1+1) /n1+1
M4 = int(v4)
elseif n4 == -1
v4 = d4*(x-c4)^(n4+1)
M4 = d4*(x-c4)^(n4+2)
elseif n4 == -2
v4 = (n4+1)*(int(p4))
M4 = d4*(x-c4)^(n4+2)
elseif n4< -2
v4 = (n4+1)*(int(p4))%+ (-c1)^(n1+1) /n1+1)
M4 = (n4+2)*int(v4)
end

elseif i == 2

disp('input the equation of v in the following form i.e for V = Ay-Wx+By it is V = Ay*(x>0)-W*(x-
0).*(x>0)+By*(x>4)')
disp('input the equation of M in the following form i.e for M = Ay*x-0.5*w*x^2 it is M = Ay*x-0.5*W*(x-
0).^2.*(x>0)')
x = linspace(0,L);
v11 = input('enter the equation of V in the above format')
plot(x,v11)
hold on
M11 = input('enter the equation of M in the above format')
plot(x,M11)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
return
end
i1 = input('enter 1 if there exists more terms or enter 2 if there exists no more terms\n')
if i1 == 1
p5 = input('enter the fifth term of p(x)\n')
n5 = input('enter the power of the macaulay bracket')
c5 = input('enter the distance at which the load acts')
d5 = input('enter the numerical multiplier i.e 2 if 2*(x-1)^-1\n')
if n5 == 0
v5 = d5*(x-c5)^(n5+1)
M5 = int(v5)
elseif n5>0
73
v5 = int(p5)%+ %(-c1)^(n1+1) /n1+1
M5 = int(v5)
elseif n5 == -1
v5 = d5*(x-c5)^(n5+1)
M5 = d5*(x-c5)^(n5+2)
elseif n5 == -2
v5 = (n5+1)*(int(p5))
M5 = (x-c5)^(n5+2)
elseif n5< -2
v5 = (n5+1)*(int(p5))%+ (-c1)^(n1+1) /n1+1)
M5 = (n5+2)*int(v5)
end
elseif i1 == 2

disp('input the equation of v in the following form i.e for V = Ay-Wx+By it is V = Ay*(x>0)-W*(x-
0).*(x>0)+By*(x>4)')
x = linspace(0,L);
v12 = input('enter the equation of V in the above format')
%v13 = input('enter the equation of V in the above format')
%x = 0:0.1:L;
plot(x,v12)
hold on
M12 = input('enter the equation of M in the above format')
plot(x,M12)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on
return
end

disp('input the equation of v in the following form i.e for V = Ay-Wx+By it is V = Ay*(x>0)-W*(x-
0).*(x>0)+By*(x>4)')
disp('similarly input the value of M in the above form')
x = linspace(0,L);
v13 = input('enter the equation of V in the above format')
%x = 0:0.1:L;
plot(x,v13)
hold on
M13 = input('enter the equation of M in the above format')
plot(x,M13)
title('SFD and BMD')
legend('Shear Force','Bending Moment')
grid on

74
Example: Draw the SFD and BMD for a simply supported beam with a point load of 10 kN at 2m distance
from the left support and a udl of intensity 5 Kn/m throughout the span of 6 m length.

>> macaulay32
Note: This sign convention is to be used throughout the span
+ve for clockwise moment and +ve for loads acting upward
enter the total no of nodes
2

n=

Please enter the length of span 1


6

L=

The total length of beam is 6


enter the acting reactions at the nodes
Please enter the horizontal support reactions for node number 1
0
Please enter the horizontal support reactions for node number 2
0
Please enter the vertical support reactions for node number 1
12.67
Please enter the vertical support reactions for node number 2
9.33
Please enter the moment reactions at support for node number 1
0
Please enter the moment reactions at support for node number 2
0
enter the loads acting on the span
Please enter the magnitudes of the concentrated moments 1
0
Please enter the magnitudes of the concentrated moments 2
0
Please enter the magnitudes of the concentrated moments 3
0
Please enter the positions of the concentrated moments 1
0
Please enter the positions of the concentrated moments 2
0
Please enter the positions of the concentrated moments 3
0
Please enter the magnitudes of the concentrated loads 1
-10
Please enter the magnitudes of the concentrated loads 2
0
Please enter the magnitudes of the concentrated loads 3
0
Please enter the position of the concentrated load from the extreme left node 1
75
2
Please enter the position of the concentrated load from the extreme left node 2
0
Please enter the position of the concentrated load from the extreme left node 3
0
Please enter the magnitudes of the udl acting on the span -2
Please enter the distance of the starting point of the udl acting on the span 0
Please enter the distance of the ending point of the udl acting on the span 6
Here the variable y has been particularly assigned to numerical value of 0
The expression for P(x)\n

p=

933/(100*(x - 6)) - 10/(x - 2) - 2*x^y + 2*(x - 6)^y + 1267/(100*x)

enter the first term of p(x)12.67*(x-0)^-1

p1 =

1267/(100*x)

enter the power of the macaulay bracket-1

n1 =

-1

enter the distance at which the load acts0

c1 =

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


12.67

d1 =

12.6700

v1 =

1267/100

M1 =

(1267*x)/100

enter the second term of p(x)-2*(x-0)^0

p2 =

76
-2

enter the power of the macaulay bracket0

n2 =

enter the distance at which the load acts0

c2 =

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


-2

d2 =

-2

v2 =

-2

M2 =

-2*(x-1)

enter the third term of p(x)-10*(x-2)^-1

p3 =

-10/(x - 2)

enter the power of the macaulay bracket-1

n3 =

-1

enter the distance at which the load acts2

c3 =

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


-10

d3 =

77
-10

v3 =

-10

M3 =

20 - 10*x

enter 1 if there exists more terms or enter 2 if there exists no more terms
1

i=

enter the fourth term of p(x)


9.33*(x-6)^-1

p4 =

933/(100*(x - 6))

enter the power of the macaulay bracket-1

n4 =

-1

enter the distance at which the load acts6

c4 =

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


9.33

d4 =

9.3300

v4 =

933/100

M4 =

(933*x)/100 - 2799/50
78
enter 1 if there exists more terms or enter 2 if there exists no more terms
2

i1 =

input the equation of v in the following form i.e for V = Ay-Wx+By it is V = Ay*(x>0)-W*(x-
0).*(x>0)+By*(x>4)
enter the equation of V in the above format12.67*(x>0)-2*(x-0).*(x>0)+-10*(x>2)+9.33*(x>6)

v12 =

Columns 1 through 11

0 12.5488 12.4276 12.3064 12.1852 12.0639 11.9427 11.8215 11.7003 11.5791 11.4579

Columns 12 through 22

11.3367 11.2155 11.0942 10.9730 10.8518 10.7306 10.6094 10.4882 10.3670 10.2458 10.1245

Columns 23 through 33

10.0033 9.8821 9.7609 9.6397 9.5185 9.3973 9.2761 9.1548 9.0336 8.9124 8.7912

Columns 34 through 44

8.6700 -1.4512 -1.5724 -1.6936 -1.8148 -1.9361 -2.0573 -2.1785 -2.2997 -2.4209 -2.5421

Columns 45 through 55

-2.6633 -2.7845 -2.9058 -3.0270 -3.1482 -3.2694 -3.3906 -3.5118 -3.6330 -3.7542 -3.8755

Columns 56 through 66

-3.9967 -4.1179 -4.2391 -4.3603 -4.4815 -4.6027 -4.7239 -4.8452 -4.9664 -5.0876 -5.2088

Columns 67 through 77

-5.3300 -5.4512 -5.5724 -5.6936 -5.8148 -5.9361 -6.0573 -6.1785 -6.2997 -6.4209 -6.5421

Columns 78 through 88

-6.6633 -6.7845 -6.9058 -7.0270 -7.1482 -7.2694 -7.3906 -7.5118 -7.6330 -7.7542 -7.8755

Columns 89 through 99

-7.9967 -8.1179 -8.2391 -8.3603 -8.4815 -8.6027 -8.7239 -8.8452 -8.9664 -9.0876 -9.2088

Column 100

-9.3300

79
enter the equation of M in the above format12.67*x-0.5*2*(x-0).^2.*(x>0)-10*(x-2).*(x>2)

M12 =

Columns 1 through 11

0 0.7642 1.5211 2.2706 3.0127 3.7476 4.4750 5.1952 5.9080 6.6134 7.3115

Columns 12 through 22

8.0022 8.6856 9.3617 10.0304 10.6917 11.3457 11.9924 12.6317 13.2637 13.8883 14.5056

Columns 23 through 33

15.1156 15.7181 16.3134 16.9013 17.4818 18.0550 18.6209 19.1794 19.7306 20.2744 20.8109

Columns 34 through 44

21.3400 21.2557 21.1641 21.0651 20.9588 20.8451 20.7241 20.5958 20.4601 20.3170 20.1666

Columns 45 through 55

20.0089 19.8438 19.6714 19.4916 19.3045 19.1100 18.9082 18.6990 18.4825 18.2586 18.0274

Columns 56 through 66

17.7889 17.5430 17.2898 17.0292 16.7612 16.4860 16.2033 15.9134 15.6160 15.3114 14.9994

Columns 67 through 77

14.6800 14.3533 14.0192 13.6779 13.3291 12.9730 12.6096 12.2388 11.8607 11.4752 11.0824

Columns 78 through 88

10.6822 10.2747 9.8599 9.4376 9.0081 8.5712 8.1270 7.6754 7.2164 6.7502 6.2765

Columns 89 through 99

5.7956 5.3072 4.8116 4.3086 3.7982 3.2805 2.7554 2.2230 1.6833 1.1362 0.5818

Column 100

0.0200

>>

80
120
40

A C
B

1.5 m 1.5 m 3.0 m

Example: Draw the shearing force and bending moment diagrm with the matlab program

>> macaulay32
Note: This sign convention is to be used throughout the span
+ve for clockwise moment and +ve for loads acting upward
enter the total no of nodes
3

n=

3
81
Please enter the length of span 1
3

L=

Please enter the length of span 2


3

L=

The total length of beam is 6


enter the acting reactions at the nodes
Please enter the horizontal support reactions for node number 1
0

82
Please enter the horizontal support reactions for node number 2
0
Please enter the horizontal support reactions for node number 3
0
Please enter the vertical support reactions for node number 1
41.25
Please enter the vertical support reactions for node number 2
157.5
Please enter the vertical support reactions for node number 3
41.25
Please enter the moment reactions at support for node number 1
0
Please enter the moment reactions at support for node number 2
-56.25
Please enter the moment reactions at support for node number 3
0
enter the loads acting on the span
Please enter the magnitudes of the concentrated moments 1
0
Please enter the magnitudes of the concentrated moments 2
0
Please enter the magnitudes of the concentrated moments 3
0
Please enter the positions of the concentrated moments 1
0
Please enter the positions of the concentrated moments 2
0
Please enter the positions of the concentrated moments 3
0
Please enter the magnitudes of the concentrated loads 1
-120
Please enter the magnitudes of the concentrated loads 2
0
Please enter the magnitudes of the concentrated loads 3
0
Please enter the position of the concentrated load from the extreme left node 1
1.5
Please enter the position of the concentrated load from the extreme left node 2
0
Please enter the position of the concentrated load from the extreme left node 3
0
Please enter the magnitudes of the udl acting on the span -40
Please enter the distance of the starting point of the udl acting on the span 3
Please enter the distance of the ending point of the udl acting on the span 6
Here the variable y has been particularly assigned to numerical value of 0
The expression for P(x)\n
enter the length of the span 13
83
L1 =

p=

315/(2*(x - 3)) - 225/(4*(x - 3)^2) - 120/(x - 3/2) + 165/(4*(x - 6)) - 40*(x - 3)^y + 40*(x - 6)^y +
165/(4*x)

enter the first term of p(x)41.25*(x-0)^-1

p1 =

165/(4*x)

enter the power of the macaulay bracket-1

n1 =

-1

enter the distance at which the load acts0

c1 =

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


41.25

d1 =

41.2500

v1 =

165/4

M1 =

(165*x)/4

enter the second term of p(x)-120*(x-1.5)^-1


84
p2 =

-120/(x - 3/2)

enter the power of the macaulay bracket-1

n2 =

-1

enter the distance at which the load acts1.5

c2 =

1.5000

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


-120

d2 =

-120

v2 =

-120

M2 =

180 - 120*x

enter the third term of p(x)157.5*(x-3)^-1

p3 =

315/(2*(x - 3))

enter the power of the macaulay bracket-1

n3 =

-1

enter the distance at which the load acts3


85
c3 =

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


157.5

d3 =

157.5000

v3 =

315/2

M3 =

(315*x)/2 - 945/2

enter 1 if there exists more terms or enter 2 if there exists no more terms
1

i =

enter the fourth term of p(x)


-40*(x-3)^0

p4 =

-40

enter the power of the macaulay bracket0

n4 =

enter the distance at which the load acts3

c4 =

3
86
enter the numerical multiplier i.e 2 if 2*(x-1)^-1
-40

d4 =

-40

v4 =

120 - 40*x

M4 =

-20*(x - 3)^2

enter 1 if there exists more terms or enter 2 if there exists no more terms
1

i1 =

enter the fifth term of p(x)


41.25*(x-6)^-1

p5 =

165/(4*(x - 6))

enter the power of the macaulay bracket-1

n5 =

-1

enter the distance at which the load acts6

c5 =

enter the numerical multiplier i.e 2 if 2*(x-1)^-1


41.25

87
d5 =

41.2500

v5 =

165/4

M5 =

(165*x)/4 - 495/2

input the equation of v in the following form i.e for V = Ay-Wx+By it is V = Ay*(x>0)-W*(x-
0).*(x>0)+By*(x>4)
similarly input the value of M in the above form
enter the equation of V in the above format41.25*(x>0)-120*(x>1.5)+157.5*(x>3)-40*(x-
3).*(x>3)+41.25*(x>6)

v13 =

Columns 1 through 11

0 41.2500 41.2500 41.2500 41.2500 41.2500 41.2500 41.2500 41.2500


41.2500 41.2500

Columns 12 through 22

41.2500 41.2500 41.2500 41.2500 41.2500 41.2500 41.2500 41.2500 41.2500


41.2500 41.2500

Columns 23 through 33

41.2500 41.2500 41.2500 -78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -


78.7500 -78.7500

Columns 34 through 44

-78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -


78.7500 -78.7500

Columns 45 through 55

-78.7500 -78.7500 -78.7500 -78.7500 -78.7500 -78.7500 77.5379 75.1136 72.6894


70.2652 67.8409

88
Columns 56 through 66

65.4167 62.9924 60.5682 58.1439 55.7197 53.2955 50.8712 48.4470 46.0227


43.5985 41.1742

Columns 67 through 77

38.7500 36.3258 33.9015 31.4773 29.0530 26.6288 24.2045 21.7803 19.3561


16.9318 14.5076

Columns 78 through 88

12.0833 9.6591 7.2348 4.8106 2.3864 -0.0379 -2.4621 -4.8864 -7.3106 -9.7348
-12.1591

Columns 89 through 99

-14.5833 -17.0076 -19.4318 -21.8561 -24.2803 -26.7045 -29.1288 -31.5530 -33.9773 -


36.4015 -38.8258

Column 100

-41.2500

89
Solution

Shear force diagram

Bending Moment is out of range of this program, This program


can be developed further for calculating BMD of such type of
question.

90
Chapter 4
CONCLUSION

4.1 conclusion
The project highlights a very important topic i.e. shear force and bending moment acting on a beam and
it’s subsequent determination. SFD and BMD are the distribution of shear force and bending moment
throughout the length of a beam. Shear force and Bending moment diagram for various type of beam are
drawn by using software like MATLAB, Staad Pro and many other.
We know the load which would be subjected to the beam and with the help of that load we calculate
the pinpoint i.e, the region where shear force and bending moment is maximum, so that we design
an efficient RCC structure. Moreover, the portion of the beam where the minimum shear force and
bending moment are acting can also be found out so that design is economic and at the same time
efficient also.

The most interesting thing about the SFD and BMD is that people may not know it technically but
everyone is using it in their life for example when they build their home. Using techniques like
Macaulay method described above, one can determine the shear force and bending moment acting
on a beam of different zones with varying load very conveniently in a single line without having to
do much tedious work unlike the conventional methods like Moment area method or conjugate beam
method. In chapter 3, drawing of SFD and BMD has also been programmed using MATLAB. The
application of Macaulay method in determination of slope and deflection has also been explained
through some numerical examples in chapter 2.

4.2 Scope

This work is a contribution in the field of strength of materials particularly in the


determination of shear force and bending moment specially by taking help of shear force(SF)
and bending moment(BM) diagram. This work primarily focuses in the implementation of
Macaulay’s discontinuity function in the determination of SF and BM which can be further
extended to the determination of rotation and deflection using Double integration method.
Double integration makes use of the well known equation Ε𝐼𝑦′′ = 𝑀(𝑥). The matlab program
has been developed to accomplish certain goals aforementioned but due to it being under
development it can’t be used for all the cases but it can still give good results for a single span
beam and it can be employed to draw SF diagrams of a beam with as many as 5 terms in it’s
P(x). The program can be further extended to obtain the deflection curve using MATLAB.

91
REFERENCES

1. Mechanics of materials (Fifth edition)

-by Ferdinand P. Beer/ E. Russel Johnston, jr/ John T. Dewolf/ David F. Mazurek.

2. Strength of materials, Tata McGraw hills publication by William Nash

3. Strength of materials by Dr R.K Bansal

3. NPTEL –online video lectures and pdfs

4. Mathswork website

5. Udemy online learning course

6. Mechanice of material by Roy R Criag, Jr

92

You might also like