<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I have a precompiled ipopt.mexmaci64 file which was complied on a different system. I am able to run all the predefine examples (eg.&nbsp;<span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; ">examplehs051,...</span>) 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?</div><div><br></div><div>BTW, I was trying to solve a simple problem,&nbsp;</div><div>min x1^2+x2^2</div><div>such that x1+3X2 =0,</div><div>1&lt;x1,x2&lt;10</div><div><br></div><div>I have used the following code.</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">function [x, info] = examplehs051</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; x0 &nbsp; &nbsp; &nbsp; &nbsp; = [ <span style="color: #3f00d8">2.5</span> <span style="color: #3f00d8">0.5</span> ];&nbsp; % The starting point.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp;&nbsp; options.lb = [<span style="color: #3f00d8">1</span> <span style="color: #3f00d8">1</span> ];&nbsp; % Lower bound on the variables.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; options.ub = [+<span style="color: #3f00d8">10</span> +<span style="color: #3f00d8">10</span>];&nbsp; % Upper bound on the variables.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; options.cl = [ <span style="color: #3f00d8">0</span> ]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; % Lower bounds on constraints.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; options.cu = [ <span style="color: #3f00d8">0</span> ]; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; % Upper bounds on constraints.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; % Set the IPOPT options.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; options.ipopt.jac_c_constant&nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #3f00d8">'yes'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; options.ipopt.hessian_approximation = <span style="color: #3f00d8">'limited-memory'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; options.ipopt.mu_strategy &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #3f00d8">'adaptive'</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; options.ipopt.tol &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = <span style="color: #3f00d8">1e-7</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; % The callback functions.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; funcs.objective &nbsp; &nbsp; &nbsp; &nbsp; = @objective;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; funcs.constraints &nbsp; &nbsp; &nbsp; = @constraints;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; funcs.gradient&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = @gradient;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; funcs.jacobian&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = @jacobian;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; funcs.jacobianstructure = @jacobian;</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px">&nbsp;&nbsp;<br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; % Run IPOPT.</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; [x info] = ipopt(x0,funcs,options);</div><p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; min-height: 13.0px">&nbsp;&nbsp;<br class="webkit-block-placeholder"></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">% ----------------------------------------------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">function f = objective (x)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; f = x(<span style="color: #3f00d8">1</span>)^<span style="color: #3f00d8">2</span> + x(<span style="color: #3f00d8">2</span>)^<span style="color: #3f00d8">2</span>;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">% ----------------------------------------------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">function g = gradient (x)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; g = <span style="color: #3f00d8">2</span>*[ x(<span style="color: #3f00d8">1</span>) ;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; x(<span style="color: #3f00d8">2</span>) ]<span style="color: #3f00d8">';</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(63, 0, 216); ">% ----------------------------------------------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(63, 0, 216); ">function c = constraints (x)</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(63, 0, 216); ">&nbsp; c = [ x(1) + 3*x(2) &nbsp; ];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(63, 0, 216); min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(63, 0, 216); ">% ----------------------------------------------------------------------</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(63, 0, 216); ">function J = jacobian (x) &nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(63, 0, 216); ">&nbsp; J = sparse([ 1&nbsp; +3 ]);</div></div><div><br></div><div><br></div><div>Any suggestion is highly appreciated</div><div>Thanks</div><div><br></div><div>Siddharth</div></body></html>