When using ode45, have Error using odeget Unrecognized property name 'NonNegative'. See ODESET for possibilities.

23 ビュー (過去 30 日間)
I was using ode45 with 'options' defined as:
options = odeset('RelTol',1e-10,'AbsTol',1e-10);
[t1,y1] = ode45(@(t,y)disc_dy(t,y,delta,g,C,N,F,H),tspan,y0,options);
When tried to run the code above, errors pop up as follows:
Error using odeget
Unrecognized property name 'NonNegative'. See ODESET for possibilities.
Error in ode45 (line 158)
idxNonNegative = odeget(options,'NonNegative',[]);
Error in simulation (line 122)
[~,y1] = ode45(@(t,y)disc_dy(t,y,delta,g,C,N,F,H),tspan,y0,options);
These codes worked well in ver. 2021b. Recently, I upgraded my MATLAB from R2021b to R2023a. And it seems strange since I didn't define 'NonNegative' in my options. Would the upgrade be the reason why I can't run them? Thanks a lot in advance.
  4 件のコメント
Walter Roberson
Walter Roberson 2023 年 4 月 11 日
編集済み: Walter Roberson 2023 年 4 月 11 日
Could you verify that you have the Optimization Toolbox installed and licensed?
Also what shows up for
which -all odeset
Ying Liu
Ying Liu 2023 年 4 月 11 日
Hello Walter, thank you for pointing this out. I have the Optimization Toolbox installed and licensed. I ran your codes and there are 2 'odeset.m' existing in my path, /MatCont7p3/Continuer/odeset.m and /Applications/MATLAB_R2023a.app/toolbox/matlab/funfun/odeset.m
Is there a way that I can avoid calling the MatCont odeset? Maybe move the MatCont path down below the toolbox path?

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

採用された回答

Walter Roberson
Walter Roberson 2023 年 4 月 11 日
You can use pathtool() to move MatCont7p3 further down in your path.
This is likely to interfere with running part of MatCont7p3.. but perhaps you would be okay.
  22 件のコメント
Steven Lord
Steven Lord 2023 年 5 月 23 日
Is there a reason you need to have your own version of odeget.m rather than using the one included with MATLAB? Could the solution be to delete the odeget.m in the Continuer directory rather than updating it? Having your own copy that shadows the one in MATLAB means that you're likely going to have this type of conflict whenever we update the odeget function in MATLAB and that you would have to update it to get any benefit of bug fixes or improvements to the function in MATLAB.
Bowen
Bowen 2023 年 5 月 23 日
I deleted the odeset.m in subfile of Matcont. But it reported a bug when I run a demo model. I have no idea of how to fix. Probabaly, I do not find the right solution.

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

その他の回答 (1 件)

Simon Neuroscience
Simon Neuroscience 2023 年 6 月 19 日
I have the same error: Unrecognized property name 'NonNegative'. See ODESET for possibilities.
I am trying to use matcont on mac on R2023a Version of Matlab. Already installed Xcode.
The GUI opens normal, but everytime I am trying to Compute a ODE System it gets the error.
If I run which -all odeset I also get 2 path:
1) Code/Matlab/MatCont7p4/Continuer/odeset.m
2) /Applications/MATLAB_R2023a.app/toolbox/matlab/funfun/odeset.m
Does anybody know how to fix this problem?
  2 件のコメント
Hil Meijer
Hil Meijer 2023 年 6 月 20 日
As I wrote above (as MatCont developer!), and probably the culprit of this problem, here is a quick fix: In the file MatCont7p3/Continuer/odeget.m, you can add a line (say at line 63, keeping alphabetical order) with the entry:
'NonNegative '
After that, on my machines, simulations again work.
Simon Neuroscience
Simon Neuroscience 2023 年 6 月 20 日
Thank you Hil Meijer, this seems to fix the problem!
Now Matcont works perfectly!
Great to get advice from a MatCont developer.

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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by