Professional Documents
Culture Documents
on
Computer Languages for Engineers
SUBMITTED BY
Majety, Narasimha Rao (3063753)
31 July 2021
SS - 2021
Contents
1 OVERVIEW 7
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 FORTRAN . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 C++ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 The Code::Blocks IDE . . . . . . . . . . . . . . . . . . . . . 8
3 MATRIX MULTIPLICATION 23
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Description of the Project . . . . . . . . . . . . . . . . . . . . 24
3.3 Flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.4 Program Explination . . . . . . . . . . . . . . . . . . . . . . 26
3.5 Results from FORTRAN . . . . . . . . . . . . . . . . . . . . 27
3.6 Validation of results with MATLAB . . . . . . . . . . . . . . 28
3.7 conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1
4 Thin-Walled Approximation For Sectional Values Using C++ 30
4.1 Problem Description . . . . . . . . . . . . . . . . . . . . . . 30
4.2 Theoretical Background . . . . . . . . . . . . . . . . . . . . . 31
4.2.1 Area of Cross Section . . . . . . . . . . . . . . . . . 31
4.2.2 Center of Gravity . . . . . . . . . . . . . . . . . . . . 32
4.2.3 Moment of Inertia . . . . . . . . . . . . . . . . . . . 32
4.2.4 First Moments of an Area . . . . . . . . . . . . . . . 33
4.2.5 Moment of Inertia About User Coordinates . . . . . . 33
4.2.6 Moment of Inertia about Center of Mass . . . . . . . 34
4.3 Profile Values . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.4 Approximation of the Problem . . . . . . . . . . . . . . . . . 35
4.5 Analytical Calculations . . . . . . . . . . . . . . . . . . . . . 39
4.5.1 Area . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.5.1.1 Case 1: [Profile with U100] . . . . . . . . . 40
4.5.1.2 Case 2: [Profile with U120] . . . . . . . . . 40
4.5.1.3 Case 3: [Profile with U140] . . . . . . . . . 40
4.5.2 First Moment of Area . . . . . . . . . . . . . . . . . . 41
4.5.2.1 Case 1: [Profile with U100] . . . . . . . . . 41
4.5.2.2 Case 2: [Profile with U120] . . . . . . . . . 41
4.5.2.3 Case 3: [Profile with U140] . . . . . . . . . 42
4.5.3 Center of Mass . . . . . . . . . . . . . . . . . . . . . 42
4.5.3.1 Case-1: [Profile with U100] . . . . . . . . . 43
4.5.3.2 Case-2: [Profile with U120] . . . . . . . . . 43
4.5.3.3 Case-3: [Profile with U140] . . . . . . . . . 43
4.5.4 Moment of Inertia About User Coordinates . . . . . . 44
4.5.4.1 Case-1: [Profile with U100] . . . . . . . . . 44
4.5.4.2 Case-2: [Profile with U120] . . . . . . . . . 46
4.5.4.3 Case-3: [Profile with U140] . . . . . . . . . 48
4.5.5 Mass moment of Inertia . . . . . . . . . . . . . . . . 49
4.5.5.1 Case-1: [Profile with U100] . . . . . . . . . 50
4.5.5.2 Case-2: [Profile with U120] . . . . . . . . . 52
4.5.5.3 Case-3: [Profile with U140] . . . . . . . . . 54
4.6 Project Structure . . . . . . . . . . . . . . . . . . . . . . . . 56
4.6.1 Base Class . . . . . . . . . . . . . . . . . . . . . . . 56
4.6.2 Node Class . . . . . . . . . . . . . . . . . . . . . . . 56
4.6.3 Element Class . . . . . . . . . . . . . . . . . . . . . 57
4.6.4 Line-Element . . . . . . . . . . . . . . . . . . . . . . 58
2
4.6.5 Arc-Element . . . . . . . . . . . . . . . . . . . . . . 59
4.6.6 Profile class . . . . . . . . . . . . . . . . . . . . . . . 59
4.6.7 Gauss Class . . . . . . . . . . . . . . . . . . . . . . . 60
4.6.8 CombinedProfile Class . . . . . . . . . . . . . . . . . 61
4.6.9 UML class Hierarchy . . . . . . . . . . . . . . . . . . 62
4.6.10 Error Handling . . . . . . . . . . . . . . . . . . . . . 63
4.6.11 Profile Creation Structure . . . . . . . . . . . . . . . 64
4.7 User Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
4.7.1 Execution of The code . . . . . . . . . . . . . . . . . 65
4.7.2 Output Window . . . . . . . . . . . . . . . . . . . . . 66
4.8 Results and Deviation . . . . . . . . . . . . . . . . . . . . . . 69
4.8.1 Analytical Results . . . . . . . . . . . . . . . . . . . 69
4.8.2 Numerical Results . . . . . . . . . . . . . . . . . . . 69
4.8.3 Deviation of Results . . . . . . . . . . . . . . . . . . 70
4.9 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
A Appendix 72
3
List of Figures
2.1 Graphical representation of Newton-Raphson method . . . . . 9
2.2 Input File Structure . . . . . . . . . . . . . . . . . . . . . . . 11
2.3 Implementation of main program "ScanForRootsMain.f90" . . 12
2.4 Checking of the input values . . . . . . . . . . . . . . . . . . 13
2.5 Searching for the roots . . . . . . . . . . . . . . . . . . . . . 14
2.6 Newton Method . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.7 Roots checking . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.8 Output window for Function 1 . . . . . . . . . . . . . . . . . 18
2.9 Function 1 plot showing roots . . . . . . . . . . . . . . . . . 19
2.10 Output window for Function 2 . . . . . . . . . . . . . . . . . 20
2.11 Function 2 plot showing roots . . . . . . . . . . . . . . . . . 20
2.12 Output window for Function 3 . . . . . . . . . . . . . . . . . 21
2.13 Function 3 plot showing roots . . . . . . . . . . . . . . . . . 22
3.1 Matrix Multiplication Flowchart . . . . . . . . . . . . . . . . 25
3.2 Matrix Multiplication Results from FORTRAN . . . . . . . . 28
3.3 Matrix Multiplication Results from Matlab . . . . . . . . . . . 29
4.1 Schematic Diagram of The Combined Profile . . . . . . . . . 31
4.2 Approximated Geometry after Discretization . . . . . . . . . 36
4.3 UML Diagram of Base Class . . . . . . . . . . . . . . . . . . 56
4.4 UML Diagram of Node Class . . . . . . . . . . . . . . . . . . 57
4.5 UML Diagram of Element Class . . . . . . . . . . . . . . . . 58
4.6 UML Diagram of Line-Element Class . . . . . . . . . . . . . 58
4.7 UML Diagram of Arc-Element Class . . . . . . . . . . . . . . 59
4.8 UML Diagram of Profile Class . . . . . . . . . . . . . . . . . 60
4.9 UML Diagram of Gauss Class . . . . . . . . . . . . . . . . . 61
4.10 UML Diagram of a Combinedprofile Class . . . . . . . . . . . 62
4.11 The UML Class Hierarchy . . . . . . . . . . . . . . . . . . . 63
4.12 Flow Chart explaining Profile Creation . . . . . . . . . . . . . 64
4
4.13 Opening Project File . . . . . . . . . . . . . . . . . . . . . . 65
4.14 Execution of the Project File . . . . . . . . . . . . . . . . . . 65
4.15 Output Window for Case 1 . . . . . . . . . . . . . . . . . . . 66
4.16 Output Window for Case 2 . . . . . . . . . . . . . . . . . . . 67
4.17 Output Window for Case 3 . . . . . . . . . . . . . . . . . . . 68
A.1 TaskSheet . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
A.2 Dimensional Details and Sectional Properties of U-Profile . . 73
A.3 Dimensional Details and Sectional Properties of I-Profile . . . 74
A.4 Dimensional Details and Sectional Properties of Circle-Profile 75
5
List of Tables
4.1 circle profile dimensions . . . . . . . . . . . . . . . . . . . . 35
4.2 U-Profile dimensions . . . . . . . . . . . . . . . . . . . . . . 35
4.3 I-Profile dimensions . . . . . . . . . . . . . . . . . . . . . . . 35
4.4 Circle Node Chart . . . . . . . . . . . . . . . . . . . . . . . . 37
4.5 Arc Element Chart . . . . . . . . . . . . . . . . . . . . . . . 37
4.6 Node Chart . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.7 Line Element Chart . . . . . . . . . . . . . . . . . . . . . . . 39
4.8 Section Values Obtained Through Analytical Calculations . . . 69
4.9 Section Values Obtained Through Numerical Calculations . . 70
4.10 Relative Error of All Three Profile Cases . . . . . . . . . . . . 71
6
Chapter 1
OVERVIEW
1.1 Introduction
Computer languages for engineers playing a significant role to solve or im-
plement the complicated mathematical models and mechanics problem. And
these programming languages are helps in avoiding complex repetitive prob-
lems. These are the revolutionary approaches in Computer Aided Design field.
During this course of study, for an extensive design calculation it is necessary
to implement programming languages and the algorithms approach by means
of C++ and FORTRAN.
The main aim of this project is acquiring the knowledge and command on
the programming languages and trying to implement them in Engineering prob-
lem related to course of study. The detailed explanation of the projects is dis-
cussed in the bellow.
1.2 Projects
This report presents the implementation and results of the given projects, which
are implemented in (FORTRAN and C++) two different Programming Lan-
guages. The Objectives are as Mentioned below:
7
1.3 FORTRAN
In 1950’s FORTRAN (FORMULATRANSLATOR) was developed by the IBM
programmers. It is the world’s first modern programming language which
helped to replace the complicated Assembly binary language 0’s and 1’s. Fur-
therly Fortran has become a popular among the scientific and mathematics.Advantages
of the Fortran language are Some discussed below .
4. Efficient compilers
1.4 C++
Bjarne Stroustrup was developed a C++ program and it is the objectoriented
programming (OOP) language. C++ is an extension of the C language. Hence
C++ is possible to code in a “C style” or object-oriented style. Despite of other
programming languages, like C and Java, C++ also found to be most widely
used language for scripting. C++ is used in many applications like Gaming,
Graphic User Interfaces (GUI), Advance Computations, Graphics design, Web
Browsers, Database Software, and in Operating Systems. Especially this pro-
gramming languages were bought great revolution in Medical and Engineering
Applications.
8
Chapter 2
IMPLEMENTATION OF
NEWTON’S ALGORITHM
2.1 Introduction
In numerical methods, Newton’s method it is also called as Newton-Raphson
Method. “Is a method for finding successively better approximations to the
roots of a real-valued function”, and it is powerful technique for solving nu-
merical equations.
The graphical representation of the Newton Raphson method shows in the
figure 2.1.
Where:
9
• f (x) is a function
• x0 is starting point
In this method an iterative scheme starts with an initial guess which is rea-
sonably close the true root (X0 ), then the function is approximated by its tangent
line and computes the intercept of X-axis. With the help of this iterative method
the intercepted x-value will be a better approximation than the first considered
valve and this iterative method continues until the real roots are found.
f (x)
xn+1 = xn − (2.1.1)
f 0 (x)
With the help of Newton’s method, not only the simple calculations but also
complex polynomials can be solved. Almost all the simulation software’s are
using Newton-Raphson.
Cons:
x5
f (x) = − 10x4 − 3x3 + 8x2 − 7x − 4 (2.2.2)
2
f (x) = e−3x/4 (2 − xsin(3x)) − e3x/4 (2 + xcos(3x)) (2.2.3)
10
2.3 Input File
The Main Task of the problem is to develop a Code to find the roots in cho-
sen interval using Newton’s algorithm method. In ScanforRootsInp.inp the
parameters must define, and it should be read by the program to run the code.
Driven by the demands of the project, developer can change the input param-
eters. ScanforRootsInp.inp input file must be in a structure, so that the input
values should be read and assign to the variables in certain order. The develop-
ment of the code Should be as follows.
• maxroots: It contains the number of roots for a given function for a given
interval.
The program initially should scan for the roots of the function, with the
initial position x0 . The ub, lb, and sw are the parameters described in the input
file from which the starting position x0 should be taken from the interval and the
roots of the functions which found are saved in a dynamic array. This should
be parameter of the function ScanForRootsFunction. The array size set by a
parameter and reads from the input file.
11
2.4 Project Structure
2.4.1 Introduction of Project Scan for Roots
In this section, the developed program for finding the roots is discussed. This
project contains multiple files to understand the project easily. The functional-
ity of the project is shown in terms flow charts.
12
In this step "InpReadFunction" function opens the input file to read the in-
put file “ScanForRoots.inp”. In the next step the checks the input parameters
for validity and if the values are okay, then the function proceeds further calcu-
lations, otherwise it ends with an error message.
In the further step the main program calls the function “ScanForRootsInp”
to search for the roots in the specified intervals which is shown as below.
13
Figure 2.5: Searching for the roots
14
Figure 2.6: Newton Method
In the above procedures, the roots are found and will check if there are
any repetition of the roots printed, the function ScanForRootsMain calls the
Subroutine “Duplicacy” as showed in the form of flow chart as below.
15
Figure 2.7: Roots checking
16
2.5 Program Explination
As discussed previously about the flow charts of different functions/subroutines
used in the program to calculate the roots of a given function. In additionally,
the individual functions will be discussing in detailed with the code in this
section:
• Main Program
– To open and read the input file, call the function 0readData
* Open and read the input file "ScanForRoots.inp"
* If the file is not readable, the program will stop and will show
an error message
* If not, it will write an input value
* To check for the validity of the input parameters perform an
error handling operation
* If the values are okay, then only returns to the main program
with input values
• End Program
17
2.6 Results
Using this FORTRAN Project Code, the roots for the given three functions are
calcu- lated. The results are displayed in the output window and prints the roots
in the ScanforRootsOut.out
2.6.1 Function 1
The given function is,
(1 − 2x − 7x2 ) ∗ sin(4x)
f (x) =
(1 + xsin(2x) − x2 cos(3x))
Total 15 roots have been found in the interval -5 to 5 and are successfully
listed in the output window as shown in figure 2.8 . The graphical representa-
tion of the given function in interval -5 to 5 is shown in the figure 2.9
18
Figure 2.9: Function 1 plot showing roots
2.6.2 Function 2
The given function is,
x5
f (x) = − 10x4 − 3x3 + 8x2 − 7x − 4
2
Total 2 roots have been found in the interval -5 to 5 and are successfully
listed in the output window as shown in figure 2.10 . The graphical representa-
tion of the given function in interval -5 to 5 is shown in the figure 2.11
19
Figure 2.10: Output window for Function 2
20
2.6.3 Function 3
The given function is,
x5
f (x) = − 10x4 − 3x3 + 8x2 − 7x − 4
2
Total 7 roots have been found in the interval -5 to 5 and are successfully
listed in the output window as shown in figure 2.12 . The graphical representa-
tion of the given function in interval -5 to 5 is shown in the figure 2.13
21
Figure 2.13: Function 3 plot showing roots
2.7 Conclusion
The main aim of developing code for the function is to scan a given algebraic
function f(x) for its roots by using the Newton’s algorithm. And the code has
been served by finding the roots for the given respective function. The imple-
mentation of newton’s scheme is resulting on how close to FORTRAN gener-
ated results are comparable to the roots generated by theoretical and this vali-
dation is done by comparing the graphical methods. The developed code has
capabilities of choosing starting point x0 and reading ub, lb parameters and
reading of sw from the input file. Therefore, this project is capable of listing
the calculated roots of the function in the output window and saves the values
in the dynamical arrays, prints the roots in the output file.
22
Chapter 3
MATRIX
MULTIPLICATION
3.1 Introduction
Multiplication of matrix is a very simple process, which is extensively using
in engineering applications such as FEA, FEM and Calculus. In general, if the
column of first matrix should have same number of entries as that of the entities
in the row of second matrix then the output of the matrix multiplication would
be considered correct. Therefore, in order to matrix multiplication must be sat-
isfy (n x m)(m x p)=(n x p). This method is useful even in case of any complex
matrix multiplication. Let consider A and B are the matrices as shown below:
A1,1 A1,2 · · · A1,m B1,1 B1,2 · · · B1,p
A
2,1 A2,2 · · · A2,m
B2,1 B2,2
· · · B2,p
A = .. .. B = ..
.. ... .. ... ..
. . . . . .
An,1 An,2 · · · An,m Bm,1 Bm,2 · · · Bm,p
The product of two matrices A, B is computed as A1ixj * A2jxk * A3kxm.
. . Anoxp = Sixp and represented as like AB and defined like n x p matrix.
AB1,1 AB1,2 · · · AB1,p
2,1 AB2,2 · · · AB2,p
AB
AB = .. .. ... ..
. . .
ABn,1 ABn,2 · · · ABn,p
23
3.2 Description of the Project
The Main aim of the second Project is to develop a program in FORTRAN to
multiply a given set of Matrices.
[2X5][5X9][9X2][2X7][7X4] = [2X4]
The basic reference code structure for the Matrix multiplication has been
taken from the code developed in the Lectures. The code should be described in
a specific way for matrix multiplication. The first line should contain the num-
ber of matrices and the second line contains the number of rows and columns
of the first matrix. The following code lines should be having the values of
the matrix one. And the next line will contain the order of the next matrix, the
following lines contains the data of this matrix. This process is repeated for all
the matrices, whose product should be calculated. The problem can be diag-
nosable i.e., dynamic allocable arrays should be used for implementation of the
program variables, minimize the allocated memory for making the program an
efficient as possible, and the data should read line by line to be print in the out-
put file. The validation of the results is required to check, whether the program
is writing the accurate results or not.
3.3 Flowchart
The algorithm used for the multiplication of the chain of matrices is given be-
low:
• Assigning the input and output files a name and Open the input file
• Call the ReadInput function and read the input matrices and their dimen-
sions
• Check the validity of the input parameters and values then open the output
file else report an opening error
• Calculate the product of first two matrices and store the results in matrix
C and deallocate matrices A and B
24
• Call MatrixMult function to calculate the product of further matrices by
assigning the third matrix to matrix A and the matrix C to matrix B.
Calculating the product of these two and storing it in matrix C
25
3.4 Program Explination
This section presents an insight into the development of the program to calcu-
late the chain of n matrices multiplication.
• Declaration of global input parameters
This section defines the different input parameters used in the program
under the main module. Some of the global declarations made in this
program described as:
26
– Memory allocation : If the above specified conditions are satisfied,
then the program will allocate the memory to the arrays containing
the matrix values.
27
Figure 3.2: Matrix Multiplication Results from FORTRAN
28
Figure 3.3: Matrix Multiplication Results from Matlab
3.7 conclusion
The code is developed in FORTRAN for the multiplication of multiple ma-
trices. The result is compared with the results from a mathematical software
MATLAB and concludes this project is giving the efficient results.
29
Chapter 4
Thin-Walled Approximation
For Sectional Values Using
C++
C++ is a general-purpose programming language with a bias towards the system
programming that supports data abstraction. It is a Object-Oriented-Programming
(OOP). It is originally known a C with Classes. It is renamed as C++ in 1983
30
Figure 4.1: Schematic Diagram of The Combined Profile
Where,
eµ,i = T he relative elasticity o f line i f or only one material.
31
Li = T he length o f line i.
ti = T he thickness o f line i.
Where,
Ai = T he area o f line i.
x̄i = T he x coordinate o f the center o f line i.
ȳi = T he y coordinate o f the center o f line i.
I = m ∗ r2 (4.2.4)
Where,
m = Mass o f the body
r = Perpendicular distance f rom the axis o f rotation
Above mathematical relation is for general case and the dierent forms of
moments of Inertia are explained below.
32
4.2.4 First Moments of an Area
The first moment of area is a measure of the distribution of the area of a shape
in relation to an axis. The first moments of an area are the area integrals given
below. The (x,y) values are related to the given coordinate system.
Z n
Sx = eµ · y · dA ≈ ∑ eµ,i · ȳi · Ai (4.2.5)
A i=1
Z n
Sy = eµ · x · dA ≈ ∑ eµ,i · x̄i · Ai (4.2.6)
A i=1
Where,
Ai = T he area o f line i.
x̄i = T he x coordinate o f the center o f line i.
ȳi = T he y coordinate o f the center o f line i.
n
2 ! !
yb,i − ya,i
Z
Ixx = eµ · y2 · dA ≈ ∑ eµ,i · + ȳ2i · Ai (4.2.7)
A i=1 12
n
2 ! !
xb,i − xa,i
Z
Iyy = eµ · x2 · dA ≈ ∑ eµ,i · ( + x̄i2 · Ai (4.2.8)
A i=1 12
! !
Z n xb,i − xa,i · yb,i − ya,i
Ixy = − eµ · x · y · dA ≈ − ∑ eµ,i · + x̄i · ȳi · Ai
A i=1 12
(4.2.9)
33
Where,
Ai = T he area o f line i.
x̄i = T he x coordinate o f the center o f line i.
ȳi = T he y coordinate o f the center o f line i.
xa,i = T he x coordinate o f the f irst point o f line i.
ya,i = T he y coordinate o f the f irst point o f line i.
xb,i = T he x coordinate o f the second point o f line i.
yb,i = T he y coordinate o f the second point o f line i.
Where,
Ai = T he area o f line i.
Xc = T he x coordinate o f the center o f mass i.
Yc = T he y coordinate o f the center o f mass i.
Ixx = T he moment o f inertia o f the pro f ile i about x − axis.
Iyy = T he moment o f inertia o f the pro f ile i about y − axis.
Ixy = T he moment o f inertia o f the pro f ile i about z − axis.
34
Profile do (mm) tc(mm A(cm2 ) Ixx (cm4 ) Iyy (cm4 ) ex (cm) ey (cm)
Profile hu(mm) bu(mm) su(mm) tu(mm) A(cm2 ) Ixx (cm4 ) Iyy (cm4 ) ex (cm) ey (cm)
Profile hh(mm) bh(mm) sh(mm) th(mm) A(cm2 ) Ixx (cm4 ) Iyy (cm4 ) ex (cm) ey (cm)
35
Figure 4.2: Approximated Geometry after Discretization
The above figure gives us a set of 23 nodes and 13 elements, the position of
the nodes and the element connectivity are as given below,
Helpers used: Some of the following Helpers are used in defining the nodes
are shown below:
hh
• q= 2 − th
hh th
• d= 2 − 2
hu tu
• k= 2 − 2
• w = bu − su
2
bh
• g= 2
do
• x= 2 − tc2
bh
• y= 2
hh
• z= 2
hu
• g= 2
• r = bu − su
36
Circle Nodes Coordinates
X Y
do
1 0 2 + sh
2
sh tc
2 0 2 + 2
do
3 x 2 + sh
2
tc sh
4 0 do - 2 + 2
do
5 -x 2 + sh
2
37
Nodes Coordinates
X Y
6 -q 0
7 q 0
8 -d g
9 -d -g
10 d g
11 d -g
12 -y k
13 -y -k
14 y k
15 y -k
16 -y-r k
17 -y-r -k
18 y+r k
19 y+r -k
20 -y-w z
21 -y-w -z
22 y+w z
23 y+w -z
38
Line-Elements Node1 Node2 Thickness (dt)
5 6 7 sh
6 8 9 th
7 10 11 th
8 12 16 tu
9 13 17 tu
10 14 18 tu
11 15 19 tu
12 20 21 su
13 22 23 su
4.5.1 Area
The total area is the sum of all the areas of individual profiles. Let A be the
total Area of the combined profile. The area of the combined profile in three
different cases is calculated as follows: (Note: The proiles I and circle remains
same and the U section properties are varying.) The dimensions of each profile
are shown in the tables 4.1, 4.2, 4.3.
39
4.5.1.1 Case 1: [Profile with U100]
A = A1 + A2 + A3 + A4 (4.5.1)
= 13.5 + 53.8 + 7.84 + 13.5 cm2
= 88.64 cm2
Here,
A = A1 + A2 + A3 + A4 (4.5.2)
= 17 + 53.8 + 7.84 + 17 cm2
= 95.64 cm2
Here,
A = A1 + A2 + A3 + A4 (4.5.3)
= 20.4 + 53.8 + 7.84 + 20.4 cm2
= 102.44 cm2
Here,
40
4.5.2 First Moment of Area
By using the above calculated areas we calculate the first moment of area along
X and Y-Axis. And as we already know the profile combinations for each case,
we are directly going to the calculation steps.
Sx = ∑ yi · A i
sh do
Sx = eyu · A1 + eyI · A2 + + + eyc · A3 + (eyu ) · A4
2 2
0.65 8.89
= 0 · (13.5) + 0 · (53.8) + + + 0 · 7.84 + 0 · (13.5)
2 2
= 37.3968 cm3
Y-Axis
Sy = ∑ xi · Ai
−hh hh
Sy = − bu + exu · A1 + (exI ) · A2 + (exc ) · A3 + + bu − exu · A4
2 2
−19 19
= − 5 + 1.55 · (13.5) + 0 · (53.8) + 0 · (7.84) + + 5 − 1.55 · (13.5)
2 2
= 0 cm3
Sx = ∑ yi · A i
sh do
Sx = eyu · A1 + eyI · A2 + + + eyc · A3 + (eyu ) · A4
2 2
0.65 8.89
= 0 · (17) + 0 · (53.8) + + + 0 · 7.84 + 0 · (17)
2 2
= 37.3968 cm3
41
Y-Axis
Sy = ∑ xi · Ai
−hh hh
Sy = − bu + exu · A1 + (exI ) · A2 + (exc ) · A3 + + bu − exu · A4
2 2
−19 19
= − 5.5 + 1.6 · (17) + 0 · (53.8) + 0 · (7.84) + + 5.5 − 1.6 · (17)
2 2
= 0 cm3
Sx = ∑ yi · A i
sh do
Sx = eyu · A1 + eyI · A2 + + + eyc · A3 + (eyu ) · A4
2 2
0.65 8.89
= 0 · (20.4) + 0 · (53.8) + + + 0 · 7.84 + 0 · (20.4)
2 2
= 37.3968 cm3
Y-Axis
Sy = ∑ xi · Ai
−hh hh
Sy = − bu + exu · A1 + (exI ) · A2 + (exc ) · A3 + + bu − exu · A4
2 2
−19 19
= − 6 + 1.75 · (20.4) + 0 · (53.8) + 0 · (7.84) + + 6 − 1.75 · (20.4)
2 2
= 0 cm3
42
4.5.3.1 Case-1: [Profile with U100]
Sy 0 cm3
XC = = = 0 cm
A 88.64 cm2
Sx 37.3968 cm3
YC = = = 0.4220 cm
A 88.64 cm2
Sy 0 cm3
XC = = = 0 cm
A 95.64 cm2
Sx 37.3968 cm3
YC = = = 0.3910 cm
A 95.64 cm2
Sy 0 cm3
XC = = = 0 cm
A 102.44 cm2
Sx 37.3968 cm3
YC = = = 0.3651 cm
A 102.44 cm2
43
4.5.4 Moment of Inertia About User Coordinates
The moment of inertia of combined profiles is the sum of the moments of iner-
tia of the individual profiles for the three profile combination cases.
44
About Y-Axis
45
4.5.4.2 Case-2: [Profile with U120]
About X-Axis:
46
About Y-Axis
47
4.5.4.3 Case-3: [Profile with U140]
About X-Axis:
48
About Y-Axis
49
4.5.5.1 Case-1: [Profile with U100]
About X-Axis:
2
ICxx1 = Ixx + A1 · dyc 1
50
About Y-Axis
2
ICyy1 = Iyy + A1 · dxc1
2
−hh
= Iyy + A1 · Xc − − bu + exu
2
2
4 2 −19
= 29.3 cm + 13.5 cm · 0 − − 5 + 1.55
2
= 2293.28 cm4
2
ICyy2 = Iyy + A2 · dxc2
51
4.5.5.2 Case-2: [Profile with U120]
About X-Axis:
2
ICxx1 = Ixx + A1 · dyc 1
52
About Y-Axis
2
ICyy1 = Iyy + A1 · dxc1
2
−hh
= Iyy + A1 · Xc − − bu + exu
2
2
4 2 −19
= 43.2 cm + 17 cm · 0 − − 5.5 + 1.6
2
= 3095.72 cm4
2
ICyy2 = Iyy + A2 · dxc2
53
4.5.5.3 Case-3: [Profile with U140]
About X-Axis:
2
ICxx1 = Ixx + A1 · dyc 1
54
About Y-Axis
2
ICyy1 = Iyy + A1 · dxc1
2
−hh
= Iyy + A1 · Xc − − bu + exu
2
2
4 2 −19
= 62.7 cm + 20.4 cm · 0 − − 6 + 1.75
2
= 3919.575 cm4
2
ICyy2 = Iyy + A2 · dxc2
55
4.6 Project Structure
To develop the structure of project using C++ program, the different classes are
defined. These classes are discussed in detail using UML diagrams here.
56
Figure 4.4: UML Diagram of Node Class
57
Figure 4.5: UML Diagram of Element Class
4.6.4 Line-Element
The Line-Element Class describes the connection between the nodes and the
connection types. One element is defined with the two nodes. This element
has a thickness and defines in the definition. The UML diagram of the Element
class is shown in figure 4.6.
58
4.6.5 Arc-Element
The Arc-Element Class describes the connection between the nodes and the
connection types of circle profile. One element is defined with the three nodes.
This element has a thickness and defines in the definition. The UML diagram
of the Element class is shown in figure 4.7.
59
Figure 4.8: UML Diagram of Profile Class
60
Figure 4.9: UML Diagram of Gauss Class
61
Figure 4.10: UML Diagram of a Combinedprofile Class
62
Figure 4.11: The UML Class Hierarchy
• Checks all the input parameters like height, width, thickness and length
of profiles. These values should not be negative.
63
4.6.11 Profile Creation Structure
The algorithm of profile creation is shown in figure 4.12. Firstly, the project file
reads the input parameters and checks all the input parameters. If errors found,
it will display error message and terminates the program. If no errors found in
the input file, the nodes will create and the connecting nodes will follows. After
successfully connecting all the nodes, the program will assign each element to
their respective section. Here, the sectional values will be calculated. After
calculating all the defined section values, it will display the obtained values.
64
4.7 User Manual
This section gives an information to an user regarding execution of the devel-
oped program for calculation of section properties of combined profile using
thin wall approximation. The program is developed using CODE:Blocks IDE
and is compiled using the GCC compiler for C++. The brief discussion of of
the usage of files is discussed here.
65
4.7.2 Output Window
After successfully execution of the program, the sectional values will be printed
on the output window. The obtained output results for each case are shown in
figures 4.15, 4.16, 4.17. The given combined profile has three cases. Case 1
has the one IPE 200, one circle and two U100x50x6 profiles. Case 2 has the
one IPE 200, one circle and two U120x55x7 profiles. Case 3 has the one IPE
200, one circle and two U140x60x7 profiles. The program prints the data of the
profile as mentioned in the input file, the nodes and elements created and prints
all the calculated sectional values and prints in Output window.
66
Figure 4.16: Output Window for Case 2
67
Figure 4.17: Output Window for Case 3
68
4.8 Results and Deviation
4.8.1 Analytical Results
Sectional Values of the three combinations are calculated in the section 4.5.
The values are tabulated below in table 4.8.
Moment of Moment of
First moment
Area Centroid inertia about Inertia about
Profile of Inertia
(cm2 ) (cm) user axis centroid
(cm3 )
(cm4 ) (cm4 )
A Sx Sy XC YC Ixx,user Iyy,user Ixx,C Iyy,C
69
Moment of Moment of
First moment
Area Centroid inertia about Inertia about
Profile of Inertia
(cm2 ) (cm) user axis centroid
(cm3 )
(cm4 ) (cm4 )
A Sx Sy XC YC Ixx,user Iyy,user Ixx,C Iyy,C
70
Moment of Moment of
First moment
Area Centroid inertia about Inertia about
Profile of Inertia
[%] [%] user axis centroid
[%]
[%] [%]
A Sx Sy XC YC Ixx,user Iyy,user Ixx,C Iyy,C
4.9 Conclusion
After comparing the results of Analytical and C++ program the output is sat-
isfactory with considerable errors. Since we were neglected the fillets across
the edges and the exterior curved sections, which causes the missing of the data
during the code computation. This could be the major reasons for the error
difference in the combined profile. For more accurate results, number of nodes
can be increase. From the comparison we can say that the results obtained from
the program are reliable. The maximum area deviation was found below 4 per-
centage in case-1, The maximum deviation in the moment of inertia was found
below 3 percentage with the case-1.
71
Appendix A
Appendix
72
Figure A.2: Dimensional Details and Sectional Properties of U-Profile
73
Figure A.3: Dimensional Details and Sectional Properties of I-Profile
74
Figure A.4: Dimensional Details and Sectional Properties of Circle-Profile
75
Bibliography
[1] Class Material from Prof, Dr. rer. nat. Ernst Baeck,
http://info.baustatik.uni-due.de/
[2] FORTRAN,
https://gcc.gnu.org/fortran/
[3] C++,
https://isocpp.org/
[4] LATEX
https://www.latex-project.org//
76