You are on page 1of 20

ASSIGNMENT NO.

1
NAME : KUNAL BANDUJI DUDHANKAR

PRN NO : 10303320171161210029

BATCH : B

CLASS : SECOND YEAR MECHANICAL (B-TECH)

SUBJECT : STRENGTH OF MATERIALS


Problem 1 : Series
#include <stdio.h>

void main()

{float L1,L2,L3,D1,D2,D3,A1,A2,A3,P,S1,S2,S3,L,e1,e2,e3,E;

printf("enter the value of D1 and D2 and D3 in mm\n");

printf("\n D1-Diameter of first part of bar, D2-Diameter of second part of bar, D3-Diameter of third part
of bar");

scanf("%f%f%f",&D1,&D2,&D3);

printf("enter value of P in N");

printf("\n P - Applied load");

scanf("%f",&P);

A1= 0.7853*D1*D1;

printf(" Area of first part of rod in mm2 = %f\n",A1);

A2=0.7853*D2*D2;

printf("Area of second part of rod in mm2= %f\n",A2);

A3= 0.7853*D3*D3;

printf("Area of third part of rod in mm2= %f\n",A3);

S1 = P/A1;

printf("Stress in first part of rod in N/mm2= %f\n",S1);

S2=P/A2;

printf("Stress in second part of rod in N/mm2= %f\n",S2);

S3 =P/A3;

printf ("Stress in third part of rod in N/mm2= %f\n",S3);

printf("enter value of E in N/mm2");

printf("\n E - Young modulus of rod");


scanf("%f",&E);

printf("enter the value of L1 and L2 and L3 in mm\n");

printf("\n L1- Length of first part of rod, L2 - Length of second part of rod, L3 - Length of third part of
rod");

scanf("%f%f%f",&L1,&L2,&L3);

e1 = S1*L1/E;

e2 = S2*L2/E;

e3 = S3*L3/E;

L =(e1+e2+e3);

printf("Total elongation of rod in mm=%f\n",L);


Problem 2 : Series
#include <stdio.h>

void main()

{float P1,P2,P3,P4,Pm,L1,L2,L3,l1,l2,l3,A,E,L,K,F1,F2,F3;

printf("enter the value of P1 in N");

printf("\n P1- force acting on first part of bar in left direction");

scanf("%f",&P1);

printf("enter the value of P3 in N");

printf("\n P3-force acting on last part of bar in left direction ");

scanf("%f",&P3);

printf("enter the value of P2 and P4 in N");

printf("\n P2- Force acting on middle part of bar in right direction and P4 be force acting on middle part
in left direction");

scanf("%f%f",&P2,&P4);

Pm=P2 - P1;

printf("Resultant force acting on Middle bar in N= %f\n",Pm);

printf("enter the value of A in mm2");

printf("\n A - Area of bar ");

scanf("%f",&A);

printf("enter the value of E in N/mm2");

printf("\n E - Young modulus of bar");

scanf("%f",&E);

printf("enter the value of L1 and L2 and L3 in mm");

printf("\n L1-length of first part of bar, L2-length of middle part of bar, L3-Length of last part of bar");

scanf("%f%f%f",&L1,&L2,&L3);
K = A*E;

F1=P1*L1;

l1=F1/K;

printf(" extension in first part of bar in mm= %f\n",l1);

F2=Pm*L2;

l2=F2/K;

printf("extension in middle part of bar in mm=%f\n",l2);

F3=P3*L3;

l3 = F3/K;

printf("extension in last part of bar in mm= %f\n",l3);

L = l1-l2-l3;

printf("Change in length of bar in mm= %f\n",L);

}
Problem 3 : Parallel
#include<stdio.h>

void main ()

{float a1,a2,d1,d2,e1,e2,l,s1,s2,p,t1,t2,c,m,k,L,p1,p2;

{ printf("enter the inner diameter and outer diameter of the bar in mm\n");

scanf("%f%f",&d1,&d2);

printf("enter length of bar in mm");

scanf("%f",&l);

printf(" enter the value of load in N");

scanf("%f",&p);

a1 = 0.7853*d1*d1;

printf("area a1 in mm2= %f\n", a1);

a2 =0.7853*(d2*d2- d1*d1);

printf("area a2 in mm2= %f\n", a2);

printf("enter the vaule of e1 and e2 in N/mm2");

scanf("%f%f",&e1,&e2);

t1=a1*e1;

t2=a2*e2;

m=t1/t2;

c=1+m;

p2=p/c;

p1=m*p2;

printf("the value of load p1 in N is \np1=%f\n",p1);

printf("the value of load p2 in N is \np2=%f\n",p2);

s1=p1/a1;
printf("the value of stress in first bar in N/mm2 is\ns1=%f\n",s1);

s2=p2/a2;

printf("the value of stress in second bar in N/mm2 is\ns2=%f\n",s2);

k=s1*l;

L=k/e1;

printf("the total change in length in mm is \nL=%f\n",L);

}
Problem 4 : Parallel
#include<stdio.h>

void main ()

{float a1,a2,d1,d2,d3,e1,e2,l,s1,s2,p,t1,t2,c,m,p1,p2,p3;

{ printf("enter the inner diameter and outer diameter of the copper tubeb in mm \n");

scanf("%f%f",&d2,&d3);

printf("enter the diameter of steel rod in mm");

scanf("%f",&d1);

printf("enter length of bar in mm");

scanf("%f",&l);

printf(" enter the value of load in N");

scanf("%f",&p);

a1 = 0.7853*d1*d1;

printf("area of steel bar in mm2= %f\n", a1);

a2 =0.7853*(d3*d3- d2*d2);

printf("area of copper tube in mm2= %f\n", a2);

printf("enter the vaule of e1 and e2 in N/mm2");

printf("\n e1- young modulus of steel bar ,e2-young modulus of copper tube ");

scanf("%f%f",&e1,&e2);

t1=a1*e1;

t2=a2*e2;

m=t1/t2;

c=1+m;

p2=p/c;

p1=m*p2;
p3=p-p1;

printf("load carried by steel rod inN=%f\n",p1);

printf("load carried by copper tube in N=%f\n",p3);

s1=p1/a2;

printf("Stress in steel bar in N/mm2=%f\n",s1);

s2=p2/a2;

printf("stress in copper tube in N/mm2= %f\n",s2);

}
Problem 5 : Thermal
#include <stdio.h>

void main()

{float l1,l2,Z1,Z2,gap,T,t1,t2, t3,T2,L,D1,D2,A1,A2,E1,E2,p,S1,S2,K1,K2,C1,C2,Z;

printf("enter value of l1 and l2 in mm\n");

printf("\n l1- Length of steel rod,l2-Length of copper rod");

scanf("%f",&l1);

scanf("%f",&l2);

printf("enter the value of Z1 and Z2 in per degree Celsius \n");

printf("\n Z1 - coefficient of thermal expansion of steel rod, Z2-coefficient of thermal expansion of


copper rod");

scanf("%f",&Z1);

scanf("%f",&Z2);

printf("enter the value of gap between rigid support and end of the bar in mm");

scanf("%f",&gap);

T = gap/(l1*Z1+l2*Z2);

printf("\nT = %f\n",T);

printf("enter the value of t1in degree Celsius ");

printf("\n t1 - Initial temperature ");

scanf("%f",&t1);

t2= t1+T;

printf("\nt2 = %f\n",t2);

printf("enter the value of t3 in degree Celsius ");

printf("\n t3 - Final temperature");

scanf("%f",&t3);
T2= t3-t2;

printf("\n Resultant temperature in degree Celsius = %f\n",T2);

L = l1*Z1*T2+l1*Z2*T2;

printf("\n Resultant Length = %f\n",L);

printf("enter the value of D1 in mm");

printf("\n D1- Diameter of steel rod");

scanf("%f",&D1);

A1 = 0.7853*D1*D1;

printf("\n Area of steel rod in mm2=%f\n",A1);

printf("enter the value of D2");

printf("\n D2 - Diameter of copper rod in mm");

scanf("%f",&D2);

A2 = 0.7853*D2*D2;

printf("\n Area of copper rod in mm2=%f\n",A2);

printf("enter the value of E1 and E2 in N/mm2\n");

printf("\n E1- modulus of elasticity of steel, E2- Modulus of elasticity of copper rod");

scanf("%f%f",&E1,&E2);

K1= A1*E1;

K2= A2*E2;

C1=l1/K1;

C2=l2/K2;

Z= C1+C2;

p=L/Z;

printf("force p in N= %f \n", p);

S1 = p /A1;
printf( "\n Stress in steel rod in N/mm2=%f\n",S1);

S2 = p/A2;

printf("\nS Stress in copper rod in N/mm2= %f\n",S2);

}
Problem 6 : Thermal
#include <stdio.h>

void main()

{float L,l, D, A, T1,T2,T,E,Z,S,Sy,F,Fy;

printf("enter the value of D in mm");

printf("\n D - Diameter of rod ");

scanf("%f",&D);

A=0.7853*D*D;

printf("Area of rod in mm2= %f\n",A);

printf("enter the value of L in mm");

printf("\n L - Length of rod");

scanf("%f",&L);

printf("enter the value of T1 and T2 in degree Celsius ");

printf("\nT1 - Initial temperature of rod T2 - Final temperature of rod");

scanf("%f%f",&T1,&T2);

T = T1-T2;

printf("Temperature difference =%f\n",T);

printf("enter the value of E in N/mm2");

printf("\n E - Young modulus of rod");

scanf("%f",&E);

printf("enter the value of Z in per degree Celsius ");

printf("\n Z - Coefficient of thermal expansion ");

scanf("%f",&Z);

S = Z*T*E;

printf("Stress without yield in N/mm2=%f\n",S);


F= S*A;

printf("Force without yield in N=%f\n",F);

printf("enter the value of l in mm");

printf("\n l - elongation of rod");

scanf("%f",&l);

Sy =(Z*T*L-l) *E/L;

printf("Stress with yield in N/mm2 = %f\n",Sy);

Fy = Sy*A;

printf("Force with yield in N= %f\n",Fy);

}
Problem 8 : Volumetric Strain
#include <stdio.h>

void main()

{float E, m,Px,Py,Pz,b,l,d,fx,fy,fz,k1,k2,k3,ex,ey,ez,L,B,D,ev,q,t1,t2,t3,t4,t5,t6,V;

printf("enter the value of E in N/mm2");

printf("\n E - young modulus of steel");

scanf("%f",&E);

printf("enter the value of m");

scanf("%f",& m);

printf("enter the value of Px and Py and Pz in N");

printf("\n Px - Tensile Force acting along X direction, Py - Tensile force acting along Y direction,Pz -
Compressive force acting along Z direction ");

scanf("%f%f%f",&Px, &Py, &Pz);

printf("enter the value of l and b and d in mm");

printf("\n l - length of block, b - width of block, d - depth of block");

scanf("%f%f%f",&l,&b,&d);

k1 = b*d;

k2 = l*d;

k3 = l*b;

fx = Px/k1;

printf("tensile stress in X direction in N/mm2 = %f\n",fx);

fy = Py/k2;

printf("tensile stress in Y direction in N/mm2 =%f\n",fy );

fz = Pz/k3;

printf("Compressive stress in Z direction in N/mm2 = %f\n",fz);


q = m*E;

t1 = fx/E;

t2 = fx/q;

t3 = fy/E;

t4 = fy/q;

t5 = fz/E;

t6 = fz/q;

ex = t1 - t4 + t6;

printf("strain along X direction = %f\n",ex);

ey = t3 - t2 + t6;

printf("strain along Y direction = %f\n",ey);

ez = - t5 - t2 - t4;

printf("strain along Z direction =%f\n",ez);

ev = ex + ey + ez;

printf("Volumetric strain =%f\n",ev);

L = ex * l;

printf("increase in length in mm = %f\n",L);

B = ey * b;

printf("increase in width in mm = %f\n",B);

D = ez * d;

printf("Decrease in depth in mm = %f\n",D);

V = ev*l*b*d;

printf("increse in volume in mm2 =%f\n",V);


}
Problem 9 : Volumetric Strain
#include <stdio.h>

void main()

{float E, m,Px,Py,Pz,b,l,d,fx,fy,fz,k1,k2,k3,ex,ey,ez,L,B,D,ev,q,t1,t2,t3,t4,t5,t6,V,P;

printf("enter the value of E in N/mm2");

printf("\n E - young modulus of steel");

scanf("%f",&E);

printf("enter the value of m");

scanf("%f",& m);

printf("enter the value of Px and Py and Pz in N");

printf("\n Px - Tensile Force acting along longitudinal axis, Py - Tensile force acting along lateral face Y,Pz
-tensile force acting along lateral face Z");

scanf("%f%f%f",&Px, &Py, &Pz);

printf("enter the value of l and b and d in mm");

printf("\n l - length of block, b - width of block, d - depth of block");

scanf("%f%f%f",&l,&b,&d);

k1 = b*d;

k2 = l*d;

k3 = l*b;

fx = Px/k1;

printf("tensile stress in X direction in N/mm2 = %f\n",fx);

fy = Py/k2;

printf("tensile stress in Y direction in N/mm2 =%f\n",fy );

fz = Pz/k3;

printf("Compressive stress in Z direction in N/mm2 = %f\n",fz);


q = m*E;

t1 = fx/E;

t2 = fx/q;

t3 = fy/E;

t4 = fy/q;

t5 = fz/E;

t6 = fz/q;

ex = t1 - t4 - t6;

printf("strain along X direction = %f\n",ex);

ey = t3 - t2 - t6;

printf("strain along Y direction = %f\n",ey);

ez = t5 - t2 - t4;

printf("strain along Z direction =%f\n",ez);

ev = ex + ey + ez;

printf("Volumetric strain =%f\n",ev);

L = ex * l;

printf("increase in length in mm = %f\n",L);

B = ey * b;

printf("increase in width in mm = %f\n",B);

D = ez * d;

printf("increase in depth in mm = %f\n",D);

V = ev*l*b*d;

printf("increse in volume in mm2 =%f\n",V);

P = ex*E*b*d;

printf("Longitudinal load in N =%f\n",P);


}

You might also like