Symbuilder with multiple initial points

14 views
Skip to first unread message

Toit Mouton

unread,
Nov 17, 2018, 2:26:40 PM11/17/18
to OPTI Toolbox Forum
I'm solving a non-convex optimization problem with Symbuilder and have to run the optimization with a number of different initial points. Every time I call Solve, with a new initial point, it rebuilds the problem and recompiles the C file. Is there a way to get around this?

Jonathan Currie

unread,
Nov 23, 2018, 9:59:25 PM11/23/18
to opti-tool...@googlegroups.com
Hi Toit, apologies for the delay.

This was quite an oversight from the original design, so thank you for raising it. I have pushed a fix to the OPTI master branch which now allows you to vary x0 without rebuilding the object:

clear
B = SymBuilder();
B.AddObj('(x1-x2)^4 + (x2+x3-2)^2+ (x4-1)^2 + (x5-1)^2');
B.AddCon('x1^2 + 3*x2 = 4');
Build(B)

options = optiset('solver','ipopt');
symset = symbset('cbmode','ccode','optiOpts',options);

% Solve Problem
x0 = [0;0;0;0;0];
[~,fval,~,info] = Solve(B,x0,symset)

%% Re-Solve Problem from Different Starting Point
x0 = [0;-1e4;0;0;1e1];
[~,fval,~,info] = Solve(B,x0,symset)

Jonathan

On Sun, Nov 18, 2018 at 8:26 AM Toit Mouton <dtmo...@gmail.com> wrote:
I'm solving a non-convex optimization problem with Symbuilder and have to run the optimization with a number of different initial points. Every time I call Solve, with a new initial point, it rebuilds the problem and recompiles the C file. Is there a way to get around this?

--
You received this message because you are subscribed to the Google Groups "OPTI Toolbox Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opti-toolbox-fo...@googlegroups.com.
To post to this group, send email to opti-tool...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages