Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
PROGRAMMING
CE227
INTRODUCTION
• GROUP MEMBERS ID
MD.ADBULLA-AL-SABBY 2018-1-22-036
MD.HASSAN-AL-MAMUN 2018-1-22-032
MD.SAKIBUL ISALM 2018-1-22-031
Presented to
Dr.Mohammad Salah Uddin
Assistant Professor
Department of Computer Science & Engineering
East West University
Summer 2019
2
A BASCULAR BRIDGE
Solving an engineering problem using numerical method
After cooling
trunnion got stuck in
hub
hub
trunnion
girder
5
TRUNNION –HUB-GIRDER ASSEMBLY PROCEDURE
Measuring the diameter Inserting the cooled Trunnion getting in Ice formation on the
of the cooled trunnion trunnion in heated hub contact with the hub trunnion-hub assembly
6
Steps to solve a problem
𝑻
∆D = D 𝑻𝒅 𝑻 𝜶 𝒇 𝑻
𝒓
Solution : used any Numerical method we use bisection for this problem
Implementation: cool the trunnion in liquid nitrogen or alcohol etc
7
SOLUTION (CONSULTANT CALCULATIONS)
To calculate the contraction in the diameter of the trunnion, thermal expansion coefficient at room
temperature is used. In that case the reduction, ∆ D in the outer diameter of the trunnion is
∆D = D 𝜶∆ T
𝑻𝒇
∆D = D 𝑻𝒅 𝑻 𝜶 𝑻
𝒓
where,
D = outer diameter of the trunnion,
𝜶 = coefficient of thermal expansion coefficient at room temperature
∆ T = change in temperature.
Given
D = 12.363"
9
CONT.
The equation that gives the temperature to which the trunnion has to be cooled to obtain the desired contraction
is given by
=) 𝒇𝑻(-0.50598*𝟏𝟎−𝟏𝟎 𝑻𝟑𝒇 + 𝟎. 𝟑𝟖𝟐𝟗𝟐 ∗ 𝟏𝟎−𝟕 𝑻𝟐𝒇 +0.7463*𝟏𝟎−𝟒 𝑻𝒇 + 𝟎. 𝟖𝟖𝟑𝟏𝟖 ∗ 𝟏𝟎−𝟐 = 𝟎
Use the bisection method of finding roots of equations to find the temperature 𝑇𝑓 to which the trunnion has to be
cooled. Conduct three iterations to estimate the root of the above equation. Find the absolute relative
approximate error at the end of each iteration and the number of significant digits at least correct at the end of
each iteration.
10
SOULTION BY USING BISECTION
• From the designer’s records for the previous bridge, 𝒇𝑻(,𝒍 )=(−𝟏𝟓𝟎)
the temperature to which the trunnion was cooled = −𝟎. 𝟓𝟎𝟓𝟗𝟖 ∗ 𝟏𝟎−𝟏𝟎 −𝟏𝟓𝟎 𝟑 + −𝟎. 𝟑𝟖𝟐𝟗𝟐 ∗ 𝟏𝟎−𝟕 ∗
was 100°F Hence assuming the temperature to be −𝟏𝟓𝟎 𝟐 +0.74369*𝟏𝟎−𝟒 * −𝟏𝟓𝟎 +0.88318*𝟏𝟎−𝟐
between and 150°F we have ,
= -1.2903*𝟏𝟎−𝟑
𝑻𝒇,𝒍 = −𝟏𝟓𝟎℉ 𝑻𝒇,𝒖 = −𝟏𝟎𝟎℉ 𝒇𝑻(,𝒖 )=(−𝟏𝟎𝟎)
Check if the function changes sign between 𝑇𝑓,𝑙 and 𝑇𝑓,𝑢 = −𝟎. 𝟓𝟎𝟓𝟗𝟖 ∗ 𝟏𝟎−𝟏𝟎 −𝟏𝟎𝟎 𝟑 + −𝟎. 𝟑𝟖𝟐𝟗𝟐 ∗ 𝟏𝟎−𝟕 ∗
−𝟏𝟎𝟎 𝟐 +0.74369*𝟏𝟎−𝟒 * −𝟏𝟎𝟎 +0.88318*𝟏𝟎−𝟐
= -1.8290 *𝟏𝟎−𝟑
Hence 𝒇𝑻 ,𝒍 ∗ 𝒇𝑻 ,𝒖 = (−𝟏𝟓𝟎) (−𝟏𝟎𝟎) = −1.2903∗𝟏𝟎−𝟑 −1.8290 ∗𝟏𝟎−𝟑 < 𝟎
So there is at least one root between 𝑻𝒇,𝒍 𝒂𝒏𝒅 𝑇𝑓,𝑢 that is between -150 and -100
11
CONT.
Iteration 1 Iteration 1
𝑻𝒇,𝒍 +𝑻𝒇,𝒖
The estimate of the root is 𝑻𝒇,𝒎 = 𝟐 𝑻𝒇,𝒍 +𝑻𝒇,𝒖
−150+(−100) The estimate of the root is 𝑻𝒇,𝒎 = 𝟐
= =-125 −150+(−125)
2
= =-137.5
න(𝑻𝒇,𝒎 ) = න(−𝟏𝟐𝟓) 2
න(𝑻𝒇,𝒎 ) = න(−𝟏𝟑𝟕. 𝟓)
=−𝟎. 𝟓𝟎𝟓𝟗𝟖 ∗ 𝟏𝟎−𝟏𝟎 −𝟏𝟐𝟓 𝟑
+ 𝟎. 𝟑𝟖𝟐𝟗𝟐 ∗
𝟏𝟎−𝟕 (−𝟏𝟐𝟓)𝟐 =−𝟎. 𝟓𝟎𝟓𝟗𝟖 ∗ 𝟏𝟎−𝟏𝟎 −𝟏 𝟑𝟕. 𝟓 𝟑
+
𝟎. 𝟑𝟖𝟐𝟗𝟐 ∗ 𝟏𝟎−𝟕 (−𝟏𝟑𝟕. 𝟓)𝟐
=2.3356* 10−4
=5.3762* 10−4
𝒇𝑻(,𝒎 ) 𝒇𝑻(,𝒍 ) = (𝟏. 𝟐𝟗𝟎𝟑 ∗ 𝟏𝟎−𝟑 )(2.3356*10−4 ) < 0 𝒇𝑻(,𝒎 ) 𝒇𝑻(,𝒍 ) = (𝟓. 𝟑𝟕𝟔𝟐 ∗ 𝟏𝟎−𝟑 )(2.3356*10−4 ) < 0
So the new lower and upper limits of the new bracket are So the new lower and upper limits of the new bracket
𝑻𝒇,𝒍 = −𝟏𝟓𝟎 𝑻𝒇,𝒖 = −𝟏𝟐𝟓 are
𝑻𝒇,𝒍 = −𝟏𝟑𝟕. 𝟓 𝑻𝒇,𝒖 = −𝟏𝟐𝟓
12
CONT.
13
CONT.
The absolute relative approximate error ∈𝑎 at the
end of Iteration 2 is
𝑛𝑒𝑤 −𝑇 𝑜𝑙𝑑
𝑇𝑚 𝑚
∈𝑎 = 𝑛𝑒𝑤 ∗ 100
𝑇𝑚
−131.25−(−137.5)
= ∗ 100 = 4.769%
−131.25
none of the significant digits at least correct 1
As the absolute relative approximate error is greater
that 1%
16
PROBLEM SOLUTION IN C PROGRAMMING
#include <stdio.h> if(f(xl) * f(xm) < 0)
#include<math.h> { xu = xm; }
double f(double x)
else if(f(xl) * f(xu) > 0)
{
return -0.50598*pow(10,-10)*(x*x*x)+0.38292*pow(10,-7)*x*x+0.74363*pow(10,-
{
4)*x+0.88318*pow(10,-2);
xl = xm;
}
}
int main()
{
else
double xl,xu,xm; {
int i = 0, iteration; xl = xm;
printf("Enter number of iteration: "); }
scanf("%d", &iteration);
} else
printf("\n\nEnter xL: & xU: \n\n");
{
scanf("%lf %lf", &xl,&xu);
while(i < iteration) printf("Boundary not valid. No root exits\n");
{ break;
if(f(xl)*f(xu)<0) }
{ i = i+1;
printf("Valid Boundary. So there exists one root atleast\n");
}
xm = (xl + xu) / 2.00;
return 0;
printf("\n\nroot is %lf\n",xm); 17
}
18