You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently toying with snopt and yalmip and stumbled upon a dimension issue for problems with "few" constraints.
Example:
x = sdpvar(2,1)
obj = 0.5*(100*(x(2)-x(1)^2)^2 + (1-x(1))^2)
c = [-0 <= x <= 2]
optimize(c, obj, sdpsettings('solver', 'snopt', 'debug', 1))`
which yields on my installation (linux, Yalmip 20230622):
Error using snoptmex
iGfun has incorrect column dimension 2. Should be length 1
Error in solve_snopt (line 17)
xstate,Fstate,itn,mjritn] = snoptmex(mexopt, ...
^^^^^^^^^^^^^^^^^^^^
Error in snopt (line 465)
xstate,Fstate,output] = solve_snopt(istart, stopFun, name, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in callsnopt (line 89)
[xout,F,inform,xmul,Fmul] = snopt(x0, xlow, xupp, xmul, xstate,Flow, Fupp, Fmul, Fstate, usrf,ObjAdd, ObjRow,A,G,model.options.snopt);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in solvesdp (line 420)
eval(['output = ' solver.call '(interfacedata);']);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in optimize (line 31)
[varargout{1:nargout}] = solvesdp(varargin{:});
^^^^^^^^^^^^^^^^^^^^^
I haven't fully looked into the root cause but I think iGfun should be transposed in certain cases. Without really knowing what I'm doing I hacked the following two lines into snopt.m
if size(iGfun,1) == 1
iGfun = iGfun'
jGvar = jGvar'
end
which did the trick for me...
Best
Helfried
The text was updated successfully, but these errors were encountered:
hel-fried
changed the title
Bug: Snop interface for problem with few constraints
Bug: Snop interface for problems with "few" constraints
Jan 14, 2025
hel-fried
changed the title
Bug: Snop interface for problems with "few" constraints
Bug: snopt interface for problems with "few" constraints
Jan 14, 2025
Dear Johan,
I am currently toying with snopt and yalmip and stumbled upon a dimension issue for problems with "few" constraints.
Example:
which yields on my installation (linux, Yalmip 20230622):
I haven't fully looked into the root cause but I think iGfun should be transposed in certain cases. Without really knowing what I'm doing I hacked the following two lines into
snopt.m
which did the trick for me...
Best
Helfried
The text was updated successfully, but these errors were encountered: