yalmip / YALMIP

MATLAB toolbox for optimization modeling
https://yalmip.github.io/
Other
464 stars 134 forks source link

I cannot get the result from the example of the YALMIP #1216

Closed wangwendi0705 closed 1 year ago

wangwendi0705 commented 1 year ago

Hi Johan and everyone, Sorry for asking for help again for question that I try the example "Multiparametric Programming" in the YALMIP. The matlab code is following: `A = randn(15,3);

b = rand(15,1);

E = randn(15,2);

z = sdpvar(3,1);

x = [0.1;0.2];

F = [Az <= b+Ex];

obj = (z-1)'*(z-1);

x = sdpvar(2,1);

F = [Az <= b+Ex, -1 <= x <= 1];

[sol,diagnostics,aux,Valuefunction,OptimalSolution] = solvemp(F,obj,[],x);

plot(Valuefunction);

figure

plot(OptimalSolution(1)); ` The code does not work. And I just get two empty figure. Thanks!

johanlofberg commented 1 year ago

Hence I guess MPT does not work on your machine, which you will have to check by solving problems without YALMIP, and/or debug the call to MPT in solvemp and see what happens in MPT and understand why it fails

wangwendi0705 commented 1 year ago

Thanks for fast reply. But without YALMIP, the commad 'sdpvar' does not work. And without YALMIP, I don't know how to debug the call to MPT in solvemp. Forgive my stupidity and thanks for help.

johanlofberg commented 1 year ago

I am saying you should go completely without YALMIP and call MPT directly, such as testing its examples

johanlofberg commented 1 year ago

nor have you told us what the returned diagnostic code is. my guess is solver not found

wangwendi0705 commented 1 year ago

The returned diagnostic code is Unknown problem (< a href=" ">learn to debug</ a>) (Unknown problem (< a href="yalmip.github.io/tutorial/inside/debug">learn to debug</ a>) (use the non-existent field 'requested_variables'。))

wangwendi0705 commented 1 year ago

I test several MPT examples without YALMIP just now and it does work. I guess something wrong with my command solvemp.

wangwendi0705 commented 1 year ago

I also use the code 'yalmiptest'. And I find the MPT solver is installed.

johanlofberg commented 1 year ago

It appears to be a bug in the develop branch, so you will have to switch back to the master branch

wangwendi0705 commented 1 year ago

Sorry. I cannot understand how to switch back to the master branch.

johanlofberg commented 1 year ago

Well, somehow you have managed to install the develop branch instead of the master branch. If you don't know how to switch, simply uninstall yalmip and install it again, as the default public version is the master branch

wangwendi0705 commented 1 year ago

Thank you very much. I try to install the YALMIP again. Sorry that I've been bothering you for too long

johanlofberg commented 1 year ago

Fixed in #1217