Professional Documents
Culture Documents
Assignment No. 1
Assignment No. 1
1
NAME : KUNAL BANDUJI DUDHANKAR
PRN NO : 10303320171161210029
BATCH : B
void main()
{float L1,L2,L3,D1,D2,D3,A1,A2,A3,P,S1,S2,S3,L,e1,e2,e3,E;
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);
scanf("%f",&P);
A1= 0.7853*D1*D1;
A2=0.7853*D2*D2;
A3= 0.7853*D3*D3;
S1 = P/A1;
S2=P/A2;
S3 =P/A3;
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);
void main()
{float P1,P2,P3,P4,Pm,L1,L2,L3,l1,l2,l3,A,E,L,K,F1,F2,F3;
scanf("%f",&P1);
scanf("%f",&P3);
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;
scanf("%f",&A);
scanf("%f",&E);
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;
F2=Pm*L2;
l2=F2/K;
F3=P3*L3;
l3 = F3/K;
L = l1-l2-l3;
}
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);
scanf("%f",&l);
scanf("%f",&p);
a1 = 0.7853*d1*d1;
a2 =0.7853*(d2*d2- d1*d1);
scanf("%f%f",&e1,&e2);
t1=a1*e1;
t2=a2*e2;
m=t1/t2;
c=1+m;
p2=p/c;
p1=m*p2;
s1=p1/a1;
printf("the value of stress in first bar in N/mm2 is\ns1=%f\n",s1);
s2=p2/a2;
k=s1*l;
L=k/e1;
}
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);
scanf("%f",&d1);
scanf("%f",&l);
scanf("%f",&p);
a1 = 0.7853*d1*d1;
a2 =0.7853*(d3*d3- d2*d2);
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;
s1=p1/a2;
s2=p2/a2;
}
Problem 5 : Thermal
#include <stdio.h>
void main()
scanf("%f",&l1);
scanf("%f",&l2);
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);
scanf("%f",&t1);
t2= t1+T;
printf("\nt2 = %f\n",t2);
scanf("%f",&t3);
T2= t3-t2;
L = l1*Z1*T2+l1*Z2*T2;
scanf("%f",&D1);
A1 = 0.7853*D1*D1;
scanf("%f",&D2);
A2 = 0.7853*D2*D2;
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;
S1 = p /A1;
printf( "\n Stress in steel rod in N/mm2=%f\n",S1);
S2 = p/A2;
}
Problem 6 : Thermal
#include <stdio.h>
void main()
scanf("%f",&D);
A=0.7853*D*D;
scanf("%f",&L);
scanf("%f%f",&T1,&T2);
T = T1-T2;
scanf("%f",&E);
scanf("%f",&Z);
S = Z*T*E;
scanf("%f",&l);
Sy =(Z*T*L-l) *E/L;
Fy = Sy*A;
}
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;
scanf("%f",&E);
scanf("%f",& m);
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",&l,&b,&d);
k1 = b*d;
k2 = l*d;
k3 = l*b;
fx = Px/k1;
fy = Py/k2;
fz = Pz/k3;
t1 = fx/E;
t2 = fx/q;
t3 = fy/E;
t4 = fy/q;
t5 = fz/E;
t6 = fz/q;
ex = t1 - t4 + t6;
ey = t3 - t2 + t6;
ez = - t5 - t2 - t4;
ev = ex + ey + ez;
L = ex * l;
B = ey * b;
D = ez * d;
V = ev*l*b*d;
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;
scanf("%f",&E);
scanf("%f",& m);
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",&l,&b,&d);
k1 = b*d;
k2 = l*d;
k3 = l*b;
fx = Px/k1;
fy = Py/k2;
fz = Pz/k3;
t1 = fx/E;
t2 = fx/q;
t3 = fy/E;
t4 = fy/q;
t5 = fz/E;
t6 = fz/q;
ex = t1 - t4 - t6;
ey = t3 - t2 - t6;
ez = t5 - t2 - t4;
ev = ex + ey + ez;
L = ex * l;
B = ey * b;
D = ez * d;
V = ev*l*b*d;
P = ex*E*b*d;