0% found this document useful (0 votes)
51 views12 pages

Numerical Methods & Computer Programming Sessional: Presentation On

The document presents three C programs to analyze structural elements: 1) A cantilever beam with distributed and point loads to calculate shear and moment at intervals along the beam. 2) A simply supported beam with distributed loading to calculate shear and moment at intervals. 3) A problem to calculate the diameter of a single replacement pipe of length 1700m for three pipes of different lengths and diameters connected in series.

Uploaded by

Mumtahina Mouli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views12 pages

Numerical Methods & Computer Programming Sessional: Presentation On

The document presents three C programs to analyze structural elements: 1) A cantilever beam with distributed and point loads to calculate shear and moment at intervals along the beam. 2) A simply supported beam with distributed loading to calculate shear and moment at intervals. 3) A problem to calculate the diameter of a single replacement pipe of length 1700m for three pipes of different lengths and diameters connected in series.

Uploaded by

Mumtahina Mouli
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Presentation on

Numerical Methods & Computer


Programming Sessional
CE 2202

Submitted by
Fahad AL Fahim
Section : B
Roll : 1600067
DEPARTMENT OF CIVIL
Program No - 1
A cantilever beam is shown in figure below. A C program is to be written to
compute shear and moment of the beam at every L/N distance from the free end.

5 lb./ft. 72 lb.

77 ft.
x

 Length of the beam, L (feet) = Last two digits of roll number + 10


= 67+10 ft. = 77 ft.
 Concentrated load, f (lb.) = Last two digits of roll number + Birth Date
=67+5 lb. = 72 lb.
 Uniformly Distributed Load, w (lb. /ft.) = Birth date = 5 lb. /ft.
 N = 100+ Last two digits of roll number = 100+67 = 167
shear and moment of the beam at every 77/167 distance from the free end is to be computed
Program No - 1

5 lb./ft. 72 lb.
M
x
V

Condition ∑Fy= 0 ∑Mx= 0


 V - 72 - 5*x =0  M + 72*x + 5*x*x*0.5 = 0
From x=0 to x=L  V =5*x+72  M = - (5*x*x*0.5 + 72*x)

inc=L/N;
for(x=0;x<=L;x=x+inc)
{ V=(w*x)+f;
M=-((f*x)+(w*x*x*0.5));
printf("at %9f distance from right side shear is = %9f and moment is %9f \n",x,V,M);
}
Program No - 1

5 lb./ft. 72 lb.

FBD
500
450
400
350

Shear (lb.)
300
250
200
150
100
50
SFD
0
80 70 60 50 40 30 20 10 0

Bending Moment (lb.ft.) Distance


Distance (ft.) (ft.)
0
80 70 60 50 40 30 20 10 0

-5000

-10000

-15000

-20000
BMD
-25000
Program No - 2
A simply supported beam is shown in figure below. A C program is to be written to
compute shear and moment of the beam at every L/N distance from the free end.

5 lb./ft. x

77 ft.
A B

 Length of the beam, L (feet) = Last two digits of roll number + 10


= 67+10 ft. = 77 ft.
 Uniformly Distributed Load, w (lb. /ft.) = Birth date = 5 lb. /ft.
 N = 100+ Last two digits of roll number = 100+67 = 167
shear and moment of the beam at every 77/167 distance from the free end is to be computed
Program No - 2

5 lb./ft. x

77 ft.
Ra Rb

∑Ma= 0 ∑Fy= 0 ∑Mx= 0


 5*77*77/2 – Rb*77 = 0  V - 5*x + Rb =0  M - Rb*x + 5*x*x*0.5 = 0
 Rb = 192.5 lb.  V = 5*x - Rb  M = Rb*x - 5*x*x*0.5

inc=L/N;
for(x=0;x<=L;x=x+inc)
{ V=(w*x)-Rb;
M=((Rb*x )- (w*x*x*0.5));
printf("at %9f distance from right side shear is = %9f and moment is %9f \n",x,V,M);
}
Program No - 2
5 lb./ft.

FBD
192.5 lb. 192.5 lb.
250
200
150
100

Shear in lb.
50
0
-50
SFD -100
-150
-200
-250
80 70 60 50 40 30 20 10 0

DIstance

4000
Bending Moment in lb.ft.

3500
3000
2500
2000
BMD
1500
1000
500
0
80 70 60 50 40 30 20 10 0

Distance
Program No - 3
Three pipes of lengths 800m, 500m and 400m and of diameters 500 mm, 400 mm and
300 mm respectively are connected in series. These pipes are to be replaced by a
single pipe of length 1700 m. Find the diameter of the single pipe

Length = 800 m Length = 500 m Length = 400 m


Diameter = 0.5 m Diameter = 0.4 m Diameter = 0.3 m

FORMULA :  l1=800  d1=0.5


 d2=0.4
x=(l1/pow(d1,5))+(l2/pow(d2,5))+(l3/pow(d3,5));  l2=500  d3=0.3
d=pow((l/x),0.2);  l3=400
printf("The diameter of the equivalent pipe is %f",d); OUTPUT : The diameter of the
equivalent pipe is 0.371875
Program No - 4
A C program has to be written to read two matrices A and B and print A + B
(as my roll number is 67 which is odd)

for(i=0;i<3;i++) for(i=0;i<m;i++)
1 2 3
{ {
A= 4 5 6 for(j=0;j<3;j++) C=A+B for(j=0;j<n;j++)
7 8 9 { {
scanf("%d",&A[i][j]);}} C[i][j]=A[i][j]+B[i][j];}}

for(i=0;i<m;i++) OUTPUT
for(i=0;i<3;i++) {
9 8 7 { for(j=0;j<n;j++) 10 10 10
B= 6 5 4 for(j=0;j<3;j++) {printf("\t%d",C[i][j]);} 10 10 10
3 2 1 { printf("\n"); 10 10 10
scanf("%d",&B[i][j]);}}
Program No - 5
Write a C program to print the following : 10 20 30 40 50 60 70 80 90 100

for(i=10;i<=100;i+=10)

Initialization Condition Incrimination

{
printf("%d \t",i); // body of the loop
}

Output
10 20 30 40 50 60 70 80 90 100
Program No - 6
A program is to be written that reads a floating‐point number and then displays right ‐most digit
of the integral part of the number

 x=(int)num; Converts the floating number into a integer

 x=x%10; Divides the integer by 10 and assigns the value into x

Prints the value of x which is the right most digit of


 printf("%d",x); the integral part of the number

Enter your floating point number


Output : 4567.123
7

You might also like