From last two days; I was writing a CPP Program to solve Problem of Design of Knuckle Joint - Machine Design Subject.
I am really happy to write this program. I would like to say thank to Prof. C.K. Vhare sir for his valuable guidance. Because there was big gap after my graduation. Prof. C.K. Vhare sir guided me to write this program. To write a program you should have analytical skills i.e. formulae with you.
Design procedure is also important then logic to get parameters at the last.
/*
Version 2:
where values of a and b are approximated as per Machine Design Book (V.B. Bhandari).
and stress at fork are calculated and safety of design is checked at fork too.
*/
/*
/*
Version 3:
/*
It is required to desing a knuckle Joint to connect two circular rods
subjected to an axial tensile for 50 kN. The rods are co-axial small amount
of angular moment between their axis is permissible.
Take Material 30C8 (syt=400 N/mm2)
& FOS (Factor of Safety=5)
*/
#include<iostream.h>
#include<conio.h>
#include<math.h>
class kj
{
private:
float P,syt,syc,fos,sigmat,sigmac,tau,sys,A,D,pi,D1,a,b,dop,d1,dpindia;
float pk,sigmab;
float dpindia1;
float dpindia2;
int dpindiainti2,dpindiainti1;
float sigmateye,sigmaceye,taueye;
int Dinti;
public:
void input();
void sigmat_fun();
void sigmac_fun();
void tau_fun();
void D_fun();
void D1_fun();
void ab_fun();
void dpindia_fun();
void dop_fun();
void d1_fun();
void sigmateye_fun();
void sigmaceye_fun();
void taueye_fun();
void output();
};
void kj::input()
{
cout<<"\n -----------------------------------------------------";
cout<<"\n Desing of Knuckle Joint";
cout<<"\n -----------------------------------------------------";
cout<<"\n Please enter Tensile Force (in kN)=";
cin>>pk;
cout<<"\n Please enter Ultimate Tensile Strength (in N/mm2)=";
cin>>syt;
cout<<"\n Please enter Factor of Safety=";
cin>>fos;
cout<<"\n -----------------------------------------------------";
}
void kj :: sigmat_fun()
{
sigmat=syt/fos;
cout<<"\n Permissible Tensile Stres (sigmat)="<<sigmat<<" N/mm2";
}
void kj::sigmac_fun()
{
syc=syt; //As per max. principal stress syt=syc
sigmac=syc/fos;
cout<<"\n Compressive Stress (sigmac)="<<sigmac<<" N/mm2";
}
void kj::tau_fun()
{
sys=0.5*syt;
tau=sys/fos;
cout<<"\n Shear Stress (tau)="<<tau<<" N/mm2";
}
void kj::D_fun()
{
pi=3.14;
P=pk*1000;
D=sqrt((4*P)/(pi*sigmat));
cout<<"\n Diameter of each rod="<<D<<" in mm";
Dinti=D;
cout<<"\n Dinti"<<Dinti;
if(Dinti%2==0)
{
D=Dinti+2;
}
else
{
D=Dinti+1;
}
cout<<"\n Converting Diameter of each rod="<<D<<" in mm";
}
void kj::D1_fun()
{
D1=1.1*D;
cout<<"\n By impirical ralationship";
cout<<"\n Enlarged Diameter of each rod D1="<<D1<<" in mm";
}
void kj::ab_fun()
{
a=0.75*D;
b=1.25*D;
cout<<"\n By impirical ralationship";
cout<<"\n a="<<a<<" in mm";
cout<<"\n b="<<b<<" in mm";
}
void kj::dpindia_fun()
{
dpindia=sqrt((2*P)/(pi*tau));
cout<<"\n Diameter of Pin (dpindia)="<<dpindia<<" in mm";
dpindiainti1=dpindia;
if(dpindiainti1%2==0)
{
dpindia1=dpindiainti1+2;
}
else
{
dpindia1=dpindiainti1+1;
}
cout<<"\n Converting Diameter of pin (dpindia1)="<<dpindia1<<" in mm";
//OR
sigmab=sigmat; //as sigmab is not given.
dpindia2=pow((((32.0/(pi*sigmab))*((P/2.0)*((b/4.0)+(a/3.0))))),1.0/3.0);
cout<<"\n Diameter of pin (dpindia2)="<<dpindia2<<" in mm";
dpindiainti2=dpindia2;
if(dpindiainti2%2==0)
{
dpindia2=dpindiainti2+2;
}
else
{
dpindia2=dpindiainti2+1;
}
cout<<"\n Converting Diameter of pin (dpindia2)="<<dpindia2<<" in mm";
//which one is greater dpindia1, dpindia2
if(dpindia2>dpindia1)
{
dpindia=dpindia2;
}
else if(dpindia2<dpindia1)
{
dpindia=dpindia1;
}
cout<<"\n Final Diameter of Pin="<<dpindia<<" in mm";
}
void kj::dop_fun()
{
dop=2*dpindia;
cout<<"\n Outside diameter of eye or fork="<<dop<<" in mm";
}
void kj::d1_fun()
{
d1=1.5*dpindia;
cout<<"\n Diameter of pin head="<<d1<<" in mm";
}
void kj::sigmateye_fun()
{
sigmateye=(P)/((dop-dpindia)*b);
cout<<"\n sigmateye="<<sigmateye<<" in N/mm2";
if(sigmateye<sigmat)
{
cout<<" As sigmateye<sigmat";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::sigmaceye_fun()
{
sigmaceye=P/(b*dpindia);
cout<<"\n sigmaceye="<<sigmaceye<<" in N/mm2";
if(sigmaceye<sigmac)
{
cout<<" As sigmaceye<sigmac";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::taueye_fun()
{
taueye=(P/((dop-dpindia)*b));
cout<<"\n taueye="<<taueye<<" in N/mm2";
if(taueye<tau)
{
cout<<" As taueye<tau";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::output()
{
cout<<"\n Permissible Tensile Stres (sigmat)="<<sigmat<<" N/mm2";
cout<<"\n Compressive Stress (sigmac)="<<sigmac<<" N/mm2";
cout<<"\n Shear Stress (tau)="<<tau<<" N/mm2";
cout<<"\n Diameter of each rod (D)="<<D<<" in mm";
cout<<"\n Converting Diameter of each rod (D)="<<D<<" in mm";
cout<<"\n By impirical ralationship";
cout<<"\n Enlarged Diameter of each rod (D1)="<<D1<<" in mm";
cout<<"\n By impirical ralationship";
cout<<"\n Value of a="<<a<<" in mm";
cout<<"\n value of b="<<b<<" in mm";
cout<<"\n Converting Diameter of pin (dpindia1) Method1="<<dpindia1<<" in mm";
cout<<"\n Converting Diameter of pin (dpindia2) Method2="<<dpindia2<<" in mm";
cout<<"\n Final Diameter of Pin (d)="<<dpindia<<" in mm";
cout<<"\n Outside diameter of eye or fork (dop/do)="<<dop<<" in mm";
cout<<"\n Diameter of pin head (d1)="<<d1<<" in mm";
}
void main()
{
clrscr();
kj obj;
obj.input();
obj.sigmat_fun();
obj.sigmac_fun();
obj.tau_fun();
obj.D_fun();
obj.D1_fun();
obj.ab_fun();
obj.dpindia_fun();
obj.dop_fun();
obj.d1_fun();
clrscr();
cout<<"\n -----------------------------------------------------";
obj.output();
cout<<"\n -----------------------------------------------------";
obj.sigmateye_fun();
obj.sigmaceye_fun();
obj.taueye_fun();
getch();
}
/*
Output
-----------------------------------------------------
Desing of Knuckle Joint";
-----------------------------------------------------
Please enter Tensile Force (in kN)=50
Please enter Ultimate Tensile Strength (in N/mm2)=400
Please enter Factor of Safety=5
-----------------------------------------------------
-----------------------------------------------------
Permissible Tensile Stres (sigmat)=80 N/mm2
Compressive Stress (sigmac)=80 N/mm2
Shear Stress (tau)=40 N/mm2
Diameter of each rod (D)=30 in mm
Converting Diameter of each rod (D)=30 in mm
By impirical ralationship
Enlarged Diameter of each rod (D1)=33 in mm
By impirical ralationship
Value of a=22.5 in mm
value of b=37.5 in mm
Converting Diameter of pin (dpindia1) Method1=30 in mm
Converting Diameter of pin (dpindia2) Method2=38 in mm
Final Diameter of Pin (d)=38 in mm
Outside diameter of eye or fork (dop/do)=76 in mm
Diameter of pin head (d1)=57 in mm
-----------------------------------------------------
sigmateye=35.087719 in N/mm2 As sigmateye<sigmat The Design is safe!!!
sigmaceye=35.087719 in N/mm2 As sigmaceye<sigmac The Design is safe!!!
taueye=35.087719 in N/mm2 As taueye<tau The Design is safe!!!
*/
Output Screen:
/*
Version 2:
where values of a and b are approximated as per Machine Design Book (V.B. Bhandari).
and stress at fork are calculated and safety of design is checked at fork too.
*/
/*
It is required to desing a knuckle Joint to connect two circular rods
subjected to an axial tensile for 50 kN. The rods are co-axial small amount
of angular moment between their axis is permissible.
Take Material 30C8 (syt=400 N/mm2)
& FOS (Factor of Safety=5)
Note:FOS is always greater than 1.
*/
#include<iostream.h>
#include<conio.h>
#include<math.h>
class kj
{
private:
float P,syt,syc,fos,sigmat,sigmac,tau,sys,A,D,pi,D1,a,b,dop,d1,dpindia;
float pk,sigmab;
float dpindia1;
float dpindia2;
int dpindiainti2,dpindiainti1;
int ainti,binti;
int arinti,brinti;
int addfactora,addfactorb;
float sigmateye,sigmaceye,taueye;
float sigmatfork,sigmacfork,taufork;
int Dinti;
public:
void input();
void sigmat_fun();
void sigmac_fun();
void tau_fun();
void D_fun();
void D1_fun();
void ab_fun();
void dpindia_fun();
void dop_fun();
void d1_fun();
void sigmateye_fun();
void sigmaceye_fun();
void taueye_fun();
void sigmatfork_fun();
void sigmacfork_fun();
void taufork_fun();
void output();
};
void kj::input()
{
cout<<"\n -----------------------------------------------------";
cout<<"\n Desing of Knuckle Joint";
cout<<"\n -----------------------------------------------------";
cout<<"\n Please enter Tensile Force (in kN)=";
cin>>pk;
cout<<"\n Please enter Ultimate Tensile Strength (in N/mm2)=";
cin>>syt;
cout<<"\n Please enter Factor of Safety=";
cin>>fos;
cout<<"\n -----------------------------------------------------";
}
void kj :: sigmat_fun()
{
sigmat=syt/fos;
cout<<"\n Permissible Tensile Stres (sigmat)="<<sigmat<<" N/mm2";
}
void kj::sigmac_fun()
{
syc=syt; //As per max. principal stress syt=syc
sigmac=syc/fos;
cout<<"\n Compressive Stress (sigmac)="<<sigmac<<" N/mm2";
}
void kj::tau_fun()
{
sys=0.5*syt;
tau=sys/fos;
cout<<"\n Shear Stress (tau)="<<tau<<" N/mm2";
}
void kj::D_fun()
{
pi=3.14;
P=pk*1000;
D=sqrt((4*P)/(pi*sigmat));
cout<<"\n Diameter of each rod="<<D<<" in mm";
Dinti=D;
cout<<"\n Dinti"<<Dinti;
if(Dinti%2==0)
{
D=Dinti+2;
}
else
{
D=Dinti+1;
}
cout<<"\n Converting Diameter of each rod="<<D<<" in mm";
}
void kj::D1_fun()
{
D1=1.1*D;
cout<<"\n By impirical ralationship";
cout<<"\n Enlarged Diameter of each rod D1="<<D1<<" in mm";
}
void kj::ab_fun()
{
a=0.75*D;
b=1.25*D;
cout<<"\n By impirical ralationship";
cout<<"\n a="<<a<<" in mm";
cout<<"\n b="<<b<<" in mm";
ainti=a;
binti=b;
arinti=ainti%10;
brinti=binti%10;
/*cout<<"\n a="<<arinti<<" in mm";
cout<<"\n b="<<brinti<<" in mm";*/
if(arinti>=1&&arinti<=4)
{
addfactora=5-arinti;
a=ainti+addfactora;
}
if(brinti>=6&&brinti<=9)
{
addfactorb=10-brinti;
b=binti+addfactorb;
}
}
void kj::dpindia_fun()
{
dpindia=sqrt((2*P)/(pi*tau));
cout<<"\n Diameter of Pin (dpindia)="<<dpindia<<" in mm";
dpindiainti1=dpindia;
if(dpindiainti1%2==0)
{
dpindia1=dpindiainti1+2;
}
else
{
dpindia1=dpindiainti1+1;
}
cout<<"\n Converting Diameter of pin (dpindia1)="<<dpindia1<<" in mm";
//OR
sigmab=sigmat; //as sigmab is not given.
dpindia2=pow((((32.0/(pi*sigmab))*((P/2.0)*((b/4.0)+(a/3.0))))),1.0/3.0);
cout<<"\n Diameter of pin (dpindia2)="<<dpindia2<<" in mm";
dpindiainti2=dpindia2;
if(dpindiainti2%2==0)
{
dpindia2=dpindiainti2+2;
}
else
{
dpindia2=dpindiainti2+1;
}
cout<<"\n Converting Diameter of pin (dpindia2)="<<dpindia2<<" in mm";
//which one is greater dpindia1, dpindia2
if(dpindia2>dpindia1)
{
dpindia=dpindia2;
}
else if(dpindia2<dpindia1)
{
dpindia=dpindia1;
}
cout<<"\n Final Diameter of Pin="<<dpindia<<" in mm";
}
void kj::dop_fun()
{
dop=2*dpindia;
cout<<"\n Outside diameter of eye or fork="<<dop<<" in mm";
}
void kj::d1_fun()
{
d1=1.5*dpindia;
cout<<"\n Diameter of pin head="<<d1<<" in mm";
}
void kj::sigmateye_fun()
{
sigmateye=(P)/((dop-dpindia)*b);
cout<<"\n sigmateye="<<sigmateye<<" in N/mm2";
if(sigmateye<sigmat)
{
cout<<" As sigmateye<sigmat";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::sigmaceye_fun()
{
sigmaceye=P/(b*dpindia);
cout<<"\n sigmaceye="<<sigmaceye<<" in N/mm2";
if(sigmaceye<sigmac)
{
cout<<" As sigmaceye<sigmac";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::taueye_fun()
{
taueye=(P/((dop-dpindia)*b));
cout<<"\n taueye="<<taueye<<" in N/mm2";
if(taueye<tau)
{
cout<<" As taueye<tau";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::sigmatfork_fun()
{
sigmatfork=(P)/((dop-dpindia)*2*a);
cout<<"\n sigmatfork="<<sigmatfork<<" in N/mm2";
if(sigmatfork<sigmat)
{
cout<<" As sigmatfork<sigmat";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::sigmacfork_fun()
{
sigmacfork=P/(2*a*dpindia);
cout<<"\n sigmacfork="<<sigmacfork<<" in N/mm2";
if(sigmacfork<sigmac)
{
cout<<" As sigmacfork<sigmac";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::taufork_fun()
{
taufork=(P/((dop-dpindia)*2*a));
cout<<"\n taufork="<<taufork<<" in N/mm2";
if(taufork<tau)
{
cout<<" As taufork<tau";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::output()
{
cout<<"\n Permissible Tensile Stres (sigmat)="<<sigmat<<" N/mm2";
cout<<"\n Compressive Stress (sigmac)="<<sigmac<<" N/mm2";
cout<<"\n Shear Stress (tau)="<<tau<<" N/mm2";
cout<<"\n Diameter of each rod (D)="<<D<<" in mm";
cout<<"\n Converting Diameter of each rod (D)="<<D<<" in mm";
cout<<"\n By impirical ralationship";
cout<<"\n Enlarged Diameter of each rod (D1)="<<D1<<" in mm";
cout<<"\n By impirical ralationship";
cout<<"\n Value of a="<<a<<" in mm";
cout<<"\n value of b="<<b<<" in mm";
cout<<"\n Converting Diameter of pin (dpindia1) Method1="<<dpindia1<<" in mm";
cout<<"\n Converting Diameter of pin (dpindia2) Method2="<<dpindia2<<" in mm";
cout<<"\n Final Diameter of Pin (d)="<<dpindia<<" in mm";
cout<<"\n Outside diameter of eye or fork (dop/do)="<<dop<<" in mm";
cout<<"\n Diameter of pin head (d1)="<<d1<<" in mm";
/*cout<<"\n ainti="<<ainti<<" in mm";
cout<<"\n binti="<<binti<<" in mm";
cout<<"\n arinti="<<arinti<<" in mm";*/
}
void main()
{
clrscr();
kj obj;
obj.input();
obj.sigmat_fun();
obj.sigmac_fun();
obj.tau_fun();
obj.D_fun();
obj.D1_fun();
obj.ab_fun();
obj.dpindia_fun();
obj.dop_fun();
obj.d1_fun();
clrscr();
cout<<"\n -----------------------------------------------------";
obj.output();
cout<<"\n -----------------------------------------------------";
//at eye
cout<<"\n Stresses in eye:";
obj.sigmateye_fun();
obj.sigmaceye_fun();
obj.taueye_fun();
//at fork
cout<<"\n Stresses in fork:";
obj.sigmatfork_fun();
obj.sigmacfork_fun();
obj.taufork_fun();
getch();
}
/*
output:
-----------------------------------------------------
Permissible Tensile Stres (sigmat)=80 N/mm2
Compressive Stress (sigmac)=80 N/mm2
Shear Stress (tau)=40 N/mm2
Diameter of each rod (D)=30 in mm
Converting Diameter of each rod (D)=30 in mm
By impirical ralationship
Enlarged Diameter of each rod (D1)=33 in mm
By impirical ralationship
Value of a=25 in mm
value of b=40 in mm
Converting Diameter of pin (dpindia1) Method1=30 in mm
Converting Diameter of pin (dpindia2) Method2=40 in mm
Final Diameter of Pin (d)=40 in mm
Outside diameter of eye or fork (dop/do)=80 in mm
Diameter of pin head (d1)=60 in mm
-----------------------------------------------------
Stresses in eye:
sigmateye=31.25 in N/mm2 As sigmateye<sigmat The Design is safe!!!
sigmaceye=31.25 in N/mm2 As sigmaceye<sigmac The Design is safe!!!
taueye=31.25 in N/mm2 As taueye<tau The Design is safe!!!
Stresses in fork:
sigmatfork=25 in N/mm2 As sigmatfork<sigmat The Design is safe!!!
sigmacfork=25 in N/mm2 As sigmacfork<sigmac The Design is safe!!!
taufork=25 in N/mm2 As taufork<tau The Design is safe!!!
*/
/*
Version 3:
2 more conditions which were missing from my side have been added for designing values of a and b.
Version 3: With Great accuracy and adding two more conditions
That code has been written in black color below:
*/
/*
Version 3:
It is required to desing a knuckle Joint to connect two circular rods
subjected to an axial tensile for 50 kN. The rods are co-axial small amount
of angular moment between their axis is permissible.
Take Material 30C8 (syt=400 N/mm2)
& FOS (Factor of Safety=5)
Note:FOS is always greater than 1.
*/
#include<iostream.h>
#include<conio.h>
#include<math.h>
class kj
{
private:
float P,syt,syc,fos,sigmat,sigmac,tau,sys,A,D,pi,D1,a,b,dop,d1,dpindia;
float pk,sigmab;
float dpindia1;
float dpindia2;
int dpindiainti2,dpindiainti1;
int ainti,binti;
int arinti,brinti;
int addfactora,addfactorb;
float sigmateye,sigmaceye,taueye;
float sigmatfork,sigmacfork,taufork;
int Dinti;
public:
void input();
void sigmat_fun();
void sigmac_fun();
void tau_fun();
void D_fun();
void D1_fun();
void ab_fun();
void dpindia_fun();
void dop_fun();
void d1_fun();
void sigmateye_fun();
void sigmaceye_fun();
void taueye_fun();
void sigmatfork_fun();
void sigmacfork_fun();
void taufork_fun();
void output();
};
void kj::input()
{
cout<<"\n -----------------------------------------------------";
cout<<"\n Desing of Knuckle Joint";
cout<<"\n -----------------------------------------------------";
cout<<"\n Please enter Tensile Force (in kN)=";
cin>>pk;
cout<<"\n Please enter Ultimate Tensile Strength (in N/mm2)=";
cin>>syt;
cout<<"\n Please enter Factor of Safety=";
cin>>fos;
cout<<"\n -----------------------------------------------------";
}
void kj :: sigmat_fun()
{
sigmat=syt/fos;
cout<<"\n Permissible Tensile Stres (sigmat)="<<sigmat<<" N/mm2";
}
void kj::sigmac_fun()
{
syc=syt; //As per max. principal stress syt=syc
sigmac=syc/fos;
cout<<"\n Compressive Stress (sigmac)="<<sigmac<<" N/mm2";
}
void kj::tau_fun()
{
sys=0.5*syt;
tau=sys/fos;
cout<<"\n Shear Stress (tau)="<<tau<<" N/mm2";
}
void kj::D_fun()
{
pi=3.14;
P=pk*1000;
D=sqrt((4*P)/(pi*sigmat));
cout<<"\n Diameter of each rod="<<D<<" in mm";
Dinti=D;
cout<<"\n Dinti"<<Dinti;
if(Dinti%2==0)
{
D=Dinti+2;
}
else
{
D=Dinti+1;
}
cout<<"\n Converting Diameter of each rod="<<D<<" in mm";
}
void kj::D1_fun()
{
D1=1.1*D;
cout<<"\n By impirical ralationship";
cout<<"\n Enlarged Diameter of each rod D1="<<D1<<" in mm";
}
void kj::ab_fun()
{
a=0.75*D;
b=1.25*D;
cout<<"\n By impirical ralationship";
cout<<"\n a="<<a<<" in mm";
cout<<"\n b="<<b<<" in mm";
ainti=a;
binti=b;
arinti=ainti%10;
brinti=binti%10;
/*cout<<"\n a="<<arinti<<" in mm";
cout<<"\n b="<<brinti<<" in mm";*/
if(arinti>=1&&arinti<=4)
{
addfactora=5-arinti;
a=ainti+addfactora;
}
else if(arinti>=6&&arinti<=9)
{
addfactora=10-arinti;
a=ainti+addfactora;
}
if(brinti>=6&&brinti<=9)
{
addfactorb=10-brinti;
b=binti+addfactorb;
}
else if(brinti>=1&&brinti<=4)
{
addfactorb=5-brinti;
b=binti+addfactorb;
}
}
void kj::dpindia_fun()
{
dpindia=sqrt((2*P)/(pi*tau));
cout<<"\n Diameter of Pin (dpindia)="<<dpindia<<" in mm";
dpindiainti1=dpindia;
if(dpindiainti1%2==0)
{
dpindia1=dpindiainti1+2;
}
else
{
dpindia1=dpindiainti1+1;
}
cout<<"\n Converting Diameter of pin (dpindia1)="<<dpindia1<<" in mm";
//OR
sigmab=sigmat; //as sigmab is not given.
dpindia2=pow((((32.0/(pi*sigmab))*((P/2.0)*((b/4.0)+(a/3.0))))),1.0/3.0);
cout<<"\n Diameter of pin (dpindia2)="<<dpindia2<<" in mm";
dpindiainti2=dpindia2;
if(dpindiainti2%2==0)
{
dpindia2=dpindiainti2+2;
}
else
{
dpindia2=dpindiainti2+1;
}
cout<<"\n Converting Diameter of pin (dpindia2)="<<dpindia2<<" in mm";
//which one is greater dpindia1, dpindia2
if(dpindia2>dpindia1)
{
dpindia=dpindia2;
}
else if(dpindia2<dpindia1)
{
dpindia=dpindia1;
}
cout<<"\n Final Diameter of Pin="<<dpindia<<" in mm";
}
void kj::dop_fun()
{
dop=2*dpindia;
cout<<"\n Outside diameter of eye or fork="<<dop<<" in mm";
}
void kj::d1_fun()
{
d1=1.5*dpindia;
cout<<"\n Diameter of pin head="<<d1<<" in mm";
}
void kj::sigmateye_fun()
{
sigmateye=(P)/((dop-dpindia)*b);
cout<<"\n sigmateye="<<sigmateye<<" in N/mm2";
if(sigmateye<sigmat)
{
cout<<" As sigmateye<sigmat";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::sigmaceye_fun()
{
sigmaceye=P/(b*dpindia);
cout<<"\n sigmaceye="<<sigmaceye<<" in N/mm2";
if(sigmaceye<sigmac)
{
cout<<" As sigmaceye<sigmac";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::taueye_fun()
{
taueye=(P/((dop-dpindia)*b));
cout<<"\n taueye="<<taueye<<" in N/mm2";
if(taueye<tau)
{
cout<<" As taueye<tau";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::sigmatfork_fun()
{
sigmatfork=(P)/((dop-dpindia)*2*a);
cout<<"\n sigmatfork="<<sigmatfork<<" in N/mm2";
if(sigmatfork<sigmat)
{
cout<<" As sigmatfork<sigmat";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::sigmacfork_fun()
{
sigmacfork=P/(2*a*dpindia);
cout<<"\n sigmacfork="<<sigmacfork<<" in N/mm2";
if(sigmacfork<sigmac)
{
cout<<" As sigmacfork<sigmac";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::taufork_fun()
{
taufork=(P/((dop-dpindia)*2*a));
cout<<"\n taufork="<<taufork<<" in N/mm2";
if(taufork<tau)
{
cout<<" As taufork<tau";
cout<<" The Design is safe!!!";
}
else
{
cout<<" The Design is not safe!!!";
}
}
void kj::output()
{
cout<<"\n Permissible Tensile Stres (sigmat)="<<sigmat<<" N/mm2";
cout<<"\n Compressive Stress (sigmac)="<<sigmac<<" N/mm2";
cout<<"\n Shear Stress (tau)="<<tau<<" N/mm2";
cout<<"\n Diameter of each rod (D)="<<D<<" in mm";
cout<<"\n Converting Diameter of each rod (D)="<<D<<" in mm";
cout<<"\n By impirical ralationship";
cout<<"\n Enlarged Diameter of each rod (D1)="<<D1<<" in mm";
cout<<"\n By impirical ralationship";
cout<<"\n Value of a="<<a<<" in mm";
cout<<"\n value of b="<<b<<" in mm";
cout<<"\n Converting Diameter of pin (dpindia1) Method1="<<dpindia1<<" in mm";
cout<<"\n Converting Diameter of pin (dpindia2) Method2="<<dpindia2<<" in mm";
cout<<"\n Final Diameter of Pin (d)="<<dpindia<<" in mm";
cout<<"\n Outside diameter of eye or fork (dop/do)="<<dop<<" in mm";
cout<<"\n Diameter of pin head (d1)="<<d1<<" in mm";
/*cout<<"\n ainti="<<ainti<<" in mm";
cout<<"\n binti="<<binti<<" in mm";
cout<<"\n arinti="<<arinti<<" in mm";*/
}
void main()
{
clrscr();
kj obj;
obj.input();
obj.sigmat_fun();
obj.sigmac_fun();
obj.tau_fun();
obj.D_fun();
obj.D1_fun();
obj.ab_fun();
obj.dpindia_fun();
obj.dop_fun();
obj.d1_fun();
clrscr();
cout<<"\n -----------------------------------------------------";
obj.output();
cout<<"\n -----------------------------------------------------";
//at eye
cout<<"\n Stresses in eye:";
obj.sigmateye_fun();
obj.sigmaceye_fun();
obj.taueye_fun();
//at fork
cout<<"\n Stresses in fork:";
obj.sigmatfork_fun();
obj.sigmacfork_fun();
obj.taufork_fun();
getch();
}
/*
output:
-----------------------------------------------------
Permissible Tensile Stres (sigmat)=80 N/mm2
Compressive Stress (sigmac)=80 N/mm2
Shear Stress (tau)=40 N/mm2
Diameter of each rod (D)=30 in mm
Converting Diameter of each rod (D)=30 in mm
By impirical ralationship
Enlarged Diameter of each rod (D1)=33 in mm
By impirical ralationship
Value of a=25 in mm
value of b=40 in mm
Converting Diameter of pin (dpindia1) Method1=30 in mm
Converting Diameter of pin (dpindia2) Method2=40 in mm
Final Diameter of Pin (d)=40 in mm
Outside diameter of eye or fork (dop/do)=80 in mm
Diameter of pin head (d1)=60 in mm
-----------------------------------------------------
Stresses in eye:
sigmateye=31.25 in N/mm2 As sigmateye<sigmat The Design is safe!!!
sigmaceye=31.25 in N/mm2 As sigmaceye<sigmac The Design is safe!!!
taueye=31.25 in N/mm2 As taueye<tau The Design is safe!!!
Stresses in fork:
sigmatfork=25 in N/mm2 As sigmatfork<sigmat The Design is safe!!!
sigmacfork=25 in N/mm2 As sigmacfork<sigmac The Design is safe!!!
taueye=25 in N/mm2 As taufork<tau The Design is safe!!!
*/
#sdbhosale
No comments:
Post a Comment