You are on page 1of 3

NAME: B TEJA

ROLL NO.: 18065026 (BTECH)

COURSE: CE 336- MATRIX ANALYSIS OF STRUCTURES

ASSIGNMENT 1
5 1) C Program to find maximum deflection and slope in a simply supported

beam with point load at its mid span.


#include <stdio.h>
#include <math.h>
int main()
10 {
float P,L,E,I,max_def,max_slope;
printf("Enter the value of Point load at midspan in N\n");
scanf("%f",&P);
printf("Enter the value of Length of the beam in mm\n");
15 scanf("%f",&L);
printf("Enter the value of Elastic modulus of beam in N/mm^2\n");
scanf("%f",&E);
printf("Enter the value of Moment of Inertia of beam in mm^4\n");
scanf("%f",&I);
20 max_def=(P*L*L*L)/(48.0*E*I);
max_slope=(P*L*L)/(16.0*E*I);
printf("Maximum deflection of the beam in mm is %f \n",max_def);
printf("Maximum slope of the beam in radians is %f \n",max_slope);
return 0;
25 }
OUTPUT
2) C Program to find maximum deflection and slope in a simply supported
beam with Uniformly Distributed Load.
5 #include <stdio.h>
#include <math.h>
int main()
{
float W,L,E,I,max_def,max_slope;
10 printf("Enter the value of UDL in N/mm\n");
scanf("%f",&W);
printf("Enter the value of Length of the beam in mm\n");
scanf("%f",&L);
printf("Enter the value of Elastic modulus of beam in N/mm^2\n");
15 scanf("%f",&E);
printf("Enter the value of Moment of Inertia of beam in mm^4\n");
scanf("%f",&I);
max_def=(5*W*L*L*L*L)/(384.0*E*I);
max_slope=(W*L*L*L)/(24.0*E*I);
20 printf("Maximum deflection of the beam in mm is %f \n",max_def);
printf("Maximum slope of the beam in radians is %f \n",max_slope);
return 0;
}
OUTPUT

25
3) C Program to find maximum deflection and slope in a Cantilever beam
with Uniformly Distributed Load
#include <stdio.h>
#include <math.h>
5
int main()
{
float W,L,E,I,max_def,max_slope;
printf("Enter the value of UDL in N/mm\n");
10 scanf("%f",&W);
printf("Enter the value of Length of the beam in mm\n");
scanf("%f",&L);
printf("Enter the value of Elastic modulus of beam in N/mm^2\n");
scanf("%f",&E);
15 printf("Enter the value of Moment of Inertia of beam in mm^4\n");
scanf("%f",&I);
max_def=(W*L*L*L*L)/(8.0*E*I);
max_slope=(W*L*L*L)/(6.0*E*I);
printf("Maximum deflection of the beam in mm is %f \n",max_def);
20 printf("Maximum slope of the beam in radians is %f \n",max_slope);
return 0;
}

OUTPUT

25

You might also like