Using mosek in cvxpy, I'm getting the error that the solver failed. Is there a way to recover the error code from Mosek? Cvxpy doesn't seem to provide it.
Cvxpy ignores it. However, you can hack it by changing the line in mosek_coinf.py that does task.optimize and retrieving the response code according to https://docs.mosek.com/8.1/pythonapi/optimizer-task.html#mosek.task.optimize
Moreover, if you enable logging (verbose=True) then you should see from the solver log what happened.
Related
I'm currently changing Simulink Ext Mode to xcp. Now i'm running into the Issue DWARF Parser internal error: Parser::describeSymbol xcpDummyDoubleVariable is not a global variable. According to this post, the issue should have been fixed but it still doesn't work.
https://de.mathworks.com/matlabcentral/answers/703597-dwarf-parser-internal-error-parser-describesymbol-xcpdummydoublevariable-is-not-a-global-variable
I also tried the first approach (the second one is already active in version 22b) but the Error still occurs.
Have u got any suggestions why the error still occurs?
I am working on a model in Dymola and use the Dymola S-block in Simulink to compile the model and then run the model in Simulink. After a few compilations, the interface stops working with the error in the Matlab workspace as
Error using ddereq
The first argument 'channel' is not valid.
Error in newDymolaGuiJava
Error in newDymolaGuiJava
Error in newDymolaGui Error while evaluating UIControl Callback.
I have to restart Matlab every time I encounter this to make it work. And it happens very frequently. I'm not sure what the problem is.
I am using an open-source modelica library(ThermoSysPro) to build a simple Rankine cycle model, but it seems there is an issue about initialization.
So I changed the debug setting as follows to check the log file:
In the dslog.txt file, I could see there are a lot of errors in the same type:
As the log file shows, all these errors are caused by iteration divergence and bad start values:
In order to see which iteration variable caused the divergence, I checked the iteration result of all the iteration variables, but they all seem in the right range. So I am not sure what I should do next to find the source of the divergence. The method in the Dymola help manual didn't work in practice.
My question is how should I do to find the bad start values when facing the initialization divergence in Dymola?
Here is the link of the library, the model I built, the log files generated.
github link
I cannot run state flow diagram from Matlab. I am using Matlab 2013b. Whenever I try to run it it gives a warning:
Warning: The model 'xyz' does not have continuous states, hence
Simulink is using the solver'FixedStepDiscrete' instead of solver
'ode4'. You can disable this diagnostic by explicitly specifying a
discrete solver in the solver tab of the Configuration Parameters
dialog, or by setting the 'Automatic solver parameter selection'
diagnostic to 'none' in the Diagnostics tab of the Configuration
Parameters dialog
However I have modified the above mentioned two requirement from configuration setup. But it is still showing problem. Do I need to set up some additional software to fix this problem?
This is just a warning, not an error message, your model will run just fine as is. If you want to get rid of the message, change the solver in the model to FixedStepDiscrete instead of ode4 and it will go away, but it won't change anything in the actual running of the model.
I have a matlab script, that every now and them produces the message:
Caught std::exception Exception message is:
bad allocation
Unexpected error status flag encountered. Resetting to proper state.
What could be causing this?
This is a bug in MATLAB, in which some part of MATLAB is not handling a std::bad_alloc exception correctly (std::bad_alloc is an out-of-memory exception thrown from the C++ runtime library).
The "Unexpected error status flag encountered. Resetting to proper state." is an internal diagnostic - you shouldn't see it unless MATLAB has gotten into a bad state, which in this case is happening because it's encountering the bad_alloc someplace where it was not expected. Recent versions of MATLAB have fixed most of these issues, except in extremely low-memory situations (like, there's less than 1 kilobyte of free memory left). What version are you using?
My best guess is that your script is trying to allocate some memory and failing. The occurrence of such an error will depend on the availability of memory on your computer at the time allocation is attempted. The available memory will vary according to what is going on at the time in other programs, the operating system, even the state of your Matlab session.
For a more accurate diagnosis, you'll have to tell us more, maybe even post your script.
It was happening to me, and it turned out I had too many files open. fclose('all') set everything back to normal, and I made sure that all my fopen were followed by fclose.