哈工大材料力学上机实验课作业
County continuation records has examined and approved the draft, spirit, believe, comprehensive
f *= 1000;
a /= 1000;
printf("请输入梁的弹性模量(GPa)\n");
scanf("%f",&E);
E *= ;
printf("请输入所求端面到左端面A的距离X\n");
scanf("%f",&x);
x /= 1000;
printf("请输入梁的截面形状〔圆柱面=1,矩形梁=2,工字梁=3,空心圆柱梁=4〕\n");
scanf("%d",&kind);
I = get_I(kind);//计算惯性矩
b = l - a;
M = f * x;//计算弯矩
if (0 <= x && x <= a)
{
v = (-1) * f * b * x *(l*l - x*x - b*b) / (6 * E * I * l);
County continuation records has examined and approved the draft, spirit, believe, comprehensive Yearbook of zhuanglang already prepared draft, entered the phase of evaluation. Civil air defense work
County continuation records has examined and approved the draft, spirit, believe, comprehensive Yearbook of zhuanglang already prepared draft, entered the phase of evaluation. Civil air defense work
County continuation records has examined and approved the draft, spirit, believe, comprehensive Yearbook of zhuanglang already prepared draft, entered the phase of evaluation. Civil air defense work
}
else if (a < x && x <= l)
{
v = (-1) * f * b * x *
(l/b * pow((x-a), 3) + (l*l - b*b)*x -pow(x, 3)) / (6 * E * I * l);
}
else
{
v = 0;
printf("error!");
exit (0);
}
printf("转矩M = %gN•m\n", M);
printf("挠度V = %gm\n", v);
system("pause");
return 0;
}
int get_I(int kind)//计算截面的I惯性矩
{
float d,b, h;//矩形梁,工字梁,圆柱梁
float d2, alpha;//空心圆柱梁
float I;
//圆柱面=1,矩形梁=2,工字梁=3,空心圆柱梁=4
if (1 == kind)//圆柱面=1
{
printf ("请输入圆柱梁的直径d\n");
scanf("%f", &d);
I = PI * pow(d, 4) / 64;
}
else if (2 == kind)//矩形梁=2
{
printf ("请输入矩形截面的b和h\n");
scanf ("%f%f",&b, &h);
I = b * pow(h, 3) / 12;
}
///*
else if (3 == kind)//工字梁=3
{
printf("|——————-—————|\n
最新哈工大材料力学上机实验课作业 来自淘豆网m.daumloan.com转载请标明出处.