Adding a constraint to the existing model

34 views
Skip to first unread message

Amin Kargarian

unread,
Nov 11, 2014, 1:06:47 PM11/11/14
to yal...@googlegroups.com
Hi,

I have a large-scale system. YALMIP takes around 1 hour to build the model. However, the solver, Cplex, solves the problem after around 1 minute.

I need to run this code interactively, and for in each iteration, I need to add a constraint to the model built in previous iteration. But, it again takes 1 hour to build the new model.

I was wondering if there any way to simply add a new constraint to the existing model in the YALMIP without requiring to re-build the entire model. 

Thanks a lot.

Johan Löfberg

unread,
Nov 11, 2014, 1:18:18 PM11/11/14
to yal...@googlegroups.com
The fact that it takes an hour to setup the model indicates something is done in the wrong way. You are welcome to send me the model for sanity check (joh...@isy.liu.se)

To avoid setting up problem repeatedly when only making small changes, the optimizer command is used (see Wiki). Or perhaps not as you add a constraint, not just change change a constraint


Amin Kargarian

unread,
Nov 11, 2014, 3:56:48 PM11/11/14
to yal...@googlegroups.com
Thanks a lot!

Optimizer is perfectly working. 

Johan Löfberg

unread,
Nov 11, 2014, 3:58:23 PM11/11/14
to yal...@googlegroups.com
Would still like to see the code though to see why on earth it takes 1 hour to setup (privately if you wish)
Reply all
Reply to author
Forward
0 new messages