马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
请教方程为何无法求解?
clear all;
clf;
fs=1000;
n=2048;
tspan=0:1/fs:(n-1)/fs;
x0 = [1; 1; 0; 0; 0; 0; 0; 0];
[t,x] = ode45('solution', tspan, x0);
plot(t,x(:,1));
xlabel('t');
ylabel('x(t)');
title('时域图');
function f = solution(t,x)
rb1=0.1;
rb2=0.2;
T1=10;
T2=10;
e=0.0001;
omega2=1;
kg=1e6;
cg=0.08;
J1=1.25e-3;
J2=2e-2;
m2=1;
k2=3.55e6;
c2=0.15;
f = zeros(8,1);
f(1) = x(2);
f(2) = (T1-(kg*(rb2*x(3)-rb1*x(1)+x(7))+cg*(rb2*x(4)-rb1*x(2)+x(8)))*rb1)/J1;
f(3) = x(4);
f(4) = (-T2-(kg*(rb2*x(3)-rb1*x(1)+x(7))+cg*(rb2*x(4)-rb1*x(2)+x(8)))*rb2)/J2;
f(5) = x(6);
f(6) = -m2*e*(omega2)^2*cos(omega2*t)-c2*x(6)-k2*x(5);
f(7) = x(8);
f(8) = -m2*e*(omega2)^2*sin(omega2*t)-c2*x(8)-k2*x(7)-(kg*(rb2*x(3)-rb1*x(1)+x(7))+cg*(rb2*x(4)-rb1*x(2)+x(8)));
|