| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1995 人关注过本帖
标题:ode45解3阶微分方程,2阶我会,3阶就晕了.
取消只看楼主 加入收藏
lvemealone
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2007-5-30
收藏
 问题点数:0 回复次数:0 
ode45解3阶微分方程,2阶我会,3阶就晕了.
方程如下:x'''+tx''-xx'+1=0
我的m文件:
function xdot=vdpol(t,x)
xdot(3)=-t*x(3)+x(1)*x(2)-1;
xdot(2)=x(3);
xdot(1)=x(2);
x(1)=x;
窗口命令:
>> t0=0;tf=20;
>> x0=[0;0];
>> [t,x]=ode45('vdpol',[t0,tf],x0);
错误提示:
??? Attempted to access x(3); index out of bounds because numel(x)=2.

Error in ==> vdpol at 2
xdot(3)=-t*x(3)+x(1)*x(2)-1;

Error in ==> funfun\private\odearguments at 110
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.

Error in ==> ode45 at 173
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...

搜索更多相关主题的帖子: 微分方程 xdot args funfun 
2007-05-30 21:02
快速回复:ode45解3阶微分方程,2阶我会,3阶就晕了.
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.046208 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved