Save Optimizer Object to a File

33 views
Skip to first unread message

XB G

unread,
Nov 15, 2018, 6:20:45 PM11/15/18
to YALMIP

Dear Johan,
I'm dealing with a large scale problem, it takes quite some time (~hours) for yalmip to build the optimization model. The model will be solved repeatedly with different parameters, so I created an optimizer object to save some time. Is it possible/appropriate to save the optimizer object into a file and reload+resolve it in the future? 

I tried to save the workspace, and got warning messages:
"Warning: YALMIP objects cannot be
saved in binary format. You will run
into troubles if you try to load this
file later. You should clear all
YALMIP objects first, or avoid having
any YALMIP objects in the list of
variables which you save. 
> In sdpvar/saveobj (line 3)"

I noticed there are a few posts about "import and export", but it seems none of them is about optimizer: https://yalmip.github.io/tags/#export-and-import

I also noticed your reply about a very similar question a few years ago: https://groups.google.com/forum/#!newtopic/yalmip/yalmip/maXY14CnUv8
Is it still not possible?

Thanks,
XB

Johan Löfberg

unread,
Nov 16, 2018, 2:10:10 AM11/16/18
to YALMIP
it is supposed to work, but it looks like nonlinear models involving functions (such as sin/cos/log etc) are currently not possible
Message has been deleted

Mark L. Stone

unread,
Nov 16, 2018, 11:11:46 AM11/16/18
to YALMIP
I have saved optimizer objects for models with a combination of LMI and SOC constraints, some being quite large and taking hours to generate, into MAT file, loaded MAT file into new MATLAB session and successfully used the optimizer objects.

Johan Löfberg

unread,
Nov 16, 2018, 11:31:45 AM11/16/18
to YALMIP
Yes, saving optimizer objects works as long as they don't use callback operators. Not sure why
Reply all
Reply to author
Forward
0 new messages