<div dir="ltr">Thought this would be useful for the list.<br clear="all"><div><div><div class="gmail_signature"><div dir="ltr"><br>Jason<br><a href="http://moorepants.info" target="_blank">moorepants.info</a><br><span>+01 530-601-9791</span><br></div></div></div>
<br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Jason Moore</b> <span dir="ltr"><<a href="mailto:moorepants@gmail.com">moorepants@gmail.com</a>></span><br>Date: Thu, Dec 18, 2014 at 11:51 AM<br>Subject: Re: [Ipopt] IPOPT runs out of memory for analytical jacobian of the constraints<br>To: Deepraj Paul <<a href="mailto:deepraj222@gmail.com">deepraj222@gmail.com</a>><br><br><div dir="ltr"><div><a href="http://www.mathworks.com/help/matlab/matlab_prog/strategies-for-efficient-use-of-memory.html?refresh=true" target="_blank">http://www.mathworks.com/help/matlab/matlab_prog/strategies-for-efficient-use-of-memory.html?refresh=true</a><br><br></div>Just do a google search. You basically need to understand when variables are copied Matlab (unfortunately most of the time) and avoid those copies. Some hacks, like using a global for main giant data structure. I think you may be able to pass classes into functions that have data member attributes, which may not be copied. Others are simple like preallocating arrays and avoid unnecessary array creation.<br></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><br>Jason<br><a href="http://moorepants.info" target="_blank">moorepants.info</a><br><span>+01 <a href="tel:530-601-9791" value="+15306019791" target="_blank">530-601-9791</a></span><br></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Thu, Dec 18, 2014 at 11:47 AM, Deepraj Paul <span dir="ltr"><<a href="mailto:deepraj222@gmail.com" target="_blank">deepraj222@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Regarding "tricks"....any suggestion...any references...</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 18, 2014 at 9:23 PM, Jason Moore <span dir="ltr"><<a href="mailto:moorepants@gmail.com" target="_blank">moorepants@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Matlab often does dumb things and copies arrays. For example, if you pass a matrix to a function it is copied. This leads to large memory use when you work with bigger data. You should carefully examine your memory use in the Matlab code you are using and see where you are using all the memory. It is likely that you can use some Matlab "tricks" to prevent copying.<br></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr"><br>Jason<br><a href="http://moorepants.info" target="_blank">moorepants.info</a><br><span>+01 <a href="tel:530-601-9791" value="+15306019791" target="_blank">530-601-9791</a></span><br></div></div></div>
<br><div class="gmail_quote"><div><div>On Thu, Dec 18, 2014 at 9:49 AM, Hashemi, Reza <span dir="ltr"><<a href="mailto:Reza.Hashemi@bci.tu-dortmund.de" target="_blank">Reza.Hashemi@bci.tu-dortmund.de</a>></span> wrote:</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal">Hello everyone,<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">I am facing a problem in using IPOPT which some of you might have experience with it.<u></u><u></u></p><p class="MsoNormal">In the context of the optimal control, I am using the IPOPT to solve a huge NLP problem with 32,005 variables. Since the model is very complex, up to now, I have used the numeric Jacobians. I provide the numeric Jacobians using the MATLAB internal function <b>numjac</b> and I am able to produce some results.<u></u><u></u></p><p class="MsoNormal">Since I need to accelerate the convergence of the algorithm, I have created a function which supplies the analytical Jacobian of the constraints (The Jacobian has a size of 32000x32005).<u></u><u></u></p><p class="MsoNormal">Surprisingly, when I am using the analytical Jacobian, the IPOPT runs out of memory or becomes torturingly slow.<u></u><u></u></p><p class="MsoNormal">I am pretty sure that the analytical Jacobian is correct. Moreover, I compare the analytical Jacobian and the numeric one at each step and do not see a large difference…<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Does anyone know what might be the possible reason for this strange behavior of IPOPT?<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Thanks in advance.<u></u><u></u></p><p class="MsoNormal">Reza<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal" style="text-autospace:none"><b><span style="color:#1f497d" lang="DE">Reza Hashemi, M.Sc.<u></u><u></u></span></b></p><p class="MsoNormal"><span style="color:#1f497d" lang="DE">Lehrstuhl für Systemdynamik und Prozessführung / Process Dynamics and Operations Group<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d">Fakultät Bio- und Chemieingenieurwesen</span><span style="color:#1f497d"> / Biochemical and Chemical Engineering Department<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="DE">TU Dortmund<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="DE">Emil-Figge-Str. 70<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="DE">44221 Dortmund, Germany<u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="DE"><u></u> <u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="DE">Phone: <a href="tel:%28%2B49%2F0%29%20231%20755%205165" value="+492317555165" target="_blank">(+49/0) 231 755 5165</a> Fax: <a href="tel:%28%2B49%2F0%29%20231%20755%205129" value="+492317555129" target="_blank">(+49/0) 231 755 5129</a><u></u><u></u></span></p><p class="MsoNormal"><span style="color:#1f497d" lang="DE"><a href="http://www.dyn.bci.tu-dortmund.de" target="_blank">www.dyn.bci.tu-dortmund.de</a><u></u><u></u></span></p><p class="MsoNormal"><span lang="DE"><u></u> <u></u></span></p><p class="MsoNormal"><u></u> <u></u></p></div></div><br></div></div>_______________________________________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org" target="_blank">Ipopt@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
<br></blockquote></div></div>
<br>_______________________________________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org" target="_blank">Ipopt@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/ipopt" target="_blank">http://list.coin-or.org/mailman/listinfo/ipopt</a><br>
<br></blockquote></div></div>
</div></div></blockquote></div></div></div></div>
</div></div></div>