YALMIP have some issue sending plog to global solver

65 views
Skip to first unread message

JackJack

unread,
Oct 22, 2025, 10:46:47 PM10/22/25
to YALMIP
Dear Professor Johan 

This program cannot work with Baron, but it can work well with bmibnb.

x = sdpvar(1);
y = sdpvar(1);
t = sdpvar(1);
obj = -t;
cons = [];
cons = [cons, 100 <= x <= 200];
cons = [cons, 300 <= y <= 400];
cons = [cons, t <= plog(y, x + y)];
optsB = sdpsettings('solver','baron', ...
'verbose',1, ...
'savesolveroutput',1, ...
'savesolverinput',0);
tic;
solB = optimize(cons, obj, optsB); The error is as follows: Optimization Status: 9 (Unknown problem (learn to debug) (Unknown problem (learn to debug) (Error using baron
There was an error evaluating a user supplied function. Please examine the below error and correct your function.

Error using "plog" (line 55)
PLOG called with weird argument

Error Trace:
- Error in "@(x)[1*x(3)-plog(x(4))]" (line 0)
- Error in "baron" (line 0)
- Error in "baron" (line 0)
- Error in "baron" (line 0)
- Error in "callbaron" (line 78)
- Error in "solvesdp" (line 423)
- Error in "optimize" (line 31)
- Error in "your_program" (line 100)
)))


Is there any way to overcome this?

Johan Löfberg

unread,
Oct 28, 2025, 2:50:30 AM10/28/25
to YALMIP
Right, I will have to clean away those. Until then, simply don't use plog but write the function explicitly. I've raised a bug to remember

Johan Löfberg

unread,
Oct 29, 2025, 8:00:45 AM10/29/25
to YALMIP
Fixed in develop

On Thursday, 23 October 2025 at 04:46:47 UTC+2 JackJack wrote:

JackJack

unread,
Oct 30, 2025, 2:35:12 AM10/30/25
to YALMIP
I hope that this fix also fix the problem with the following 

  1. exppexp
  2. loglog2log10slogplog
  3. entropylogsumexpkullbackleibler

Johan Löfberg

unread,
Oct 30, 2025, 3:24:26 AM10/30/25
to YALMIP
kullbackleibler and crossentropy added (not tested though as my license was broken)

JackJack

unread,
Feb 24, 2026, 11:09:45 PM (4 days ago) Feb 24
to YALMIP
Well after applying your fix 

clc;
clear all;
x = sdpvar(1);
y = sdpvar(1);
t = sdpvar(1);
obj = -t; % maximize t
cons = [];
cons = [cons, 100 <= x <= 200];
cons = [cons, 300 <= y <= 400];
cons = [cons, t <= plog(y, x + y)];
optsB = sdpsettings('solver','baron', ...
'verbose',1, ...
'savesolveroutput',1, ...
'savesolverinput',0,'CplexLibName','cplex12100.dll',...
'filekp',1);
tic;
solB = optimize(cons, obj, optsB);
elapsedTime = toc;
if solB.problem == 0
% Extract and display values
x_opt = value(x);
y_opt = value(y);
t_opt = value(t);
obj_opt = value(obj); % this is -t_opt
fprintf('Optimal solution found.\n');
fprintf('x* = %.10f\n', x_opt);
fprintf('y* = %.10f\n', y_opt);
fprintf('t* = %.10f\n', t_opt);
fprintf('Objective value (-t) = %.10f\n', obj_opt);
fprintf('Elapsed time = %.4f seconds\n', elapsedTime);
else
fprintf('Solver reported an issue: %s\n', yalmiperror(solB.problem));
end I run this program and got this strange output z =

    '(x(4)*log(x(5)/x(4)))'

Not sure why thought ?

Johan Löfberg

unread,
Feb 25, 2026, 3:17:57 AM (4 days ago) Feb 25
to YALMIP
missing ; on line 163 in callbaron
Reply all
Reply to author
Forward
0 new messages