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

wz82 2007-08-25 10:02

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

# i nclude<stdio.h> \l"&A  
# i nclude<stdio.h> h)1qp Qj  
# i nclude<math.h> - K%,^6  
#define PI 3.1415926 ]eQV ,Vt  
void ydgl(); -7/s]9o'  
float d,am,ro,e,h,p,dt0,d0,s,ds,r,al; &mj6rIz  
int f; TSAU?r\P  
main() <H1 `  
{ printf("Determaination the prime circle of cam\n"); fP tm0.r  
  printf("----------------------------\n"); S-31-Zjw  
  printf( "input ro=");scanf("%f",&ro); -LDCBc"  
  printf("input h=");scanf("%f",&h); .6O"| Mqb  
  printf("input e=");scanf("%f",&e); y-p70.'{U  
  printf("input dt0=");scanf("%f",&dt0); {U 'd}Q  
  am=0;p=PI/180; ZvYLL{>}w  
  printf("The initial data:ro=%f\n",ro); -[= drj9I  
  printf("h=%f e=%f dt0=%f\n",h,e,dt0); 6C>_a*w  
  do ZKQ hbNT  
  {ro=ro+5; ] sz3]"2  
  for(f=0;f<=dt0;f=f+2) <PPNhf8  
  {d=PI*f/dt0; EM7+VO(  
  ydgl(); Q6o(']0  
  } E^GHVt/.  
  } V._6=ZJ  
  while(am>30*p); T5Q{{@Q  
  printf("The intermediate results: am=%f\n",am/p); @prG%vb"  
  printf("ro=%f\n",ro); B63pgPX  
  do 8ul&x~2;X  
  {ro=ro-1; ml@2wGyf  
  if(ro<e) Wv__ wZ  
  break; \;VhYvEH  
<APB11  
  for(f=0;f<=dt0;f=f+2) B!gGK|8  
  {d=PI*f/dt0; t1VH doNN  
  ydgl(); i>EgG5iJ  
  } WwC 5!kZ  
  } cPgfTT  
  while((am>30*p)||(am<=29.5*p)); f<+ 4rHT  
  printf("The final results:max alfa=%f\n",am/p); Ggh.dZI4  
  printf(" min ro=%f\n",ro); th6+2&B6  
  getch(); kc7lc|'z  
  } =#mTfJ   
  void ydgl() |AlR^N  
  {  d0=dt0*p; LPG`^SA  
  s=0.5*h*(1-cos(d)); V{|}}b?w?  
  ds=0.5*h*PI*sin(d)/d0; k3+e;[My+  
  r=sqrt(ro*ro-e*e); AtR?J"3E  
  if((s+r)==0) }SIGPVM  
  return; }M1sksk5  
  al=atan((ds-e)/(s+r)); bs9aE< j  
      if(al>am) e*+F pW@  
      am=al; o!:8nXw  
      }
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 网站统计