You are on page 1of 4

National Conference on Exploring New Dimensions in Teaching Learning for Quality Education

Use of Python Programming for interactive


design of Reinforced Concrete Structures.
Shivaji M. Sarvade1, Sachin M. Pore2
1,2
Department of Civil Engineering, Dr. B.A.T.U., Vidyavihar, Lonere, Maharashtra.
1
shivaji.sarvade@gmail.com
2
smpore@dbatu.ac.in
Track No: 1
Track Name: Different dimensions of Teaching-Learning

Abstract: In India, majority of construction activities are of Python is a high level open source programming language
reinforced concrete structures, therefore design of which is extensively used by programmers across the world
reinforced concrete structures is one of the important for various applications. It is available for free and can work
subject considering employment aspect of Civil easily on personal computers with minimum configuration.
Engineering students. With diversified structural Design of reinforced concrete structure has been carried out
configurations it is imperative to use computer programs for using various commercial softwares available in the market
analysis and design of structures. Many commercial and this has been introduced in the academics to a certain
programs are available for design of reinforced concrete extent as well. However, these softwares are expensive and
structures, however they are expensive and provide limited it is not affordable for most institutes to purchase in
user licence. Every software has inherent assumptions sufficient number. Moreover, use of these readily available
which must be clearly understood before its implementation softwares does not enhance learning aspect much as the
in design. It is always advisable to develop own programs students can get the output with just few clicks.
for design of structures, as normally practised in most Programming on the other hand, can enhance the learning
design firms, either by using MS-Excel spreadsheet or any of the students as they need to develop the program for the
other computer programs. The only disadvantage with these solving the problem with diversified scenarios. Use of
programs is that they are expensive and are not programming in Civil Engineering has lots of advantages
customisable / flexible for individual needs. Python has and languages such as C, C++ are the part of curriculum in
been developing as a most favoured language for computer Civil Engineering in some of the universities. Though this
programing over other languages because of its ease in has not resulted in appreciable success owing to one
programming. A user without any programming fundamental problem that these courses are delivered by a
background can also effectively start developing programs faculty from either Computer Science or by non-Civil
in Python [1]. This tool can be very effectively utilised in Engineering faculty. Here lies the advantage of Python
teaching-learning process of design of concrete structures. compared with the other languages. Any person who does
Advantage with use of Python is that a designer can create not have programming background can start using Python
a customised program for interactive design. Python as it is very interactive and easy to program. Therefore, a
programs can also be converted in executable softwares. Civil Engineering faculty can use this language without
The paper discusses few programs developed using Python consuming extensive time on learning the language and
as a part of enhancement in teaching-learning process. start developing tutorials to utilise this language for his
Implementation of Python programming in undergraduate course.
design course will improve the analytical skills of the
students and have significant contribution to make them 2. Important Python Libraries for Civil Engineering
design industry ready professionals. Python has extensive standard library and as it is an open
source language, many useful libraries are developed for its
Keywords: Python, Structural Design, Reinforced use in data science. Import function of the standard library
Concrete Structures, Interactive Design of Python gives the flexibility to use these libraries in
programming. Some of the libraries which are very useful
from Civil Engineering aspect are discussed here, but one
can search the library (package) for his own purpose from
many available libraries.

A. NumPy
Corresponding Author NumPy[iv] is probably the most important library and most
Shivaji M. Sarvade, Department of Civil Engineering, of the libraries are built using NumPy. It helps in creating
Dr. B.A.T.U., Vidyavihar, Lonere, Maharashtra. the arrays of multi dimension with ease. For example, we
shivaji.sarvade@gmail.com have to interpolate for shear strength of concrete based on
1. Python for Civil Engineering grade of concrete and provided percentage of

ISBN 978-93-88441-93-3 160 KKWIEER,Nashik


National Conference on Exploring New Dimensions in Teaching Learning for Quality Education

reinforcement. This data is given in the table number 19 of the latest version. Also, the supporting libraries are under
IS 456-2000. With the use of NumPy, these arrays can be development which may not be compatible with the older
used in programming for further calculations. version. The latest version of Python is Python 3.7.3
released on 25th March, 2019[i] which is used in this paper.
B. SciPy Python lacks in the resources for learning for non-computer
SciPy[v] is another most important library which is science student to certain extent and one has to spend bit of
extensively used for mathematics and engineering. For time on searching the information from the documentation
example, we have to interpolate for values from the code web portal of each library. Though it is not that time
and this interpolation in design of reinforced concrete consuming because of large community websites helping
structure is mostly one dimensional. The SciPy function for Python programming, hard copy references are difficult
“interp1d” seamlessly perform such interpolations for a user to find for the latest version. There are different IDLEs
value in the program from given NumPy array. SciPy can (Integrated Development Learning Environment) for
also be used for performing numerical integration, solving Python like Spyder, PyCharm, Jupyter Notebook [ii] etc. and
differential equations etc. one may find it difficult to choose the IDLE for the task at
hand. It is recommended to use only one IDLE in the
C. Pandas beginning till one is familiar with the IDLE. In this paper,
Pandas[vi] is another important library which gives access to default IDLE of Python is used.
use of MS-Excel in the programming besides many other
built in functions. Pandas are not used in this paper, 5. Illustrative Python Programs for Design Course
however, it is an important library for Civil Engineers Following are few illustrative programs which aim to
handling large data with MS-Excel spreadsheets. explain applications of various Python functions. Python
has extensive documentation available on the official
D. Matplotlib website and online communities. Built in help function
Matplotlib[v] is the library for plotting multiple types of 2D can be used for help on any argument or keyword.
graphs using Python. It can produce high quality bar charts,
histograms, power spectra etc. This library is not used in the
paper but it is very useful library for Civil Engineering.

3. Implementation of Python for RCC Design Course


Design of reinforced concrete structures can be taught very
effectively using Python as design of any structural element
Figure 1. Help Function in Python
follows a stepwise procedure with checks from
A. Python program for type of beam section.
IS 456-2000. The stepwise procedure can help to form the
IS code does not allow use of over-Reinforced (ORF)
algorithm for the program. From the programmers
section and it is required to check the design to ensure the
perspective it is relatively easy to program for such cases as
design is under-reinforced (URF) or at the most balanced
it has constant procedure with variable input from the user
section. Algorithm for the same can be summarised in the
and checks from the standard tables, clauses of the IS code.
following table.
Students are required to design various structural elements Table 1. Steps to check the type of beam section
like, beams, slabs, columns, footings etc. for different inputs
No. Step
of span, loading and support conditions. If they are asked to
1 Calculate Provided Area of Steel
develop the algorithm for each structural element (which is
2 Find actual depth of NA (xa) by Cu =Tu
nothing but the stepwise procedure), and asked to program
the same using Python it can boost their understanding to an 3 From given grade of steel, find xulim
appreciable level. Further, it will enhance the creativity of 4 Compare xulim with xa
the students as the programs can be written in numerous 5 If xulim > xa the section is URF,
ways for the same element and application of their creativity If xulim < xa the section is ORF
will encourage them to write the code in the least possible If xulim = xa the section is Balanced
lines for a complicated structural design. The results of the
Table 2. Common functions required in Python
developed programs can also be compared with the
available commercial softwares to develop the confidence Function Use
of the students in the programming. This skill will definitely input() Takes user input (can be float,
increase their employment probability. integer, string)
print() Displays anything written in quotes
4. Challenges for Implementing Python in course import__as_ Imports a library with user defined
As discussed earlier, Python is an open source language and
short name to call the library
is developing day by day by various contributors. Till now
two major versions of Python exists, Python 2 and Python function
3. Python 3 is a considerable improvement over Python 2 To program this we have to utilise comparison operator and
and some of the functions in Python 2 are not supported by if-else statement. Common functions used in Python 3

ISBN 978-93-88441-93-3 161 KKWIEER,Nashik


National Conference on Exploring New Dimensions in Teaching Learning for Quality Education

are illustrated in table no.2. Following python code can be function is that it takes only one argument and the data type
used to check type of section for Fe 415. must be string. The output file can be formatted by using
‘\n’ to add a new line and ‘\t’ to add a tab separator.

Figure 2. Type of Section program in Python for Fe 415.

B. Shear strength of concrete form IS 456-2000


To find shear strength of concrete for given grade of
concrete and provided percentage of reinforcement, we
have to use NumPy and SciPy libraries. NumPy library is
used to form database given in table no.19 of IS code [2] and
SciPy interpolation function interp1d will be used for linear Figure 5 Importing of libraries in the program
interpolation. The program can calculate shear strength of All nine conditions and their corresponding bending
concrete for grade up to M30, however it can be expanded moment coefficients are put in the program in the form of
further. NumPy array. Based on the user values of Ly and Lx ratios
and the case number, it not only calculates the Bending
moments and corresponding reinforcements, but also writes
the important output information such as case number,
bending moments and reinforcements to a text file named
Output.txt.

6. Converting Python script to Windows Application


Python programs are called as Python scripts which can be
converted to Windows applications (.exe program) which
can be run on any machine that does not have Python
installed. Python can also be used to create android apps but
this is not in the scope of the paper. To convert a Python
script to .exe application, we have to install
Figure 3. Program to calculate shear strength of Concrete. pyinstaller to the system and with the help of
pyinstaller any Python script can be converted to
C. Design of Two way slab as per Annexure D, IS 456-2000 an .exe or an application program.
This is probably most tricky problem to program as it
involves 9 different end conditions and requires
interpolation for the bending moment coefficients at four
different locations. Corresponding reinforcement is to be
provided at appropriate location. This program also requires
use of NumPy and SciPy. Further, we can write the output
to a text file (.txt) using write (w+) function of Python. For
reinforcement calculations, inbuilt math function is also
required to take square root in the reinforcement calculation
formula.

Figure 6 Windows application of TW slab and sample output text file

6. Conclusion
Use of Python programming in the teaching-learning
process of Design of RCC structure can be very beneficial.
Figure 4 Write function in Python The programming not only develops the analytical skills but
Here f is defined as a function to create a .txt file with the creates a problem solving attitude in the students while
file name Output. Important thing to note with write debugging the programs. This skill also enhances their

ISBN 978-93-88441-93-3 162 KKWIEER,Nashik


National Conference on Exploring New Dimensions in Teaching Learning for Quality Education

employment potential as the design industry is looking for


a customized, cost effective solution for design of
structures. If the students are exposed to Python
programming they can prepare programs for real life
structural design as well. The language is open source and
can be used free of cost to develop programs even on the
personal computers with minimum hardware configuration.

References
1. McGrath M. (2018), Python in easy steps, 2013 Edition,
Ninth Reprint, McGraw Hill Education Pvt. Ltd, Chennai
2. BIS, IS 456-2000, Tenth reprint 2007,Bureau of Indian
Standards, New Delhi

A. Web References:
i) https://www.python.org/ (last accessed on 20th May 2019)
ii) https://www.datacamp.com/community/tutorials/data-
science-python-ide (last accessed on 20th May 2019)
iii) https://docs.python.org/3/library/index.html#library-
index (last accessed on 20th May 2019)
iv) https://www.numpy.org/ (last accessed on 20th May
2019)
v) https://docs.scipy.org/doc/scipy/reference/ (last
accessed on 20th May 2019)
vi) https://pandas.pydata.org/ (last accessed on 20th May
2019)

ISBN 978-93-88441-93-3 163 KKWIEER,Nashik

You might also like