Can I use "assign" and "check" to evaluate the feasibility of constraints?

44 views
Skip to first unread message

Pan Zhao

unread,
Aug 3, 2016, 1:05:31 PM8/3/16
to YALMIP
Hi Johan,

I have declared an optimization problem with a large number of constraints. I would like to evaluate whether some values (from solving a different optimization problem) of the optimization variables satisfy all the constraints. Can I use "assign" and "check" command to realize this? I tried but it did not work

Thanks. 

Regards
Pan

Johan Löfberg

unread,
Aug 3, 2016, 3:17:08 PM8/3/16
to YALMIP
Yes, should work as long as you assign all variables, and don't have high-level logic operators such as implies etc

>> sdpvar x
>> assign(x,3);check([x == 7, x>=0])
 
++++++++++++++++++++++++++++++++++++++++++++++++++++
|   ID|               Constraint|   Primal residual|
++++++++++++++++++++++++++++++++++++++++++++++++++++
|   #1|      Equality constraint|                -4|
|   #2|   Elementwise inequality|                 3|
++++++++++++++++++++++++++++++++++++++++++++++++++++


Pan Zhao

unread,
Aug 3, 2016, 8:03:58 PM8/3/16
to YALMIP
Thank you for your quick reply. It works now. 
Reply all
Reply to author
Forward
0 new messages