Project Programming
Project Programming
FACULTY OF ENGINEERING
CIVIL ENGINEERING DEPARTMENT
KNS1482
ENGINEERING PROGRAMMING
PROJECT
Title PROJECT
Student Name :
Matric No. : Programme:
:
Project/Assignment Title :
Instruction: Please rate your student according to the marking criteria below. Fill in column “MARKS’ with allocation marking criteria (marks in decimal point is not acceptable).
Criteria statement should align with the element of CO, PO, WK and WP where applicable.
Marking Criteria
Criteria Description WK WP/EA Weightage Marks Remark
0 1 2 3 4 5
CO2, PO2
Criteria 1 -Construction of a pseudocode
Demonstrate the with good/clear working
ability to explain the structure/flowchart
overarching
concept/idea of the Not Very
2 Poor Fair Good Excellent 1.25
engineering provided poor
programming
algorithm/process.
Final S(Wxn)/50 x
40:
Comments:
Examined by : Signature :
Date :
Note : Scale for marking criteria is flexible (Example : 0 – 10)
TABLE OF CONTENT
NO CONTENTS PAGE
1. INTRODUCTION 1-2
2, OBJECTIVE 3
3. CALCULATION 4-5
4. PSEUDOCODE 6–9
5. GRAPH 9
6. MATLAB CODE 10 - 13
7. MATLAB ELABORATION 14 - 15
8. SCRIPT OUTPUT 16
9. CONCLUSION 16 - 17
10. REFERENCES 18
INTRODUCTION
The forces in the members and their displacements are found using the theory of
structural analysis (Hibbeler, 2020). A simply supported beam is a fundamental structural
component used in many engineering applications, such as the framework of buildings and
bridges. For the purpose of guaranteeing structural integrity and safety, it is essential to
comprehend its behavior under various loading scenarios.
In order to vary parameters like the dispersed load intensity (q0), beam length (Li), and
beam width (Wi) systematically, the project uses three different loading conditions. The
distributed load intensity (qi) is set at 100 N/m in the beginning conditions given for these
parameters. Given the specified width (Wi= 0.14 m), depth (di=0.10 m), and initial length
(Li= 4.2 m) for the wood beams. MATLAB used in performing the calculation and results
obtained were saved in an Excel file.
The breadth and load intensity were held constant while the beam length was adjusted.
Because longer beams are more flexible, they deflect more, and the maximum deflection
location varies in proportion to the length of the beam. The number of moving forces, which
may be functions of time and spatial coordinate, and their velocities are arbitrary (Pesterev et
al., 2000). The length of the beam had an effect on the bending moment and shear force. The
values at the supports increased with the length of the beam, although the maximum values
still happened around the middle of the section bearing a triangular load.
1
Elements of the beam design in different loading situations. The MATLAB model
effectively captured the distributions of the bending moment, shear force, and deflection. Our
findings highlight the significance of optimizing beam length, width, and load intensity to get
the best performance while maintaining structural integrity. Moreover, experimental
validation of the simulation results would yield useful insights into the behaviour of real-
world structures. To be a good architects you need to be able to communicate well with
structural engineers (Kenneth Marvin Leet et al., 2011).
2
OBJECTIVE
1. Creating a MATLAB programme to calculate and plot the beam's bending moment, shear
force, and deflection diagrams in different type and various situations.
2. Put all of the beam parameters and properties using the MATLAB Command Window.
Condition 1: The constant values for other parameters are maintained but the distributed
load (qo) is modified
Condition 2: The constant values for other parameters are maintained but the beam length
(L) is modified
Condition 3: The constant values for other parameters are maintained but the beam width
(W) is modified
3
CALCULATION
I = (bd^3) / 12
For Group 23 :
b = 0.14 m
d = 0.10 m
I = (0.14×(0.10)^3) / 12
I = (0.14×0.001) / 12
I = 0.00014 / 12
I = 1.1667×10^-5 m^4
x = L /2 = 4.2 / 2 = 2.1m
δ(0) = ((10) / (24 x 70 x 10^9 x 1.1667 x 10^(-5))) x (0 (4.2^3 - 2 x 4.2 x 0^2 + 0^3))
= 0 mm
At ( x = 2.1 ),
δ(2.1) = ((10) / (24 x 70 x 10^9 x 1.1667 x 10^(-5))) x (2.1 (4.2^3 - 2 x 4.2 x 0^2 + 0^3))
= ((10) / (24 x 70 x 10^9 x 1.1667 x 10^(-5))) x (2.1 (46.305))
= 971.805 / 1.964634×10 ^ 6
= 0.495 mm
At ( x = 4.2 m),
δ(0) = ((10) / (24 x 70 x 10^9 x 1.1667 x 10^(-5))) x (4.2(4.2^3 - 2 x 4.2 x 4.2^2 + 4.2^3))
= 0 mm
4
CALCULATE THE SHEAR FORCE AND BENDING MOMENT
At x = 2.1 m
V(2.1) = ((10 x 4.2) / 2) -10 (2.1)
=0N
At x = 4.2 m
V(4.2) = ((10 x 4.2) / 2) -10 (4.2)
= - 21 N
At x = 2.1 m
M(0) = ((10 x 2.1) / 2)(4.2 - 2.1)
= (21 x 2.1) / 2
= 22.05 Nm
At x = 4.2 m
M(0) = ((10 x 4.2) / 2)(4.2 - 4.2)
= 0 Nm
5
PSEUDOCODE
BEGIN
// Material properties
E = 70e9 // Young's modulus for Aluminum in Pa
// Store results
APPEND results WITH ["Condition 1", qo, L, W, max_deflection, max_location]
// Plot data
plot_results(x, y, V, M, colors[current_index], "Condition1", current_index)
APPEND legend_entries WITH ["Condition 1: qo = ", qo, " N/m"]
END FOR
6
qo = qi // Fixed distributed load
W = Wi // Fixed width
I = Ii // Fixed moment of inertia
// Store results
APPEND results WITH ["Condition 2", qo, L, W, max_deflection, max_location]
// Plot data
plot_results(x, y, V, M, colors[current_index], "Condition2", current_index)
APPEND legend_entries WITH ["Condition 2: L = ", L, " meters"]
END FOR
// Store results
APPEND results WITH ["Condition 3", qo, L, W, max_deflection, max_location]
// Plot data
plot_results(x, y, V, M, colors[current_index], "Condition3", current_index)
APPEND legend_entries WITH ["Condition 3: W = ", W, " meters"]
END FOR
END
FUNCTION calculate_beam_deflection(qo, L, W, d, E, I)
// Discretize the beam
x = linspace(0, L, 1000)
7
// Initialize deflection, shear force, and moment arrays
V = ZERO_ARRAY(LENGTH(x))
M = ZERO_ARRAY(LENGTH(x))
y = ZERO_ARRAY(LENGTH(x))
FUNCTION ADD_LEGENDS_TO_PLOTS(legend_entries)
SUBPLOT(3, 1, 1)
LEGEND(legend_entries)
SUBPLOT(3, 1, 2)
8
LEGEND(legend_entries)
SUBPLOT(3, 1, 3)
LEGEND(legend_entries)
END FUNCTION
GRAPH
9
MATLAB CODE
1. Main
10
2. Conditions
11
legend(legend_entries);
subplot(3,1,2);
legend(legend_entries);
subplot(3,1,3);
legend(legend_entries);
12
3. Deflection, Shear Force and Bending Moment
4. Result Plotting
13
MATLAB ELABORATION
1. Initialization
The script starts with the first instruction to the user to enter the beam length (‘L’). It
also initializes a distributed load (‘q_i’) at 100 N/m. These values are necessary for the
further calculation of the necessary parameters.
2. Material Properties
Material properties for an example group (e. g. , Steel) are initialized with specific
values: For the initial length it was assigned (‘Li’) (4. 2 metres), for the initial width
(‘Wi’) (0. 14 metres) and for the initial depth (‘di’) (0. 10 metres). These properties
shall be employed in the determination of various conditions of the structure in
question.
Three arrays are defined to represent different conditions by scaling the initial values:
For distributed loads we have ‘q_o’ for overall load, ‘L_conditions’ for the beam length,
and ‘W_conditions’ for beam width. Each of the arrays increases the respective first
term by factors of one, two and three.
Arrays for results such as ‘deflections’, ‘shear forces’, and ‘bending moments’ are
created and pre-initialized to zeros. All the arrays include three numbers, which pertain
to the three states that shall be tested for.
14
5. Loop over Conditions
The first for loop cycles through the aforementioned three sets of conditions to obtain
the current length, load, and width. Thereafter, it determines the deflection, shear force,
and bending moment using function proxies namely ‘calculate_deflection’,
‘calculate_shear_force’ and ‘calculate_bending_moment’. These calculations’
outcomes are kept in the predetermined arrays, which help in the subsequent
calculations.
The results for deflections, shear forces and bending moments are written into an Excel
file with the name ‘beam_responses.xls’. This can be easily done in other statistical
packages after copying and pasting the output data from Matlab.
7. Plotting Results
The ‘plot_beam_responses’ function produces the plots of the deflections, shear forces,
and bending moments with the length of the beam in interpretation. This visualization
is useful in enabling understanding on how the beam behaves under any given
circumstances.
8. Function Definitions
15
SCRIPT OUTPUT
CONCLUSION
The study demonstrates that a beam's length has a major impact on its deflection, with
longer beams showing more flexibility and deflection. This relationship highlights how crucial
it is to take beam length into account when designing structures in order to guarantee
performance and safety. The paper illustrates how distributed load intensity and beam size
affect structural responses by examining different loading scenarios. As a starting point for
16
comparison, the initial conditions are specified for length (4.2 m), width (0.14 m), depth (0.10
m), and distributed load intensity (100 N/m).
The resulting bending moment and shear force diagrams offer important insights into
the internal forces of the beam, which are essential for comprehending how the beam responds
to various loading scenarios and locating stress areas that could require further strengthening.
The study shows how the structural behaviour of a beam is affected by methodically changing
some factors, including distributed load intensity and beam length, while maintaining other
values constant. A deeper comprehension of the interactions between many design aspects is
made possible by this all-encompassing approach.
Last but not least, as Kenneth Marvin Leet et al. (2011) pointed out, good
communication is essential between structural engineers and architects. This study emphasises
how crucial teamwork is to producing the best structural designs that satisfy practical and
aesthetic standards. To sum up, this research offers a comprehensive examination of simply
supported beams under changing distributed loads, providing insightful knowledge about their
structural behaviour and assisting in the creation of safer and more effective structural designs.
17
REFERENCES
Hibbeler, R. C. (2020). Engineering Mechanics: Statics & Dynamics (15th ed.). Pearson.
Leet, K. M., Uang, C.-M., & Gilbert, A. M. (2011). Fundamentals of Structural Analysis (4th
Pesterev, A. V., Tan, C. A., & Bergman, L. A. (2000). A New Method for Calculating
Bending Moment and Shear Force in Moving Load Problems. Journal of Applied
18