
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个回答
展开全部
先用简单的方程熟悉函数使用方法。你显然是翻了基本语法错误,数组长度不对。

2025-02-09 广告
是的。传统上,对于符合要求的内毒素检测,最终用户必须从标准内毒素库存瓶中构建至少一式两份三点标准曲线;必须有重复的阴性控制;每个样品和PPC必须一式两份。有了Sievers Eclipse内毒素检测仪,这些步骤可以通过使用预嵌入的内毒素标准...
点击进入详情页
本回答由Sievers分析仪提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询