[Ipopt] Matlab crashes when infeasible solution is found
Siddharth Goyal
siddelec at gmail.com
Tue Jan 10 10:54:40 EST 2012
Hi,
I have a precompiled ipopt.mexmaci64 file which was complied on a different system. I am able to run all the predefine examples (eg. examplehs051,...) with the mex file on my system. However, when there is no feasible solution Matlab crashes. Is it because mex file was complied on another system? If not, what can be the possible reason?
BTW, I was trying to solve a simple problem,
min x1^2+x2^2
such that x1+3X2 =0,
1<x1,x2<10
I have used the following code.
function [x, info] = examplehs051
x0 = [ 2.5 0.5 ]; % The starting point.
options.lb = [1 1 ]; % Lower bound on the variables.
options.ub = [+10 +10]; % Upper bound on the variables.
options.cl = [ 0 ]; % Lower bounds on constraints.
options.cu = [ 0 ]; % Upper bounds on constraints.
% Set the IPOPT options.
options.ipopt.jac_c_constant = 'yes';
options.ipopt.hessian_approximation = 'limited-memory';
options.ipopt.mu_strategy = 'adaptive';
options.ipopt.tol = 1e-7;
% The callback functions.
funcs.objective = @objective;
funcs.constraints = @constraints;
funcs.gradient = @gradient;
funcs.jacobian = @jacobian;
funcs.jacobianstructure = @jacobian;
% Run IPOPT.
[x info] = ipopt(x0,funcs,options);
% ----------------------------------------------------------------------
function f = objective (x)
f = x(1)^2 + x(2)^2;
% ----------------------------------------------------------------------
function g = gradient (x)
g = 2*[ x(1) ;
x(2) ]';
% ----------------------------------------------------------------------
function c = constraints (x)
c = [ x(1) + 3*x(2) ];
% ----------------------------------------------------------------------
function J = jacobian (x)
J = sparse([ 1 +3 ]);
Any suggestion is highly appreciated
Thanks
Siddharth
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20120110/ccadedda/attachment.html>
More information about the Ipopt
mailing list