首页 -> 登录 -> 注册 -> 回复主题 -> 发表主题
光行天下 -> 机械设计,制造及其自动化 -> 机械原理课程设计程序 - 凸轮设计部分 [点此返回论坛查看本帖完整版本] [打印本页]

wz82 2007-08-25 10:02

机械原理课程设计程序 - 凸轮设计部分

# i nclude<stdio.h> aN(|'uO@  
# i nclude<stdio.h> .H,xle  
# i nclude<math.h> 6d+p7x  
#define PI 3.1415926 t]X w{)T  
void ydgl(); K(q-?n`<  
float d,am,ro,e,h,p,dt0,d0,s,ds,r,al; <I"S#M7-s  
int f; `7H4Y&E  
main() MeUaTJFEB  
{ printf("Determaination the prime circle of cam\n"); |2KAo!PI  
  printf("----------------------------\n"); <jed!x  
  printf( "input ro=");scanf("%f",&ro); + T8B:  
  printf("input h=");scanf("%f",&h); ,*7d  
  printf("input e=");scanf("%f",&e); Ge<nxl<Bd  
  printf("input dt0=");scanf("%f",&dt0); vv=VRhwF  
  am=0;p=PI/180; GaSPJt   
  printf("The initial data:ro=%f\n",ro);  @Pt="*g  
  printf("h=%f e=%f dt0=%f\n",h,e,dt0); H@l}WihW  
  do rl0<Ls  
  {ro=ro+5; B,{K*-7)MX  
  for(f=0;f<=dt0;f=f+2) -I=l8m6L  
  {d=PI*f/dt0; t#2(j1  
  ydgl(); HF(KN{0.B  
  } 9*a=iL*Nw  
  } :kGU,>BN  
  while(am>30*p); Q f@  
  printf("The intermediate results: am=%f\n",am/p); 0tU.(  
  printf("ro=%f\n",ro); !o$!Frc  
  do [p<w._b i  
  {ro=ro-1; 0'IBN}  
  if(ro<e) Phke`3tth  
  break; f;b[w   
h*v8#\b$J_  
  for(f=0;f<=dt0;f=f+2) nvPwngEQm  
  {d=PI*f/dt0;  =kuMWaD  
  ydgl(); )P+7PhE{J  
  } 8-O)Xx}cU  
  } *M"}z  
  while((am>30*p)||(am<=29.5*p)); )6aAB|  
  printf("The final results:max alfa=%f\n",am/p); BT(CM,bp  
  printf(" min ro=%f\n",ro); rvw)-=qR[  
  getch(); s)pbS}L  
  } CvD "sHVq%  
  void ydgl() ~sXcnxLz  
  {  d0=dt0*p; }+sT4'Ah>  
  s=0.5*h*(1-cos(d)); O<V4HUW  
  ds=0.5*h*PI*sin(d)/d0; R47\Y  
  r=sqrt(ro*ro-e*e); 0vw4?>Jf@  
  if((s+r)==0) :eCU/BC4  
  return; q*9!,!e  
  al=atan((ds-e)/(s+r)); ~Rr~1I&mR,  
      if(al>am) q7E~+p(>(  
      am=al; (I./ Uu%  
      }
2iso 2008-04-13 06:19
Thanks
lengyuquan 2008-05-29 11:14
你好 还有没关于机械原理程序设计的代码啊! 课程设计老师让我们用编程作,帮帮忙!!能发到我邮箱吗?lengyu.nan@163.com
ziqiangbux 2009-06-26 10:59
不对吧?????????????????
查看本帖完整版本: [-- 机械原理课程设计程序 - 凸轮设计部分 --] [-- top --]

Copyright © 2005-2026 光行天下 蜀ICP备06003254号-1 网站统计