您好,欢迎访问三七文档
实验力学C程序代码#includestdio.h#includemath.hinti,f=12,n=7;doublen1[10]={1.8,2.6,3.5,4.3,5.5,6.1,6.5,6.6};doubleY1[10]={45,30,25,21,16,10,4,0};doublen2[10]={2.0,2.6,3.5,4.4,5.6,6.2,6.7,7.0};doubleY2[10]={45,36,30,24,18,13,4.5,0};doublen3[10]={1.5,2.5,3.5,4.2,5.2,6.0,6.3,6.4};doubleY3[10]={45,25,22,18,14,8,4,0};doubleF[10],S[10],H,C[10],C1[10],C2[10],d=6.25,A,B,X[10],X1[10],X2[10],W[10],Z[10],Z1[10],Z2[10],T[10],T1[10],T2[10],T3[10],E[10],F1[10],F2[10],F3[10],F4[10];voidfun1();/*OG截面上的切应力*/voidfun2();/*AB截面上的切应力*/voidfun3();/*CD截面上的切应力*/voidfun4();/*OG截面的x方向的正应力*/voidfun5();/*OG截面的y方向的正应力*/voidfun6();/*OG截面的第一主应力和第二主应力*/voidmain(){fun1();fun2();fun3();fun4();fun5();fun6();}voidfun1(){for(i=0;i=n;i++){C[i]=2*Y1[i];Z[i]=sin(C[i]/180.0*3.1415926);}B=2*d;A=f/B;printf(姓名:学号:\n);printf(OG截面上的切应力T计算表\n);printf(点号n(条)f/(2*d)*nQ1(度)sin(2*Q1)T=f/(2*d)*n*sin(2*Q1)(MPa)\n);for(i=0;i=n;i++){X[i]=A*n1[i];T[i]=A*n1[i]*Z[i];printf(%4d%7.1lf%11.3lf%8.1lf%11.3lf%14.3lf\n,i,n1[i],X[i],Y1[i],Z[i],T[i]);}}voidfun2(){printf(\n);printf(\n);for(i=0;i=n;i++){C1[i]=2*Y2[i];Z1[i]=sin(C1[i]/180.0*3.1415926);}B=2*d;A=f/B;printf(表2\n);printf(AB截面上的切应力T1计算表\n);printf(节点号n(条)f/(2*d)*nQ2(度)sin(2*Y2)T1=f/(2*d)*n*sin(2*Q2)(MPa)\n);for(i=0;i=n;i++){X1[i]=A*n2[i];T1[i]=A*n2[i]*Z1[i];printf(%3d%7.1lf%11.3lf%8.1lf%10.3lf%14.3lf\n,i,n2[i],X1[i],Y2[i],Z1[i],T1[i]);}}voidfun3(){printf(\n);printf(\n);for(i=0;i=n;i++){C2[i]=2*Y3[i];Z2[i]=sin(C2[i]/180.0*3.1415926);}B=2*d;A=f/B;printf(CD截面上的切应力T2计算表\n);printf(节点号n(条)f/(2*d)*nQ3(度)sin(2*Y3)T2=f/(2*d)*n*sin(2*Q3)(MPa)\n);for(i=0;i=n;i++){X2[i]=A*n3[i];T2[i]=A*n3[i]*Z2[i];printf(%3d%7.1lf%11.3lf%8.1lf%10.3lf%14.3lf\n,i,n3[i],X2[i],Y3[i],Z2[i],T2[i]);}}voidfun4(){printf(\n);printf(\n);printf(OG截面上的x方向的正应力计算表\n);F1[0]=-1.728;T3[0]=T1[0]-T2[0];printf(节点号切应力差差值积(MPa)正应力X\n);printf(%4d%10.3lf%28.3lf\n,0,T3[0],F1[0]);for(i=1;i=n;i++){T3[i]=T1[i]-T2[i];E[i]=-(T3[i-1]+T3[i])/2;F1[i]=F1[i-1]-E[i];printf(%4d%10.3lf%11.3lf%15.3lf\n,i,T3[i],E[i],F1[i]);}}voidfun5(){printf(\n);printf(\n);for(i=0;i=n;i++){C[i]=2*Y1[i];W[i]=cos(C[i]/180.0*3.1415926);}H=f/d;printf(OG截面上的y方向的正应力计算表\n);printf(节点号正应力xQ1(度)cos(2*Y1)f/d*nf/d*n*cos(2*Q1)y方向的正应力\n);for(i=0;i=n;i++){S[i]=H*n1[i];T[i]=H*n1[i]*W[i];F2[i]=F1[i]-T[i];printf(%4d%9.3lf%7.1lf%11.3lf%10.3lf%11.3lf%11.3lf\n,i,F1[i],Y1[i],W[i],S[i],T[i],F2[i]);}}voidfun6(){printf(\n);printf(\n);printf(OG截面上的主应力s1和s2的计算表\n);for(i=0;i=n;i++){S[i]=H*n1[i];F[i]=F1[i]+F2[i];F3[i]=(F1[i]+F2[i]+S[i])/2;F4[i]=(F1[i]+F2[i]-S[i])/2;printf(%8d%8.3lf%8.1lf%8.3lf%8.3lf%8.4lf%8.4lf\n,i,F1[i],F2[i],F[i],S[i],F3[i],F4[i]);}printf(\n\nOG截面上的切应力、x方向主应力、y方向主应力、第一主应力、第二主应力\n);printf(节点号切应力T正应力x正应力y主应力s1主应力s2\n);for(i=0;i=n;i++)printf(%4d%9.3lf%9.3lf%9.3lf%10.3lf%10.3lf\n,i,T[i],F1[i],F2[i],F3[i],F4[i]);}刘增加1306040116
本文标题:程序设计切应力差法
链接地址:https://www.777doc.com/doc-2150926 .html