《matlab刚架计算编程.doc》由会员分享,可在线阅读,更多相关《matlab刚架计算编程.doc(65页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Four short words sum up what has lifted most successful individuals above the crowd: a little bit more.-author-datematlab刚架计算编程题目一、 题目 基本参数计算: 材料弹性模量:1、底层柱(单元(1)到(3),550X550):EA=9680000,EI=244016.7;2、底层以上柱(单元(4)到(15),500X500):EA=8000000,EI=166666.7;3、边梁(单元(16)到(20),250X450):EA=3600000,EI=60750;4、中间梁
2、(单元(21)到(25),250X500): EA=4000000,EI=83333.3;节点编号及单元编号二、 计算结果对比1. 竖向均布荷载作用下的杆端内力计算输入底层柱高h1:4.8输入二至五层柱高h2:3输入左梁跨度L1:4.8输入右梁跨度L2:2.7输入底层柱子的抗弯刚度EIc1:244016.7输入二至五层柱子的抗弯刚度EIc2:166666.7输入底层柱子的抗压刚度EAc1:9680000输入二至五层柱子的抗压刚度EAc2:8000000输入左梁的抗弯刚度EIb1:60750输入右梁的抗弯刚度EIb2:83333.3输入左梁的抗压刚度EAb1:3600000输入右梁的抗压刚度EA
3、b2:4000000输入顶层竖向均布荷载集度q1:23输入一至四层均布荷载集度q2:20输入顶层水平集中力F1:0输入一至四水平集中力F2:0Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 3.812489e-019. In gangjia at 125第1节点的位移是-0.000312 0.000320 0.000158第2节点的位移是-0.000255 0.000299 0.000004第3节点的位移是-0.000139 0.000260 0.000032第4节
4、点的位移是-0.000058 0.000201 0.000036第5节点的位移是-0.000024 0.000125 0.000066第6节点的位移是-0.000000 0.000000 0.000000第7节点的位移是-0.000341 0.000471 -0.000125第8节点的位移是-0.000243 0.000438 -0.000063第9节点的位移是-0.000140 0.000380 -0.000072第10节点的位移是-0.000059 0.000296 -0.000057第11节点的位移是-0.000012 0.000185 -0.000054第12节点的位移是0.00000
5、0 0.000000 -0.000000第13节点的位移是-0.000347 0.000189 -0.000090第14节点的位移是-0.000241 0.000177 -0.000058第15节点的位移是-0.000140 0.000154 -0.000057第16节点的位移是-0.000058 0.000119 -0.000045第17节点的位移是-0.000010 0.000073 -0.000032第18节点的位移是0.000000 0.000000 -0.000000第1单元节点内力是55.676623 22.120376 41.726078 -55.676623 -22.12037
6、6 24.635050第2单元节点内力是105.531000 12.618842 17.368689 -105.531000 -12.618842 20.487837第3单元节点内力是154.956696 13.495898 20.022904 -154.956696 -13.495898 20.464789第4单元节点内力是203.914370 13.818765 19.057567 -203.914370 -13.818765 22.398728第5单元节点内力是86.165797 -13.600544 -23.843462 -86.165797 13.600544 -16.958168第
7、6单元节点内力是154.343865 -7.348932 -10.545483 -154.343865 7.348932 -11.501313第7单元节点内力是225.186314 -8.283039 -13.237518 -225.186314 8.283039 -11.611598第8单元节点内力是297.205484 -8.885450 -13.512019 -297.205484 8.885450 -13.144331第9单元节点内力是30.657580 -8.519833 -14.535293 -30.657580 8.519833 -11.024205第10单元节点内力是62.62
8、5136 -5.269910 -7.987274 -62.625136 5.269910 -7.822456第11单元节点内力是92.356990 -5.212859 -8.482119 -92.356990 5.212859 -7.156458第12单元节点内力是121.380147 -4.933315 -8.107970 -121.380147 4.933315 -6.691976第13单元节点内力是252.113359 4.837824 14.964088 -252.113359 -4.837824 8.257469第14单元节点内力是372.232119 -3.084712 -10.1
9、34383 -372.232119 3.084712 -4.672235第15单元节点内力是148.154523 -1.753112 -5.827793 -148.154523 1.753112 -2.587145第16单元节点内力是22.120376 -55.676623 -41.726078 -22.120376 -54.723377 39.438288第17单元节点内力是-9.501534 -49.854377 -42.003740 9.501534 -46.145623 33.102731第18单元节点内力是0.877056 -49.425696 -40.510741 -0.87705
10、6 -46.574304 33.667399第19单元节点内力是0.322867 -48.957674 -39.522356 -0.322867 -47.042326 34.925521第20单元节点内力是-8.980941 -48.198989 -37.362816 8.980941 -47.801011 36.407668第21单元节点内力是8.519833 -31.442420 -15.594826 -8.519833 -30.657580 14.535293第22单元节点内力是-3.249922 -22.032445 -5.599080 3.249922 -31.967555 19.0
11、11480第23单元节点内力是-0.057051 -24.268146 -8.928568 0.057051 -29.731854 16.304575第24单元节点内力是-0.279544 -24.976843 -9.801904 0.279544 -29.023157 15.264428第25单元节点内力是-3.180203 -27.225624 -13.128954 3.180203 -26.774376 12.519769Matlab计算弯矩图力矩分配法计算弯矩图结构力学求解器计算弯矩图2. 水平荷载作用下的杆端内力计算输入底层柱高h1:4.8输入二至五层柱高h2:3输入左梁跨度L1:4
12、.8输入右梁跨度L2:2.7输入底层柱子的抗弯刚度EIc1:244016.7输入二至五层柱子的抗弯刚度EIc2:166666.7输入底层柱子的抗压刚度EAc1:9680000输入二至五层柱子的抗压刚度EAc2:8000000输入左梁的抗弯刚度EIb1:60750输入右梁的抗弯刚度EIb2:83333.3输入左梁的抗压刚度EAb1:3600000输入右梁的抗压刚度EAb2:4000000输入顶层竖向均布荷载集度q1:0输入一至四层均布荷载集度q2:0输入顶层水平集中力F1:18输入一至四水平集中力F2:32Warning: Matrix is close to singular or badly
13、 scaled. Results may be inaccurate. RCOND = 3.812489e-019. In gangjia at 125第1节点的位移是0.010766 -0.000078 0.000176第2节点的位移是0.009966 -0.000076 0.000321第3节点的位移是0.008565 -0.000070 0.000521第4节点的位移是0.006503 -0.000058 0.000714第5节点的位移是0.003785 -0.000039 0.000935第6节点的位移是-0.000000 -0.000000 0.000000第7节点的位移是0.010
14、747 -0.000138 0.000165第8节点的位移是0.009932 -0.000137 0.000284第9节点的位移是0.008530 -0.000132 0.000432第10节点的位移是0.006464 -0.000115 0.000589第11节点的位移是0.003772 -0.000079 0.000689第12节点的位移是0.000000 -0.000000 0.000000第13节点的位移是0.010745 0.000216 0.000205第14节点的位移是0.009924 0.000213 0.000312第15节点的位移是0.008522 0.000202 0.0
15、00483第16节点的位移是0.006456 0.000173 0.000651第17节点的位移是0.003765 0.000118 0.000796第18节点的位移是-0.000000 0.000000 0.000000第1单元节点内力是-5.788617 -4.001579 -14.039455 5.788617 4.001579 2.034718第2单元节点内力是-15.767839 -10.233070 -26.449395 15.767839 10.233070 -4.249815第3单元节点内力是-31.245046 -15.512425 -34.021177 31.245046
16、15.512425 -12.516099第4单元节点内力是-52.244156 -18.146548 -39.461868 52.244156 18.146548 -14.977776第5单元节点内力是-1.562581 -10.530910 -22.438577 1.562581 10.530910 -9.154153第6单元节点内力是-14.655617 -24.288069 -44.629714 14.655617 24.288069 -28.234493第7单元节点内力是-44.997366 -39.528302 -68.050342 44.997366 39.528302 -50.5
17、34563第8单元节点内力是-94.445810 -57.286585 -91.484591 94.445810 57.286585 -80.375163第9单元节点内力是7.351198 -3.467511 -11.155563 -7.351198 3.467511 0.753031第10单元节点内力是30.423456 -15.478861 -32.749852 -30.423456 15.478861 -13.686732第11单元节点内力是76.242412 -26.959273 -49.759213 -76.242412 26.959273 -31.118606第12单元节点内力是1
18、46.689967 -38.566867 -65.888400 -146.689967 38.566867 -49.812202第13单元节点内力是-78.206852 -40.813457 -50.436253 78.206852 40.813457 -145.468339第14单元节点内力是-160.306021 -56.066694 -99.510204 160.306021 56.066694 -169.609927第15单元节点内力是238.512872 -49.119849 -77.431186 -238.512872 49.119849 -158.344090第16单元节点内力是
19、13.998421 5.788617 14.039455 -13.998421 -5.788617 13.745907第17单元节点内力是25.768509 9.979222 24.414677 -25.768509 -9.979222 23.485589第18单元节点内力是26.720645 15.477207 38.270992 -26.720645 -15.477207 36.019600第19单元节点内力是29.365877 20.999110 51.977967 -29.365877 -20.999110 48.817762第20单元节点内力是9.333091 25.962695 6
20、5.414029 -9.333091 -25.962695 59.206909第21单元节点内力是3.467511 7.351198 8.692670 -3.467511 -7.351198 11.155563第22单元节点内力是12.011350 23.072259 30.298277 -12.011350 -23.072259 31.996821第23单元节点内力是11.480412 45.818955 60.265235 -11.480412 -45.818955 63.445944第24单元节点内力是11.607594 70.447555 93.201392 -11.607594 -7
21、0.447555 97.007006第25单元节点内力是10.552982 91.822906 120.678459 -10.552982 -91.822906 127.243387Matlab计算弯矩图D值法计算弯矩图结构力学求解器计算弯矩图三、 程序代码h1=input(输入底层柱高h1:);h2=input(输入二至五层柱高h2:);L1=input(输入左梁跨度L1:);L2=input(输入右梁跨度L2:);EIc1=input(输入底层柱子的抗弯刚度EIc1:);EIc2=input(输入二至五层柱子的抗弯刚度EIc2:);EAc1=input(输入底层柱子的抗压刚度EAc1:);
22、EAc2=input(输入二至五层柱子的抗压刚度EAc2:);EIb1=input(输入左梁的抗弯刚度EIb1:);EIb2=input(输入右梁的抗弯刚度EIb2:);EAb1=input(输入左梁的抗压刚度EAb1:);EAb2=input(输入右梁的抗压刚度EAb2:);q1=input(输入顶层竖向均布荷载集度q1:);q2=input(输入一至四层均布荷载集度q2:);F1=input(输入顶层水平集中力F1:);F2=input(输入一至四水平集中力F2:);T=0,1,0,0,0,0; -1,0,0,0,0,0; 0,0,1,0,0,0; 0,0,0,0,1,0; 0,0,0,-
23、1,0,0; 0,0,0,0,0,1;%角度为90的转换矩阵%左梁的单元刚度矩阵Kb1=EAb1/L1 0 0 -EAb1/L1 0 0; 0 12*EIb1/(L1*L1*L1) 6*EIb1/(L1*L1) 0 -12*EIb1/(L1*L1*L1) 6*EIb1/(L1*L1); 0 6*EIb1/(L1*L1) 4*EIb1/L1 0 -6*EIb1/(L1*L1) 2*EIb1/L1; -EAb1/L1 0 0 EAb1/L1 0 0; 0 -12*EIb1/(L1*L1*L1) -6*EIb1/(L1*L1) 0 12*EIb1/(L1*L1*L1) -6*EIb1/(L1*L1)
24、; 0 6*EIb1/(L1*L1) 2*EIb1/L1 0 -6*EIb1/(L1*L1) 4*EIb1/L1;%右梁的单元刚度矩阵Kb2=EAb2/L2 0 0 -EAb2/L2 0 0; 0 12*EIb2/(L2*L2*L2) 6*EIb2/(L2*L2) 0 -12*EIb2/(L2*L2*L2) 6*EIb2/(L2*L2); 0 6*EIb2/(L2*L2) 4*EIb2/L2 0 -6*EIb2/(L2*L2) 2*EIb2/L2; -EAb2/L2 0 0 EAb2/L2 0 0; 0 -12*EIb2/(L2*L2*L2) -6*EIb2/(L2*L2) 0 12*EIb2
25、/(L2*L2*L2) -6*EIb2/(L2*L2); 0 6*EIb2/(L2*L2) 2*EIb2/L2 0 -6*EIb2/(L2*L2) 4*EIb2/L2;%底层柱子的单元刚度矩阵Kc1=EAc1/h1 0 0 -EAc1/h1 0 0; 0 12*EIc1/(h1*h1*h1) 6*EIc1/(h1*h1) 0 -12*EIc1/(h1*h1*h1) 6*EIc1/(h1*h1); 0 6*EIc1/(h1*h1) 4*EIc1/h1 0 -6*EIc1/(h1*h1) 2*EIc1/h1; -EAc1/h1 0 0 EAc1/h1 0 0; 0 -12*EIc1/(h1*h1*
26、h1) -6*EIc1/(h1*h1) 0 12*EIc1/(h1*h1*h1) -6*EIc1/(h1*h1); 0 6*EIc1/(h1*h1) 2*EIc1/h1 0 -6*EIc1/(h1*h1) 4*EIc1/h1;%二至五层柱子的单元刚度矩阵 Kc2=EAc2/h2 0 0 -EAc2/h2 0 0; 0 12*EIc2/(h2*h2*h2) 6*EIc2/(h2*h2) 0 -12*EIc2/(h2*h2*h2) 6*EIc2/(h2*h2); 0 6*EIc2/(h2*h2) 4*EIc2/h2 0 -6*EIc2/(h2*h2) 2*EIc2/h2; -EAc2/h2 0 0
27、 EAc2/h2 0 0; 0 -12*EIc2/(h2*h2*h2) -6*EIc2/(h2*h2) 0 12*EIc2/(h2*h2*h2) -6*EIc2/(h2*h2); 0 6*EIc2/(h2*h2) 2*EIc2/h2 0 -6*EIc2/(h2*h2) 4*EIc2/h2;Kc11=T*Kc1*T;%总体坐标下底层柱子的单元刚度矩阵Kc22=T*Kc2*T;%总体坐标下二至五层柱子的单元刚度矩阵X=zeros(54,54);K1=zeros(54,54);K2=zeros(54,54);%定义54阶0矩阵%把梁杆单元矩阵整合到总体刚度矩阵的循环语句for ii=1:5X(3*i
28、i-2:3*ii,3*ii-2:3*ii)=Kb1(1:3,1:3);K1=K1+X;X=zeros(54,54);endfor ii=7:11X(3*ii-2:3*ii,3*ii-2:3*ii)=Kb1(4:6,4:6);K1=K1+X;X=zeros(54,54);endfor ii=7:11X(3*ii-2:3*ii,3*ii-2:3*ii)=Kb2(1:3,1:3);K1=K1+X;X=zeros(54,54);endfor ii=13:17X(3*ii-2:3*ii,3*ii-2:3*ii)=Kb2(4:6,4:6);K1=K1+X;X=zeros(54,54);endfor ii=
29、1:5X(3*ii-2:3*ii,3*ii+16:3*ii+18)=Kb1(1:3,4:6);K1=K1+X;X=zeros(54,54);endfor ii=1:5X(3*ii+16:3*ii+18,3*ii-2:3*ii)=Kb1(4:6,1:3);K1=K1+X;X=zeros(54,54);endfor ii=7:11X(3*ii-2:3*ii,3*ii+16:3*ii+18)=Kb2(1:3,4:6);K1=K1+X;X=zeros(54,54);endfor ii=7:11X(3*ii+16:3*ii+18,3*ii-2:3*ii)=Kb2(4:6,1:3);K1=K1+X;X=z
30、eros(54,54);end%把柱杆单元矩阵整合到总体刚度矩阵的循环语句for jj=1:4X(3*jj-2:3*jj+3,3*jj-2:3*jj+3)=Kc22;K2=K2+X;X=zeros(54,54);endfor jj=7:10X(3*jj-2:3*jj+3,3*jj-2:3*jj+3)=Kc22;K2=K2+X;X=zeros(54,54);endfor jj=13:16X(3*jj-2:3*jj+3,3*jj-2:3*jj+3)=Kc22;K2=K2+X;X=zeros(54,54);endfor jj=5:6:17X(3*jj-2:3*jj+3,3*jj-2:3*jj+3)=
31、Kc11;K2=K2+X;X=zeros(54,54);endK=K1+K2;for i=6:6:18K(3*i-2:3*i,3*i-2:3*i)=Kc11(4:6,4:6).*10.15;endP=zeros(54,1);Y=zeros(54,1);Z=zeros(54,1);P(1,1)=F1;P(2,1)=q1*L1/2;P(3,1)=q1*L1*L1/12;P(20,1)=q1*L1/2+q1*L2/2;P(21,1)=-q1*L1*L1/12+q1*L2*L2/12;P(38,1)=q1*L2/2;P(39,1)=-q1*L2*L2/12;%定义荷载列阵for i=2:5Y(3*i-
32、2,1)=F2;P=P+Y;Y=zeros(54,1);endfor i=2:5Y(3*i-1,1)=q2*L1/2;Z(3*i,1)=q2*L1*L1/12;P=P+Y+Z;Y=zeros(54,1);Z=zeros(54,1);endfor i=8:11Y(3*i-1,1)=q2*L1/2+q2*L2/2;Z(3*i,1)=-q2*L1*L1/12+q2*L2*L2/12;P=P+Y+Z;Y=zeros(54,1);Z=zeros(54,1);endfor i=14:17Y(3*i-1,1)=q2*L2/2;Z(3*i,1)=-q2*L2*L2/12;P=P+Y+Z;Y=zeros(54,
33、1);Z=zeros(54,1);endA=KP;%结构位移LOC=zeros(25,2);LOC(1,1)=1;LOC(1,2)=2;LOC(2,1)=2;LOC(2,2)=3;LOC(3,1)=3;LOC(3,2)=4;LOC(4,1)=4;LOC(4,2)=5;LOC(5,1)=7;LOC(5,2)=8;LOC(6,1)=8;LOC(6,2)=9;LOC(7,1)=9;LOC(7,2)=10;LOC(8,1)=10;LOC(8,2)=11;LOC(9,1)=13;LOC(9,2)=14;LOC(10,1)=14;LOC(10,2)=15;LOC(11,1)=15;LOC(11,2)=16
34、;LOC(12,1)=16;LOC(12,2)=17;LOC(13,1)=5;LOC(13,2)=6;LOC(14,1)=11;LOC(14,2)=12;LOC(15,1)=17;LOC(15,2)=18;LOC(16,1)=1;LOC(16,2)=7;LOC(17,1)=2;LOC(17,2)=8;LOC(18,1)=3;LOC(18,2)=9;LOC(19,1)=4;LOC(19,2)=10;LOC(20,1)=5;LOC(20,2)=11;LOC(21,1)=7;LOC(21,2)=13;LOC(22,1)=8;LOC(22,2)=14;LOC(23,1)=9;LOC(23,2)=15;
35、LOC(24,1)=10;LOC(24,2)=16;LOC(25,1)=11;LOC(25,2)=17;a=zeros(6,1);M=zeros(6,25);MT=zeros(6,25);FE1=0;q1*L1/2;q1*L1*L1/12;0;q1*L1/2;-q1*L1*L1/12;FE2=0;q2*L1/2;q2*L1*L1/12;0;q2*L1/2;-q2*L1*L1/12;FE3=0;q1*L2/2;q1*L2*L2/12;0;q1*L2/2;-q1*L2*L2/12;FE4=0;q2*L2/2;q2*L2*L2/12;0;q2*L2/2;-q2*L2*L2/12;for i=1:12
36、 I1=LOC(i,1);I2=LOC(i,2); a(1,1)=A(3*I1-2,1); a(2,1)=A(3*I1-1,1); a(3,1)=A(3*I1,1); a(4,1)=A(3*I2-2,1); a(5,1)=A(3*I2-1,1); a(6,1)=A(3*I2,1); MT(1:6,i)=Kc2*T*a;M=M+MT;MT=zeros(6,25);a=zeros(6,1);endfor i=13:15 I1=LOC(i,1);I2=LOC(i,2); a(1,1)=A(3*I1-2,1); a(2,1)=A(3*I1-1,1); a(3,1)=A(3*I1,1); a(4,1)=
37、A(3*I2-2,1); a(5,1)=A(3*I2-1,1); a(6,1)=A(3*I2,1); MT(1:6,i)=Kc1*T*a;M=M+MT;MT=zeros(6,25);a=zeros(6,1);endfor i=16:16 I1=LOC(i,1);I2=LOC(i,2); a(1,1)=A(3*I1-2,1); a(2,1)=A(3*I1-1,1); a(3,1)=A(3*I1,1); a(4,1)=A(3*I2-2,1); a(5,1)=A(3*I2-1,1); a(6,1)=A(3*I2,1); MT(1:6,i)=Kb1*a-FE1;M=M+MT;MT=zeros(6,25
38、);a=zeros(6,1);endfor i=17:20 I1=LOC(i,1);I2=LOC(i,2); a(1,1)=A(3*I1-2,1); a(2,1)=A(3*I1-1,1); a(3,1)=A(3*I1,1); a(4,1)=A(3*I2-2,1); a(5,1)=A(3*I2-1,1); a(6,1)=A(3*I2,1); MT(1:6,i)=Kb1*a-FE2;M=M+MT;MT=zeros(6,25);a=zeros(6,1);endfor i=21:21 I1=LOC(i,1);I2=LOC(i,2); a(1,1)=A(3*I1-2,1); a(2,1)=A(3*I1-
39、1,1); a(3,1)=A(3*I1,1); a(4,1)=A(3*I2-2,1); a(5,1)=A(3*I2-1,1); a(6,1)=A(3*I2,1); MT(1:6,i)=Kb2*a-FE3;M=M+MT;MT=zeros(6,25);a=zeros(6,1);endfor i=22:25 I1=LOC(i,1);I2=LOC(i,2); a(1,1)=A(3*I1-2,1); a(2,1)=A(3*I1-1,1); a(3,1)=A(3*I1,1); a(4,1)=A(3*I2-2,1); a(5,1)=A(3*I2-1,1); a(6,1)=A(3*I2,1); MT(1:6,i)=Kb2*a-FE4;M=M+MT;MT=zeros(6,25);a=zeros(6,1);endfor i=1:18 m=i;fprintf(第%d节点的位移是%f %f %fn,i,A(3*m-2:3*m,1)endfor i=1:25 m=i;fprintf(第%d单元节点内力是%f %f %f %f %f %fn,i,M(:,m)end-