フィルターのクリア

Script error ode23

1 回表示 (過去 30 日間)
SilverSurfer
SilverSurfer 2016 年 3 月 18 日
コメント済み: Torsten 2016 年 3 月 21 日
I'm trying to execute the scripts attached to this post (launch from DOF2LSim) but it gives me this error:
Error using odearguments (line 80)
The last entry in tspan must be different from the first entry.
Error in ode23 (line 114)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in DOF2LSim (line 18)
[t,x] = ode23('DOF2LDE',0,tf,[0 0]',tol);
I didn't write this scripts, found it on the web. I read the help. I'm not sure the ode23 parameters are right. I think it should be something like this:
[t,x] = ode23('DOF2LDE',[0 tf]',x0);
with DOF2LDE function that evalutes differential equations tf final time of simulation 0 intial time of simulation x0 initial conditions
Another thing is that inside DOF2LDE script the function does not match the file name.

回答 (1 件)

Torsten
Torsten 2016 年 3 月 18 日
You can't call ODE23 as
[t,x] = ode23('DOF2LDE',0,tf,[0 0]',tol);
The second argument in the call has to be a vector of length at least 2 to indicate the time for start and end of the integration (in your case [0 tf]).
Best wishes
Torsten.
  2 件のコメント
SilverSurfer
SilverSurfer 2016 年 3 月 18 日
I had just tried it but it gives me another error
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode23 (line 114)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in DOF2LSim (line 20)
[t,x] = ode23('DOF2LDE',[0 tf],x0);
Torsten
Torsten 2016 年 3 月 21 日
[t,x]=ode23(@DOF2LDE,[0 tf],[0;0]);
still errors ?
Best wishes
Torsten.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by