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

wz82 2007-08-25 10:02

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

# i nclude<stdio.h> PP],HB+*[  
# i nclude<stdio.h> *!i,?vn  
# i nclude<math.h> <o ~t$TH  
#define PI 3.1415926 p%tE v  
void ydgl(); $.``OxJk%  
float d,am,ro,e,h,p,dt0,d0,s,ds,r,al; Shs')Zs bv  
int f; C0gfJ~M )  
main() X=JFWzC  
{ printf("Determaination the prime circle of cam\n"); Qg[heND  
  printf("----------------------------\n"); > CH  
  printf( "input ro=");scanf("%f",&ro); .l7j8 }  
  printf("input h=");scanf("%f",&h); hr%U>U9F  
  printf("input e=");scanf("%f",&e); &<`-:x12_  
  printf("input dt0=");scanf("%f",&dt0); aXX,Zu^  
  am=0;p=PI/180; y?"$(%3|  
  printf("The initial data:ro=%f\n",ro); YXgWH'i~  
  printf("h=%f e=%f dt0=%f\n",h,e,dt0); :,jPNuOA  
  do DQ%`v =  
  {ro=ro+5; UE\%e9<l  
  for(f=0;f<=dt0;f=f+2) N`f!D>b:dn  
  {d=PI*f/dt0; KuIkul9^%  
  ydgl(); h|K\z{ A  
  } :DDO=  
  } Ob7zu"zr  
  while(am>30*p); C?8PT/  
  printf("The intermediate results: am=%f\n",am/p); O5u cI$s  
  printf("ro=%f\n",ro); m\_+)eI|  
  do LFl2uV"  
  {ro=ro-1; *@CVYJ'<  
  if(ro<e) !&qx7eOSpP  
  break; +d.u##$  
Rk}\)r\  
  for(f=0;f<=dt0;f=f+2) W&HF?w}s  
  {d=PI*f/dt0; ,<7"K&  
  ydgl(); f+{c1fb>s  
  } qi( &8in  
  } {F<)z% ^  
  while((am>30*p)||(am<=29.5*p)); \)FeuLGL9  
  printf("The final results:max alfa=%f\n",am/p); t-'I`I  
  printf(" min ro=%f\n",ro); Jw2B&)k/  
  getch(); k&WUv0  
  } 5P-K *C&  
  void ydgl() c]GQU  
  {  d0=dt0*p; >/(i3)  
  s=0.5*h*(1-cos(d)); &,^mM' C  
  ds=0.5*h*PI*sin(d)/d0; h1n*WQ-  
  r=sqrt(ro*ro-e*e); n>u.3w L  
  if((s+r)==0) G%xb0%oi]%  
  return; g7 .7E6%H  
  al=atan((ds-e)/(s+r)); N<p5p0  
      if(al>am) sGXp}{E9  
      am=al;  fn4=  
      }
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 网站统计