帮忙找一下解动力方程程序的错误
matlab解动力方程:M*d2y+C*dy+K*y=F :先编写程序odex2.m
function ydot=odex2(t,y)
ydot=zeros(12,1);
y(1)=ydot(1:6);%前六项对应6个y,也就是位移
y(2)=ydot(7:12);%后六项对应6个y的一阶导数,也就是速度
ydot=;
然后运行:
y0=zeros(12,1);
tspan=;
=ode45('odex2',tspan,y0);
plot(t,y)
怎么运行不出来呢?新手上路,拜托各位帮忙!
其中M=
Columns 1 through 3
0.179338444948704 0 0
0 0.199834267228556 0.00284635731911443
0 0.00284635731911443 5.22694707691923e-005
0.0896692224743521 0 0
0 0.0691734001945002 0.00168193841584035
0 -0.00168193841584035 -3.92021030768942e-005
Columns 4 through 6
0.0896692224743521 0 0
0 0.0691734001945002 -0.00168193841584035
0 0.00168193841584035 -3.92021030768942e-005
0.179338444948704 0 0
0 0.199834267228556 -0.00284635731911443
0 -0.00284635731911443 5.22694707691923e-005
K=
Columns 1 through 3
1076785822.59454 972607.102196906 65504.3893684949
972607.102196906 210697053.60339 10632748.1072992
65504.3893684949 10632748.1072992 716107.943798101
-1076785822.59454 -972607.102196906 -65504.3893684949
-972607.102196906 -210697053.60339 -10632748.1072992
32728.9279533926 10647654.3066432 357799.615039121
Columns 4 through 6
-1076785822.59454 -972607.102196906 32728.9279533926
-972607.102196906 -210697053.60339 10647654.3066432
-65504.3893684949 -10632748.1072992 357799.615039121
1076785822.59454 972607.102196906 -32728.9279533926
972607.102196906 210697053.60339 -10647654.3066432
-32728.9279533926 -10647654.3066432 717613.469931842
C=
Columns 1 through 3
186648.781973481 168.589769791428 11.35439983835
168.589769791428 36522.7877169709 1843.07327564183
11.35439983835 1843.07327564183 124.128975515427
-186647.460240501 -168.589769791428 -11.35439983835
-168.589769791428 -36521.4659839905 -1843.05102647
5.67316691058422 1845.63483725052 62.0200770245852
Columns 4 through 6
-186647.460240501 -168.589769791428 5.67316691058422
-168.589769791428 -36521.4659839905 1845.63483725052
-11.35439983835 -1843.05102647 62.0200770245852
186648.781973481 168.589769791428 -5.67316691058422
168.589769791428 36522.7877169709 -1845.65708642235
-5.67316691058422 -1845.65708642235 124.389940404259
F =
-0.256890196210371
-51.6604178422184
-2.60639822396588
0.219881672759549
51.6234093187675
-2.60942875559811 先问下楼主,方程中的M C K怎么有那么多组数值,另外请把你的错误提示贴上来。 错误提示odex2.m文件不对。M、C、K都是6*6的 回复 3 # lxpingguoxl 的帖子
感觉是楼主状态方程写法的问题。
楼主可以使用扩阶矩阵简化状态方程的书写!
谢谢,问题已解决
页:
[1]