武科大汽车设计上机钢板弹簧教程范本.doc

程序: #include stdio.h #include math.h float aw=500,a=0.92,s=70,E=2.1e5; float c,k,R0,Fw,fc,fa,H0,L; float L1[20],h1[20],R[20]; int n,b; FILE *save;// int radius() { float H[20],a0[20],W[20],sum=0; int i,xx; printf(Please input a0[i]=(input n numbers):\n); fprintf(save,please input a0[i]=(input n numbers):\n);// for(i=1;in+1;i++) { scanf(%f,a0[i]); W[i]=(b*h1[i]*h1[i])/6; fprintf(save,a0[%d]=%f\n,i,a0[i]); } for(i=1;in+1;i++) { R[i]=R0/(1+(2*a0[i]*R0)/(E*h1[i])); H[i]=(L1[i]*L1[i])/(8*R[i]); sum+=(a0[i]*W[i]); } for(i=1;in+1;i++) {printf(The radius of the spring R[%d] is %f and the hight of the arc H[%d] is %f\n,i,R[i],i,H[i]); fprintf(save,The radius of the spring R[%d] is %f and the hight of the arc H[%d] is %f\n,i,R[i],i,H[i]);} if((sum-50)(sum50)) {printf(a0[i] is suitable!\n); fprintf(save,a0[i] is suitable!\n); // xx=1; } else {printf(a0[i] is not appropriate,select a0[i] again\n); fprintf(save,a0[i] is not appropriate,select a0[i] again\n); // xx=0;} return(xx);} int check2() { float sum1=0,sum2=0,H1,R01; int i,yy; for(i=1;in+1;i++) {sum1+=(L1[i]/R[i]); sum2+=L1[i];} R01=sum2/sum1; H1=(L*L)/(8*R01); printf(R01=%f,The hight of the spring in total H1 is %f\n,R01,H1); fprintf(save,R01=%f,The hight of the spring in total H1 is %f\n,R01,H1);// if(fabs(H0-H1)50) {printf(a0[i] is suitable!\n); fprintf(save,a0[i] is suitable!\n); // yy=1; getchar();} else {printf(a0[i] is not appropriate, select a0[i] again\n); fprintf(save,a0[i] is not appropriate, select a0[i] again\n); // yy=0; getchar();} return(yy);} void length1() { float lb; printf(Please input the axle distance, L\n); printf(lb can be 2000~2200 ,input lb=); scanf(%f,lb); L=lb/2; printf(L=%f\n,L); fprintf(save,L=%f\n,L); } void section3() { float dr,xt,J0,J01,W0,hp,b1[5]; int flap,h,i,n1,n0; printf(Please input flap for confirm the

文档评论(0)

1亿VIP精品文档

相关文档