matcont ode45 Unrecognized property name 'NonNegative' error

46 visualizaciones (últimos 30 días)
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.
Unrecognized property name 'NonNegative'. See ODESET for possibilities.
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?
  7 comentarios
Torsten
Torsten el 19 de Jun. de 2023
Editada: Torsten el 19 de Jun. de 2023
What is your code you want to run with "matcont" ?
Look through it and make sure you don't use the "NonNegative" option.
That's still the only explanation I can think of that could make the two softwares come into conflict.
Simon Neuroscience
Simon Neuroscience el 19 de Jun. de 2023
I am trying to simulate any of the ODE-Systems that are already implemented in the matcont-package. Trying out all different ODE-Syystem leads to the same error.
I then tried to define a new simple ODE-System that contains a simple saddle_node bifurcation to test matcont.
I implemented this in the matcont-Gui which then generates Matlab "sad_node.m" code.
In the matlab code sad_node.m the function "odeset" is used in the the 3 section of the following code:
Do I have to change some input of odeset() ? Because I did not specify NonNegative nowhere.
function out = sad_node_test
out{1} = @init;
out{2} = @fun_eval;
out{3} = @jacobian;
out{4} = @jacobianp;
out{5} = @hessians;
out{6} = @hessiansp;
out{7} = @der3;
out{8} = [];
out{9} = [];
% --------------------------------------------------------------------------
function dydt = fun_eval(t,kmrgd,par_r)
dydt=[par_r+kmrgd(1)^2;];
% --------------------------------------------------------------------------
function [tspan,y0,options] = init
handles = feval(sad_node_test);
y0=[0];
options = odeset('Jacobian',handles(3),'JacobianP',handles(4),'Hessians',handles(5),'HessiansP',handles(6));
tspan = [0 10];
% --------------------------------------------------------------------------

Iniciar sesión para comentar.

Respuesta aceptada

Simon Neuroscience
Simon Neuroscience el 21 de Jun. de 2023
This was Solution from Hil Meijer that worked for me:
"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."

Más respuestas (1)

Shishir Reddy
Shishir Reddy el 19 de Jun. de 2023
Hi Simon,
As per my understanding, the error you encountered regarding the 'NonNegative' property in MatCont is likely due to a conflict between the odeset function provided by MatCont and the built-in odeset function in MATLAB.
To resolve this issue, you can try the following steps:
1. Open the file `Code/Matlab/MatCont7p4/Continuer/odeset.m` in a text editor.
2. Search for the line that includes the property 'NonNegative' and comment it out by adding a '%' at the beginning of the line. It should look something like this:
MATLAB Code -
% options = optimset(options, 'NonNegative', 1:neq);
3. Save the modified `odeset.m` file.
By commenting out the line that sets the 'NonNegative' property, you are effectively disabling that specific property in MatCont.
After making this change, try running the MatCont GUI again and computing the ODE system. The error related to the 'NonNegative' property should no longer appear.
Please note that modifying the source code of MatCont is not an ideal solution and may have implications for the functionality and behavior of the software. Therefore, it's recommended to proceed with caution and test the modified MatCont to ensure it works as expected.
I hope this helps resolving the issue.
  3 comentarios
Simon Neuroscience
Simon Neuroscience el 19 de Jun. de 2023
Also here is a similar problem with matcont and the odeset.m code that is not answered:
https://de.mathworks.com/matlabcentral/answers/1944854-when-using-ode45-have-error-using-odeget-unrecognized-property-name-nonnegative-see-odeset-for
Shishir Reddy
Shishir Reddy el 19 de Jun. de 2023
Based on the code you provided, it seems that the 'NonNegative' property is not present in the MatCont version of the `odeset.m` file. Therefore, the issue might not be related to the `odeset` function itself.
Since you have mentioned that you already installed Xcode, it's possible that the problem lies in the version of MATLAB or the compatibility between MATLAB and Xcode.
To troubleshoot this issue, you can try the following steps:
1. Ensure that you have the latest version of MATLAB and Xcode installed. Check for any available updates and install them if necessary.
2. Verify that the Xcode Command Line Tools are properly configured. Open Terminal and run the following command:
xcode-select --print-path
This should display the path to the Xcode Command Line Tools. If the path is not displayed or it's incorrect, you can set it using the following command:
sudo xcode-select --switch /Applications/Xcode.app
Replace `/Applications/Xcode.app` with the correct path to your Xcode installation.
3. Restart your computer to ensure any changes take effect.
4. Launch MATLAB and try running MatCont again to see if the issue persists.
I hope this resolves the issue, if the problem still occurs, you may need to reach out to the MatCont support or MATLAB MathWorks support for further assistance. They can provide more specific guidance and help you resolve the compatibility issue between MatCont and MATLAB on your macOS system.

Iniciar sesión para comentar.

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by