|
楼主 |
发表于 2011-3-16 13:02
|
显示全部楼层
主程序:
tspan=[0 100];
y0=zeros(10,1);
[t,y]=ode45(@zcx_vfun,tspan,y0);
plot(t,y);grid;
hold on;
函数程序:
function dy=zcx_vfun(t,y)
%系统参数
m_b=650;m_d=3000;m_fd=3000;m_bd=3000;m_f=2100;jd=45/360*6.28;w=200;J_f=4.0*10^3;
F_0=84*10^3;k_bfv=1.2*10^5;c_bfv=1.2*10^2;
k_bfh=1.2*10^5;c_bfh=1.2*10^2;
k_fdv=1.6*10^6;k_bdv=1.6*10^6;
c_fdv=0.87*10^3;c_bdv=0.87*10^3;
k_fdh=1.6*10^6;k_bdh=1.6*10^6;
c_fdh=0.87*10^3;c_bdh=0.87*10^3;
k_fsv=3.2*10^6;k_bsv=3.2*10^6;
c_fsv=11*10^3;c_bsv=11*10^3;
k_fsh=3.2*10^6;k_bsh=3.2*10^6;
c_fsh=11*10^3;c_bsh=11*10^3;
l_1=1.8;l_2=0.8;
%质量矩阵
M=[m_fd,0,0,0,0;0,m_fd,0,0,0;0,0,m_f,0,0;0,0,0,m_b,0;0,0,0,0,J_f];
%刚度矩阵
K=[k_fsv+k_fdv,0,-k_fdv,0,-k_fdv*l_1;0,k_bsv+k_bdv,-k_bdv,0,k_bdv*l_1;-k_fdv,-k_bdv,k_fdv+k_bdv+k_bfv,-k_bfv,k_fdv*l_1-k_bdv*l_1-k_bfv*l_2;0,0,-k_bfv,k_bfv,k_bfv*l_2;-k_fdv*l_1,k_bdv*l_1,k_fdv*l_1-k_bdv*l_1-k_bfv*l_2,k_bfv*l_2,k_fdv*l_1^2+k_bdv*l_1^2+k_bfv*l_2^2];
%阻尼矩阵
C=[c_fsv+c_fdv,0,-c_fdv,0,-c_fdv*l_1;0,c_bsv+c_bdv,-c_bdv,0,c_bdv*l_1;-c_fdv,-c_bdv,c_fdv+c_bdv+c_bfv,-c_bfv,-c_bdv*l_1+c_fdv*l_1-c_bfv*l_2;0,0,-c_bfv,c_bfv,c_bfv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