0% found this document useful (0 votes)
20 views5 pages

File 52 MARTEC174

An object oriented approach to beam analysis

Uploaded by

Wicked Guru
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)
20 views5 pages

File 52 MARTEC174

An object oriented approach to beam analysis

Uploaded by

Wicked Guru
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/ 5

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/368939289

AN OBJECT ORIENTED APPROACH TO BEAM ANALYSIS

Conference Paper · December 2010

CITATIONS READS
2 25

3 authors, including:

Shahidul Islam
Bangladesh University of Engineering and Technology
33 PUBLICATIONS 74 CITATIONS

SEE PROFILE

All content following this page was uploaded by Shahidul Islam on 11 April 2023.

The user has requested enhancement of the downloaded file.


Proceedings of MARTEC 2010
The International Conference on Marine Technology
11-12 December 2010, BUET, Dhaka, Bangladesh

AN OBJECT ORIENTED APPROACH TO BEAM ANALYSIS

M. S. Islam, G. M. Khalil and N. A. Nahian


Department of Naval Architecture and Marine Engineering,
Bangladesh University of Engineering and Technology, Dhaka-1000
E-mail: [email protected], [email protected]

ABSTRACT
An Object-Oriented Programming (OOP) procedure is presented for solving structural mechanics ‘beam’
problems by using the deflection, bending moment and shear force equations. The program is developed for a
single span and for cantilever and simply supported beam. A beam is divided into one hundred segments, i.e.,
one hundred and one nodes and deflection, bending moment and shear force are calculated on each node for
applied loads and moments.

Key words: Beam analysis, C++, Object oriented programming, shear force, bending moment, deflection.

1. INTRODUCTION derivations of these equations (deflection, shear force


‘Beam Analysis’ is a very important and and bending moment) are available in Pytel and
fundamental topic of the subject ‘Mechanics of Singer (2005). Downward load is considered as
Materials’ studied by engineering students. The negative and upward load as positive. Clockwise
behaviors of a beam are represented by bending moment is considered negative while the anti-
moment, shear force and deflection curves. A beam clockwise moment is taken as positive. The
can have supports of fixed, hinged, simple or of fundamental properties of a beam are E (modulus of
combined type and is classified accordingly. The topic elasticity), I (moment of inertia), L (length of the
‘Beam Analysis’ informs us how a beam behaves beam), W (point load) and w (uniformly distributed
under different loading conditions and supports. The load per unit length).
main objective of this research is the development of
a reliable and user friendly program in the field of 2.1 Cantilever beam
beam analysis. By using this program, an engineer or
Loading condition 1: Point load at any point on the
an engineering student alike can easily generate his
beam (Fig.. 1)
own answers to basic questions concerning the
Where a is the position of load from the fixed end,
behavior of beams. This program will help them
b is the position of load from the free end and x is the
understand the subject better and verify/correct their
variable distance from the fixed end.
approach to the problems. The program is developed
in C++ language. The method uses object oriented When the variable distance x is less than or equal to
approach and superposition technique. The program a, the deflection equation is
takes the value and direction of loads and moments
applied to the particular type of beam as an input. The Wx 2 (3a − x )
y= (1)
total length of the beam is divided into one hundred 6 EI
parts by one hundred and one nodes. The program
will give the nodal values of deflection, shear force The bending moment equation is the second
and bending moment using corresponding equations derivative of the deflection equation (1), which is
given in section 2 of this paper. These nodal values d2y
can be used to draw accurate curves. EI = −W (a − x) (2)
dx 2
2. RELEVANT EQUATIONS FOR Finally the shear force equation is the third
DEVELOPING THE PROGRAM derivative of the deflection equation (1) and the first
The deflection equations1 for the different loading derivative of the equation (2),
conditions are listed below. The shear force and
bending equations are the second and third derivatives d3y
EI = −W (3)
respectively of the deflection equations. The dx 3

347
Proceedings of MARTEC 2010

When the variable distance x is greater than a, the


deflection equation is y=
( − −
)
wx 2 6 L2 − 4 Lx + x 2 wa 4 wa 3 (x − p )
(9)
24 EI 8EI 6 EI
Wa (3 x − a )
2
y= (4)
6 EI
w
W q
a b

x L
L
x
Fig. 3: Uniformly distributed load
Fig. 1: Point load at any point on the beam
Loading condition 4: A gradually varying load (Fig. 4)
Loading condition 2: Uniformly distributed load (Fig.
A gradually varying load of highest magnitude w is
2)
subjected to a beam of length L where the variable
A uniformly distributed load of magnitude w per distance is x. The deflection equation is
unit length is applied to a cantilever beam of length L
where the variable distance is x. The deflection y=
(
w 10 L3 − 10 L2 x + 5Lx 2 − x 3 ) (10)
equation is 120 EIL

y=
(
wx 2 6 L2 − 4 Lx + x 2 ) (5)
24 EI
w

x L

Fig. 4: Gradually varying distributed load


x L

Fig. 2: Partially uniformly distributed load


2.2 Simply supported beam:
Loading condition 3: Partially uniformly distributed
Loading condition 1: Point load at any point on the
load (Fig. 3)
beam (Fig. 5)
Where p is the distance of the starting position of
the uniformly distributed from the fixed end (in
Figure 2, p is zero), q is the distance of the uniformly y=
Pbx 2
6 EIL
(
L − x2 − b2 ) for 0< x<b
distributed load from the free end, a is equal to L –q (11)
and b is equal to L-p.
When p = 0 and x ≤ a, the deflection equation is y=
Pb ⎡ L
6 EIL ⎢⎣ b
(
(x − a )3 + L2 − b 2 x − x 3 ⎤⎥ ) for a<x<L

w
y=
(
wx 2 6a 2 − 4ax + x 2 ) (6)
a b
24 EI

When p = 0 and x > a, the deflection equation is


L
x
pa 4
pa (x − a )
3
y= + (7)
8EI 6 EI Fig. 5: Point load at any point on the beam

When q = 0 and x ≤ p , the deflection equation Loading condition 2: Uniformly distributed load over
the length of the beam
y=
( −
) (
wx 2 6 L2 − 4 Lx + x 2 wx 2 6 p 2 − 4 px + x 2 ) (8) y=
wx 3
(
L − 2 Lx 2 + x 3 ) (12)
24 EI 24 EI 24 EI
Loading condition 3: A gradually varying load (Fig. 6)
When x > p and q = 0, the deflection equation

348
Proceedings of MARTEC 2010

y=
wx
360 EIL
(
7 L4 − 10 L2 x 2 + 3x 4 ) (13)
and moments. The class Node has member data
about deflection shear force and bending moment due
to different types of loads and finally total deflection,
total shear force and total moment to sum up all the
individual effects. The class Beam has member
data as typebeam (value 1 means cantilever beam
and 2 means simply supported beam), E (Young’s
modulus of elasticity), I (moment of inertia) and
length. The beam is divided into 100 segments, i.e.,
contains 101 nodes. Then for applied loads (maximum
four point loads) and moments (maximum four),
L appropriate member functions are created to evaluate
x
deflections, shear force and bending moments at each
Figure 6: A gradually varying load node. Then a member function named void
summation_beam()is created to add up the
3. THE PROGRAM individual deflection, shear force and bending
moment components to give total values at each node.
The programming language used is C++, an In short, all the member functions are declared in
extension of C. It was developed by Bjarne Stroustrup corresponding classes in class_beam.h file.
in the early 1980s at Bell Laboratories (Deitel, 2005). These functions are defined in either
The reason for using this language is that it provides canti_beam.cpp or in simply_beam.cpp
capabilities for object-oriented programming. and are called in main_beam.cpp.
As seen in section 2, for each of the two types of
beams (cantilever and simply supported), a number of
loading conditions are present. Procedural program 4. RESULTS AND DISCUSSION
does not work very well for large and complex To investigate the quality of the output generated by
problems. Though it can not be claimed that the the program, a problem (A cantilever beam of 3 m
presented program is such a complicated one, but length is carrying a load of 1 KN (downward) at the
object oriented programs are easier to understand, free end , 2 KN (downward) at a distance 1 m from
correct and modify (Deitel, 2005). It results in the free end,3 KN(downward) at a distance 2 m from
programs that are clearer, more reliable and more the free end and finally a partially uniformly
easily maintained. Instead of viewing a program as a distributed load of 2 N/mm as shown in Figure 7. The
series of steps to be carried out, it views it as a group modulus of elasticity of the beam is 200x103 N/mm2
of objects that have certain properties and can take and moment of inertia is 48.6x106 mm4) is selected.
certain actions. Then the generated output is compared with the
The developed program is a multifile program. The outputs from a professional FEM software and hand
calculation.
source file main_beam.cpp contains the function
main. This function makes an object beam of class
Beam. Its next task is to call a member function of
class Beam named add_node(). Then according to 3 KN 2 KN
2
1 KN
1m 1m
the type of beam and presence of point load,
uniformly distributed load, partially distributed load,
gradually varying load and moment, it calls different
member functions of class Beam like
add_pointload_cantibeam()to find out the Figure 7: Model problem
effect due to the presence of corresponding loads or
moments. Finally to add up all the effects on the Node Bending moment Shear force Deflection
beam, ie, to apply the method of superposition, the in (N-mm) (N) (mm)
function summation_beam()is called. 0 1.50E+07 8000 0
In the header file named class_beam.h, all the 1 1.48E+07 8000 -0.000690741
classes used in the program are created. These classes 2 1.45E+07 8000 -2.75E-03
are class pointload, class unidl --- --- --- ---
(uniformly distributed load), class gvdl 49 4.65E+06 5000 -1.24E+00
(gradually varying distributed load), class 50 4.50E+06 5000 -1.28E+00
partidl (partially distributed load), class 51 4.35E+06 5000 -1.32E+00
moment, class Node and class Beam. --- --- --- ---
The first five classes mentioned above contain 98 6.36E+04 1120 -3.59431
member data about the positions and values of loads 99 30900 1060 -3.64472
100 0 1000 -3.69513
349
Proceedings of MARTEC 2010

Table1. Nodal values for the developed software are shown in Figures 8-10. Demo version of the
professional software BEAM (based on finite element
method), used for comparison (Table 2), gives only
bending moment and shear force data. For that reason
the space for deflection in the table of comparison is
kept empty. It is clear from the table that the
developed program gives accurate results.
Though the problem discussed above has only point
loads but the program is capable of performing the
analysis of beams subjected to a combination of point
loads, uniformly distributed loads, gradually varying
loads, non-uniformly distributed loads and moments.
At present both the cantilever beam and simply
Figure 8: Deflection Curve supported beam can be analyzed. The program is
capable of analyzing beam of only one span.

6. CONCLUSION
An Object-Oriented Program is developed for
solving structural mechanics ‘beam’ problems by
using the deflection, bending moment and shear force
equations. The developed program generates output
without any error. At present no graphics is associated
with the program. The generated results are
transferred to Microsoft Excel to create the curves.
Future goal is to create graphical input and output
Figure 9: Shear Force Curve system.

REFERENCES
1. A. Pytel and F. L. Singer (2005), Strength of
Materials, Fourth Edition, Harper Collins publishers.
2. H. M. Deitel (2005), C++, How to Program, Fifth
Edition, Prentice Hall.

Figure 10: Bending Moment Curve

5. COMPARISON

Developed software output is compared with the


finite element software and hand calculation below.
Finite
Developed element Hand
software software calculation

BM(max) 1.50E+07
1.50E+07 15000127
N-mm
SF(max) 8000
8000 8000.06
N
DEF(max)
-3.69513 ------ -3.69513
mm
Table 2: Table of Comparison
The curves drawn from the results of the program

350

View publication stats

You might also like