ode45求解高阶微分方程组,求高手解答
需求解上图的微分方程组,编写m文件如下(文件名punchvibration):functiondx=punchvibration(t,x)m1=2522;m2=3822;...
需求解上图的微分方程组,编写m文件如下(文件名punchvibration):
function dx=punchvibration(t,x)m1=2522;m2=3822;m3=12298;k1=15.288*10^9;k2=6.348*10^9;k3=6.7076*10^7;c1=6.8316*10^4;c2=35.140*10^3;c3=24.07*10^4;q=2076.78;w=10*pi;dx=zeros(6,1);dx(1)=x(4);dx(2)=x(5);dx(3)=x(6);dx(4)=-(x(1)-x(2))*k1/m1-(x(4)-x(5))*c1/m1+q*e*w*w*sin(w*t)/m1;dx(5)=-(x(1)-x(3))*k2/m2-(x(5)-x(6))*c2/m2-(x(2)-x(1))*k1/m2-(x(5)-x(4))*c1/m2-q*e*w*w*sin(w*t)/m2;dx(6)=-x(3)*k3/m3-x(6)*c3/m3-(x(3)-x(2))*k2/m3-(x(6)-x(5))*c2/m3;end
然后在matlab命令框输入命令:[t,y]=ode45(@punchvibration,[0 12],[0,0,0,0])
出现了错误提示:
Attempted to access x(5); index out of bounds because numel(x)=4.
Error in punchvibration (line 15)dx(2)=x(5);
Error in odearguments (line 88)f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 114)[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ... >>
求高手帮忙看看,谢谢
在m文件中补充:
f=20;
x(4)=0;
x(5)=0;
x(6)=0;
再输入命令:[t,y]=ode45(@punchvibration,[0 12],[0,0,0,0])
还有错误提示:
Error using odearguments (line 93)
PUNCHVIBRATION returns a vector of length 6, but the length of initial conditions vector is 4. The vector returned by PUNCHVIBRATION and
the initial conditions vector must have the same number of elements.
Error in ode45 (line 114)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
求高手解决,跪谢 展开
function dx=punchvibration(t,x)m1=2522;m2=3822;m3=12298;k1=15.288*10^9;k2=6.348*10^9;k3=6.7076*10^7;c1=6.8316*10^4;c2=35.140*10^3;c3=24.07*10^4;q=2076.78;w=10*pi;dx=zeros(6,1);dx(1)=x(4);dx(2)=x(5);dx(3)=x(6);dx(4)=-(x(1)-x(2))*k1/m1-(x(4)-x(5))*c1/m1+q*e*w*w*sin(w*t)/m1;dx(5)=-(x(1)-x(3))*k2/m2-(x(5)-x(6))*c2/m2-(x(2)-x(1))*k1/m2-(x(5)-x(4))*c1/m2-q*e*w*w*sin(w*t)/m2;dx(6)=-x(3)*k3/m3-x(6)*c3/m3-(x(3)-x(2))*k2/m3-(x(6)-x(5))*c2/m3;end
然后在matlab命令框输入命令:[t,y]=ode45(@punchvibration,[0 12],[0,0,0,0])
出现了错误提示:
Attempted to access x(5); index out of bounds because numel(x)=4.
Error in punchvibration (line 15)dx(2)=x(5);
Error in odearguments (line 88)f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 114)[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ... >>
求高手帮忙看看,谢谢
在m文件中补充:
f=20;
x(4)=0;
x(5)=0;
x(6)=0;
再输入命令:[t,y]=ode45(@punchvibration,[0 12],[0,0,0,0])
还有错误提示:
Error using odearguments (line 93)
PUNCHVIBRATION returns a vector of length 6, but the length of initial conditions vector is 4. The vector returned by PUNCHVIBRATION and
the initial conditions vector must have the same number of elements.
Error in ode45 (line 114)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
求高手解决,跪谢 展开
1个回答
创远信科
2024-07-24 广告
2024-07-24 广告
作为上海创远仪器技术股份有限公司的团队成员,我们积累了广泛的介电常数数据。这些数据覆盖了从常见物质如空气、水、塑料到专业材料如聚苯乙烯、环乙醇等的介电常数。通过精心整理和分析,我们汇编了介电常数表合集,为客户提供了宝贵的参考信息。这些数据不...
点击进入详情页
本回答由创远信科提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询