Mx''+Kx+Cx'=f,这是我现在计算的一个动力微分方程,其中M,K,C为10*10的矩阵,在这种情况下,我编制了一个小波分析的程序,但出现了问题,报错,而我不知道错误在什么地方,请高手指点!!!
。m文件:
function xdot=hangjiajuzhen(t,x)
F=20*sin(25*t+14);
E=210*10^9;
A=0.25;
i=E*A/15;
k1=5/3*i;k2=-5/3*i;k3=-5/3*i;k4=5/3*i;k5=-5/4*i;k6=-5/4*i;k7=-5/4*i;k8=-5/4*i;k9=49/25*i;k10=7/25*i;k11=7/25*i;k12=1/25*i;
k13=1/25*i;k14=7/25*i;k15=7/25*i;k16=1/25*i;
c=0.01;
c1=(15+83/35)*c;
c2=(12+83/35)*c;
c3=(9+83/35)*c;
c5=9/70*c;
c6=13/35*c;
m=7850*A;
m1=(15+83/35)*m;
m2=(12+83/35)*m;
m3=(9+83/35)*m;
m5=9/70*m;
m6=13/35*m;
M=[ m1+m2+m3,m5,m5,m5,0,0,0,0,0,0;
m5,2*m6,0,m5,0,0,0,0,0,0;
m5,0,2*m3+m2,m5,m5,0,0,0,0,0;
m5,m5,m5,2*m1+2*m3+m2,m5,m5,0,0,0,0;
0,0,m5,m5,2*m1+2*m3+m2,m5,m5,m5,0,0;
0,0,0,m5,m5,2*m3+m2,0,m5,0,0;
0,0,0,0,m5,m5,2*m3+m2,m5,m5,0;
0,0,0,0,m5,m5,m5,2*m1+2*m3+m2,m5,m5;
0,0,0,0,0,0,m5,m5,m1+m2+m3,m5;
0,0,0,0,0,0,0,m5,m5,2*m6];
C=[ c1+c2+c3,c5,c5,c5,0,0,0,0,0,0;
c5,2*c6,0,c5,0,0,0,0,0,0;
c5,0,2*c3+c2,c5,c5,0,0,0,0,0;
c5,c5,c5,2*c1+2*c3+c2,c5,c5,0,0,0,0;
0,0,c5,c5,2*c1+2*c3+c2,c5,c5,c5,0,0;
0,0,0,c5,c5,2*c3+c2,0,c5,0,0;
0,0,0,0,c5,c5,2*c3+c2,c5,c5,0;
0,0,0,0,c5,c5,c5,2*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