Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
20 views

Programming in Civil Engineering

This document discusses using MATLAB for civil engineering applications. It provides examples of using MATLAB for structural analysis, hydraulic analysis, and transportation engineering. Specifically, it demonstrates using MATLAB to analyze the deflection of a cantilever beam, calculate the diameter of a pipe, and simulate traffic flow. It also introduces some specialized software tools used in each civil engineering discipline, such as Prokon for structural design, EPANET for hydraulic network analysis, and additional tools for transportation planning.

Uploaded by

2575166
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Programming in Civil Engineering

This document discusses using MATLAB for civil engineering applications. It provides examples of using MATLAB for structural analysis, hydraulic analysis, and transportation engineering. Specifically, it demonstrates using MATLAB to analyze the deflection of a cantilever beam, calculate the diameter of a pipe, and simulate traffic flow. It also introduces some specialized software tools used in each civil engineering discipline, such as Prokon for structural design, EPANET for hydraulic network analysis, and additional tools for transportation planning.

Uploaded by

2575166
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Programming in Civil

Engineering using

EPANET

Mr Lewis Parsons
Lewis.Parsons@wits.ac.za

School of Civil and Environmental Engineering


Lecture objectives

• Application of MATLAB to the civil engineering discipline

- Structural engineering.

- Hydraulics engineering.

- Transportation engineering.

and

General software packages used in civil engineering.


Introduction

MATLAB allows civil engineers to optimise design models in a limited


timeframe.

The following are two major uses of MATLAB in civil engineering.

Creating designs:
Facilitate the creation of designs for the expected infrastructures and
facilities.

Numerical analysis and writing code:


Complex coding and mathematical analysis are required when simulating
model behaviour in civil engineering.
1. Structural Engineering

Structural engineering is a branch of civil engineering that focuses on the


design, analysis, and construction of structures to ensure they can withstand the
loads and pressures they will experience throughout their lifespan.
1. Structural Engineering

Analysis of a deflection - Basic concepts of a cantilever beam


1. Structural Engineering

Images of cantilever beams in practice.


1. Structural Engineering

Case: Deflection of cantilever beams


Deflection (δ) is the degree to which a particular structural element is
displaced when subjected to a load (P)

Four variables, which can determine the magnitude of the beam


deflections:
• Magnitude of the applied load (𝑃) ~ also referred to as “𝐹”.
• The length of the beam and location of the load.
• The material properties, such as the Young’s Modulus (𝐸)
• The cross-section properties, specifically the moment of inertia (𝐼)
1. Structural Engineering

Deflection analysis of a cantilever beam

• Length of the beam, L = 1000mm


• Width of the beam, b = 50mm
• Height of the beam, h = 155mm
• Distance of the force location, a = 800mm
• Young’s Modulus, 𝐸 = 200GPa
• Applied force, F = 25kN
1. Structural Engineering

A fixed free cantilever beam: Manually determining


deflection

The second moment of area is calculated


as:
I = 1/12 bh3

The shape of the deflected beam


is calculated as:
Code show below is available at:
https://www.modellingsimulation.com/2021/07/fixed-free-cantilever-beam-deflection-stress-analysis.html?m=0

A Fixed Free Cantilever Beam


Deflection using MATLAB

The following MATLAB codes are used to calculate the beam deflection and plot
the results for the beam between the fixed end and the applied load:
% Parameters from the question
E = 200*10^9;
a = 0.8;
b = 0.05;
h = 0.155;
I = (1/12)*(b*h^3);
f = 25000;

x = 0:0.01:0.8; % Vector x containing a start value of 0, a


0.01 step and 0.8 ending value

delta_1 = - (f*x.^2)./(6.*E.*I).*(3.*a - x); % for 0 <= x <= a


1. Structural Engineering

A Fixed Free Cantilever Beam


Deflection using MATLAB
figure(1)
plot(x, delta_1)
xlabel('Length (m)')
ylabel('Beam Deflection m)')
title('Cantilever Beam Deflection for 0 <= x <= a')
1. Structural Engineering

A fixed free cantilever beam deflection

Run a new scenario using MATLAB.


But what if the length, applied load,
location of load, cross-sectional • Change parameters
properties and material changes? • Quick - Save time
• Reliable
• Visual graphical output
1. Structural Engineering

Software package: Prokon

Prokon provides a suite of tools and modules to assist with


various aspects of structural engineering.

Key functionalities:

• Steel and Concrete Design: provides tools for the design of steel and concrete
structures, including the calculation of member capacities, detailing of
reinforcement, and generation of design reports.

• Foundation Design: such as isolated footings and pile foundations.

• Wind and Seismic Analysis: can evaluate the impact of wind and seismic
forces on structures. Engineers can assess the structural response to these
loads and design structures to withstand them.
1. Structural Engineering
Software package: Prokon used in the analysis of a cantilever beam
1. Structural Engineering
Software package: Prokon used in the analysis of a cantilever beam
1. Structural Engineering
Software package: Prokon used in the analysis of a cantilever beam
1. Structural Engineering
Software package: Prokon used in the analysis of a cantilever beam
2. Hydraulic Engineering

Hydraulic engineering is a field of civil engineering that focuses on the flow


and conveyance of fluids, particularly water.

It involves designing, analysing, and managing systems that use water,


such as rivers, lakes, reservoirs, canals, pipelines, and hydraulic
structures.
2. Hydraulic Engineering

Case: Calculation of the diameter of a pipe

• The main parameters of a hydraulic study are the geometry of the channel, the
fluid properties and the flow parameters.

Determine the minimum diameter (D) of a pipe transported in a 120-m-long pipeline using
MATLAB given the parameters below:

• Water at 20°C has a flow rate of 0.15m3/s.


• The roughness height for this pipe’s material is 0.0015mm.
• Head loss in the pipe = 10m.
2. Hydraulics Engineering
2. Hydraulics Engineering

Code for determining the minimum diameter of the pipe:

%STEP #1 (Setting the display format)


format short % numerical values to four decimal places

%STEP #2 (Gather user inputs)


a1 = {'Flow rate (m3/s)','Length of pipe (m)’, 'Water temperature (°C)','Maximum head loss (m)’,
'Roughness height (mm)'}; % defined to specify the input parameters
a2 = 'Inputs'; % Represents the text "Inputs."
a3 = [1 40; 1 40; 1 40; 1 40; 1 40]; % a 5x2 matrix that specifies default input values and ranges
a4 = inputdlg(a1,a2,a3); % Used to create a dialog box that allows the user to input data
%STEP #3 (Processing User Inputs)
b = char(a4); % converts the user inputs from a cell array a4 to a character array b.
c = str2num(b); % converts the character array b to a numeric array c
Q = c(1); L = c(2); T = c(3); h = c(4); e = c(5);
e1 = e./1000;
nu = (0.01779./(1+0.03368.*T+0.000221.*(T.^2))).*(10.^(-4));
g = 9.807;
2. Hydraulics Engineering
%STEP #4 (Iterative Calculation of Pipe Diameter)
Dp = 0.001; % based on the specified input parameters and fluid properties
E1 = 0;
E = 1;
while E1<E % while starts a loop and E1, E are expressions compared in the loop
V = (4*Q)./(pi.*(Dp.^2)); % Velocity
Re = (V.*Dp)./nu; % Reynolds number
f = (h.*Dp.*(2.*g))/(L.*(V.^2)); % Friction factor
E1 = sqrt(f)*(-2)*log10(((e1./Dp)./3.7)+(2.51./(Re.*sqrt(f))));
Dp = Dp + 0.000001;
end

%STEP #5 (Displaying Results)


%Convert numbers to character representation
Dp_s = sprintf('Pipe diameter = %1.4f m',Dp); % sprintf function that is used to create formatted
strings. It allows you to insert values into a string with specified formatting
V_s = sprintf('Velocity = %1.4f m/s',V);
Re_s = sprintf('Reynolds number = %1.4f',Re);
f_s = sprintf('Friction factor = %1.4f',f);
d = char(Dp_s,V_s,Re_s,f_s); %char() combines character strings into a single character string, with
each input variable appearing one after the other
msgbox(d,'Results’); %MATLAB will open a message box (a dialog box) with the content of d
displayed within it, and "Results" will be the title of the message box.
2. Hydraulics Engineering

Software package: EPANET


EPANET stands for Environmental Protection Agency Network Evaluation Tool.

Key functions:

• Hydraulic Analysis: EPANET helps in simulating the flow of water through


pipes, pumps, valves, and storage tanks in a water distribution system. It
calculates pressure, flow rates, and velocities at different points in the network.

• Network Design and Optimization: Engineers can use EPANET to design and
optimize the layout of water distribution systems. The software aids in
determining the optimal pipe diameters, pump locations, and tank sizes to meet
specific design criteria.

• Scenario Analysis: EPANET allows users to test different scenarios and


conditions, such as changes in demand, pipe characteristics, or the introduction
of new components. This helps in evaluating the system's response to various
situations.
2. Hydraulics Engineering

Software package: EPANET


EPANET provides a graphical user interface that allows users to input data about
the network, run simulations, visualise results, and analyse the performance of the
water distribution system.
3. Transport Engineering

Transportation engineering is a branch of civil engineering that focuses on


planning, designing, operating, and maintaining transportation systems.

The primary goal of transportation engineering is to ensure the safe, efficient,


and sustainable movement of people and goods.
3. Transport Engineering

Traffic Engineering: study and design systems to manage the flow of


vehicles, pedestrians, and cyclists. This includes traffic signal timing,
road markings, signage, and other measures to optimise traffic flow and
enhance safety.
3. Transport Engineering

Highway Engineering: Highway engineers focus on road system


design, construction, and maintenance. This includes considerations for
geometric design (layout of roads and intersections), pavement design,
and materials engineering.
3. Transport Engineering

Public Transportation: The planning and design of public transportation


systems such as buses, trains, subways, and light rail. They aim to provide
efficient and accessible alternatives to private vehicle travel.
3. Transport Engineering

Case: Traffic engineering simulation of transportation

Traffic Congestion
→ a high number of transportation equipment that is not proportional to the
limited capacity of the highway.
→ occurs in densely populated areas with high levels of community
mobilisation.

Traffic jams because of various activities, including:


• crossing the road
• parking vehicles

This congestion is also influenced by activities such as:


• entry and exit of vehicles to an agency
• the number of public vehicles that pass
3. Transport Engineering

Traffic engineering simulation of campus area transportation (study)

City of Bandung
Prone to congestion is Tamansari Street, with locations around the Bandung
Islamic University (UNISBA) campus and Pasundan University (UNPAS), also in
areas around the Bandung Institute of Technology (ITB) campus.

This location is always jammed:


• noon during lunch hours (11.00-14.00)
• afternoons when campus disbursements (15.00-18.00)

https://www.researchgate.net/publication/341492872_Traffic_engineering_simulation_of_campus_area_transportation_using_MATLAB_Si
mEvents/fulltext/5ec41370299bf1c09acbc492/Traffic-engineering-simulation-of-campus-area-transportation-using-MATLAB-SimEvents.pdf
3. Transport Engineering

Traffic engineering simulation of campus area transportation

What causes traffic congestion in the campus environment?


What is the best solution can be found to solve congestion problems?
3. Transport Engineering

Traffic engineering simulation of campus area transportation

Study consists of three phases: starting with the preparation, modelling and data analysis,
and the last one is the implementation.

In preparation phase,

- Following data was collect traffic information.


• observed traffic is at Tamansari Road
• constraint that the analysed traffic is the area near campus of UNISBA and UNPAS.
• The length of the observed and analysed road is 500 m, average width 5m, 2 line
directions, and maximum 1 lane vehicles for each line/direction.
• Vehicle in and out
• People crossing the road
• Side road parking
• People walking on the side road
• Bad driver
3. Transport Engineering
Results
The average arrival of vehicles is 28 vehicles per minute.

Observation data and analysis results are then implemented into the queuing model and
simulated using the MATLAB SimEvents
(discrete event simulation tool) application.

SimEvents is a toolbox in MATLAB that allows you to model and simulate discrete-event
systems. It's often used for modelling and simulating systems where events occur at
specific points in time, such as queuing systems, manufacturing processes, and
communication networks.
3. Transport Engineering

Traffic engineering simulation of campus area transportation

Simulation
The simulation was performed with reference to the data from the traffic observations.
The simulation was performed using the SimEvents application run on MATLAB software.
3. Transport Engineering

Traffic engineering simulation of campus area transportation

Simulation result
The results of the simulation are the waiting time in the queue and the travel time,

• The number of vehicle queues is quite long.


• This is caused by the high level of obstacles so that the flow of vehicles is obstructed
• These obstacles have an impact on increasing travel time
3. Transport Engineering

Traffic engineering simulation of campus area transportation

Conclusion
• Based on observations and analysis of traffic data, a queuing model has been
built
• The leading cause of congestion is the crossing activities. The entry and exit of
vehicles from campuses and offices causes travel time to increase from an
average of 3 minutes in normal conditions to 10 minutes or more in congested
traffic conditions.

Recommendations
• Implement strict regulations from the government and the campus authorities in
regulating the entry and exit of vehicles during rush hour.
• Building a bridge or underground tunnel for crossing the road will decrease
congestion
2. Hydraulics Engineering

Software package: PTV VISSIM


VISSIM stands for “Verkehr In Städten – SIMulationsmodell” in German, which
translates to "Traffic in Cities - Simulation Model" in English

Is a simulation software designed to optimise traffic flow, assess the impact of


new infrastructure projects, and enhance overall transportation system efficiency

Key functions:

• Traffic Simulation: Creates detailed and realistic simulations of traffic flow.

• Intersection and Network Analysis: used to model and analyse intersections,


road networks, and entire transportation systems. Users can evaluate the
performance of different traffic control strategies and infrastructure designs.

• Traffic Signal Control: used to simulate various traffic signal control strategies,
including fixed-time signals, actuated signals, and adaptive signal control.
2. Hydraulics Engineering

Software package: PTV VISSIM


3. Transport Engineering
3. Transport Engineering

Other application of MATLAB in Civil Engineering

1. Transportation: While transport and traffic engineering are often done with
Excel, using Matlab makes your work much easier.

2. Surveying: Matlab is used in surveying, specifically, levelling and calculating


the bearing.

3. Water Resources: Matlab has been used for many years to compute fluid
dynamics, an important element in constructing dams, Man-made lakes, and
other water resources.

4. Geotechnical Engineering: Lateral earth pressure, Retaining wall


programming. Mohr Circle is one of the most popular programs.

5. Structural Engineering: Finite element analysis. Picking up the


programming of Staad pro, e tabs should be possible by Matlab.
End

You might also like