武科大汽车设计上机钢板弹簧_第1页
武科大汽车设计上机钢板弹簧_第2页
武科大汽车设计上机钢板弹簧_第3页
武科大汽车设计上机钢板弹簧_第4页
武科大汽车设计上机钢板弹簧_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、程序:#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 L120,h120,R20;int n,b;FILE *save;/int radius() float H20,a020,W20,sum=0; int i,xx; printf("Please input a0i=(input n numbers):n"); fprintf(save,"please input a0i=(input

2、n numbers):n");/ for(i=1;i<n+1;i+) scanf("%f",&a0i); Wi=(b*h1i*h1i)/6; fprintf(save,"a0%d=%fn",i,a0i); for(i=1;i<n+1;i+) Ri=R0/(1+(2*a0i*R0)/(E*h1i); Hi=(L1i*L1i)/(8*Ri); sum+=(a0i*Wi); for(i=1;i<n+1;i+) printf("The radius of the spring R%d is %f and the hi

3、ght of the arc H%d is %fn",i,Ri,i,Hi); fprintf(save,"The radius of the spring R%d is %f and the hight of the arc H%d is %fn",i,Ri,i,Hi); if(sum>-50)&&(sum<50) printf("a0i is suitable!n"); fprintf(save,"a0i is suitable!n"); / xx=1; else printf("a0

4、i is not appropriate,select a0i againn"); fprintf(save,"a0i is not appropriate,select a0i againn"); / xx=0;return(xx);int check2() float sum1=0,sum2=0,H1,R01; int i,yy; for(i=1;i<n+1;i+) sum1+=(L1i/Ri); sum2+=L1i; R01=sum2/sum1; H1=(L*L)/(8*R01); printf("R01=%f,The hight of th

5、e spring in total H1 is %fn",R01,H1); fprintf(save,"R01=%f,The hight of the spring in total H1 is %fn",R01,H1);/ if(fabs(H0-H1)<50) printf("a0i is suitable!n"); fprintf(save,"a0i is suitable!n"); / yy=1; getchar(); else printf("a0i is not appropriate, selec

6、t a0i againn");fprintf(save,"a0i is not appropriate, select a0i againn"); /yy=0;getchar(); return(yy);void length1() float lb; printf("Please input the axle distance, Ln"); printf("lb can be 20002200 ,input lb="); scanf("%f",&lb); L=lb/2; printf("

7、;L=%fn",L); fprintf(save,"L=%fn",L); void section3() float dr,xt,J0,J01,W0,hp,b15; int flap,h,i,n1,n0; printf("Please input flap for confirm the value of k (if flap=0 then k=0),flap="); scanf("%d",&flap); k=(flap=0)?0:0.5; c=Fw/fc; printf("c=%fn",c);

8、n1=2; printf("Please estimate n0 and input n0="); scanf("%d",&n0); fprintf(save,"n0=%dn",n0);/ xt=(float)n1/n0; dr=1.5/(1.04*(1+0.5*xt); J0=(L-k*s)*(L-k*s)*(L-k*s)*c*dr/(48*E); W0=Fw*(L-k*s)/(4*aw); hp=2*J0/W0; printf("hp=%fn",hp); fprintf(save,"hp=%f

9、n",hp); for(i=0;i<5;i+) b1i=(i+6)*hp*1.3; for(i=0;i<5;i+) printf("b1%d=%fn",i,b1i); fprintf(save,"b1%d=%fn",i,b1i); printf("Please convert b1i into a integar,and it's value can be 63,65,70n"); printf("Select a value and give it to b,input b=");

10、scanf("%d",&b); printf("h can be 6,7 or 8,please select h="); scanf("%d",&h); fprintf(save,"b=%d,h=%dn",b,h);/ J01=n0*(float)b*(h*h*h)/12; printf("The value of J0 is %fn",J0); fprintf(save,"The value of J0 is %fn",J0); / printf(&quo

11、t;The value of W0 is %fn",W0); fprintf(save,"The value of W0 is %fn",W0); / printf("The value of JO1 is %fn",J01); fprintf(save,"The value of J01 is %fn",J01); / printf("The value of h is %dn",h); fprintf(save,"The value of h is %dn",h); / print

12、f("The width of the secion b is %dn",b); fprintf(save,"The width of the secion b is %dn",b);void length2() int i; printf("Please confirm the number of of the spring n="); scanf("%d",&n); fprintf(save,"n=%dn",n);/ printf("Now we begin to conf

13、irm the length of every slice of the springn"); printf("We have known that s=70 mm,please drawing.n"); printf("Please input thickness of the every slim of the spring:input n numbersn"); for(i=1;i<n+1;i+) scanf("%f",&h1i); printf("Please input every leng

14、th of the spring:input n numbersn"); for(i=1;i<n+1;i+) scanf("%f",&L1i); for(i=1;i<n+1;i+) / fprintf(save,"thickness h1%d=%f,length L1%d=%fn",i,h1i,i,L1i);void check1() float a120,Y20,J20,l20,cj,cz; float sumJ=0,sum3=0; int i,co; for(i=1;i<n+1;i+) li=L1i/2; Ji=(

15、b*h1i*h1i*h1i)/12; / printf("Ji=%fn",Ji); printf("Input co (if co=1 ,calculate cj)for calculate cj or cz,co="); scanf("%d",&co); if(co=1) for(i=1;i<n+1;i+) l1=L/2; a1i=l1-li; sumJ+=Ji; Yi=1/sumJ; / printf("sumJ=%f,Yi=%fn",sumJ,Yi); for(i=1;i<=n;i+) s

16、um3+=(a1i+1*a1i+1*a1i+1*(Yi-Yi+1); cj=6*a*E/sum3; printf("cj=%fn",cj); fprintf(save,"cj=%fn",cj); else for(i=1;i<n+1;i+) l1-=(0.5*k*s); a1i=l1-li; sumJ+=Ji; Yi=1/sumJ; for(i=1;i<=n;i+) sum3+=(a1i+1*a1i+1*a1i+1*(Yi-Yi+1); cz=6*a*E/sum3; printf("cz=%fn",cz); fprintf

17、(save,"cz=%fn",cz); if(fabs(cj-c)<50|fabs(cz-c)<50) printf("your check is suitablen"); fprintf(save,"your check is suitablen"); else printf("Breake the programe and calculate it againn");fprintf(save,"Breake the programe and calculate it againn"

18、;); void arcH0() float drf; int xx,yy; drf=s*(3*L-s)*(fa+fc)/(2*L*L); H0=fc+fa+drf; R0=(L*L)/(8*H0); printf("HO=%f,R0=%fn",H0,R0); fprintf(save,"HO=%f,R0=%fn",H0,R0); do xx=radius(); yy=check2(); while(xx=0|yy=0);void main(void) float G1=5750,Gu=690; char name20,xh20; save=fopen(

19、"result","at+"); printf("enter your name in pinying :"); scanf("%s",name); printf("enter your xuehao:"); scanf("%s",xh); fprintf(save,"name:%s,xuehao:%sn",name,xh); fa=15; Fw=(G1-Gu)/2; printf("Please input fc(it can be 10030

20、0)="); scanf("%f",&fc); printf("fc=%f,Fw=%fn",fc,Fw); fprintf(save,"fc=%f,Fw=%fn",fc,Fw); length1(); section3(); length2(); check1(); arcH0(); fclose(save);运行结果:enter your name in pinying :Wang Qingmiaoenter your xuehao:201223179045Please input fc(it can be 100

21、300)=135fc=135.000000,Fw=2530.000000Please input the axle distance, Llb can be 20002200 ,input lb=2200L=1100.000000Please input flap for confirm the value of k (if flap=0 then k=0),flap=1c=18.740741Please estimate n0 and input n0=9hp=4.327781b10=33.756695b11=39.382809b12=45.008926b13=50.635040b14=56

22、.261154Please convert b1i into a integar,and it's value can be 63,65,70Select a value and give it to b,input b=63h can be 6,7 or 8,please select h=7The value of J0 is 2915.247559The value of W0 is 1347.224976The value of JO1 is 16206.750000The value of h is 7The width of the secion b is 63Please

23、 confirm the number of of the spring n=9Now we begin to confirm the length of every slice of the springWe have known that s=70 mm,please drawing.Please input thickness of the every slim of the spring:input n numbers777777777Please input every length of the spring:input n numbers110098687175764252841

24、3299184Ji=1800.750000Ji=1800.750000Ji=1800.750000Ji=1800.750000Ji=1800.750000Ji=1800.750000Ji=1800.750000Ji=1800.750000Ji=1800.750000Input co (if co=1 ,calculate cj)for calculate cj or cz,co=1sumJ=1800.750000,Yi=0.000555sumJ=3601.500000,Yi=0.000278sumJ=5402.250000,Yi=0.000185sumJ=7203.000000,Yi=0.00

25、0139sumJ=9003.750000,Yi=0.000111sumJ=10804.500000,Yi=0.000093sumJ=12605.250000,Yi=0.000079sumJ=14406.000000,Yi=0.000069sumJ=16206.750000,Yi=0.000062cj=-0.000000your check is suitableHO=164.014465,R0=922.174759Please input a0i=(input n numbers):-300-225-150-75075150225300The radius of the spring R1 is 1478.7

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论