[Ipopt] Huge number of variables problem

Jonas Koenemann Jonas.Koenemann at imtek.de
Tue Apr 30 03:41:14 EDT 2019


You can also have a look at CasADi which is fast, and easy to use from python, matlab, and also usable from c++.

Jonas

From: Stefan Vigerske
Sent: Tuesday, April 30, 2019 5:09 AM
To: To To
Cc: ipopt at list.coin-or.org
Subject: Re: [Ipopt] Huge number of variables problem

Hi,

if-else and for-loops are not incompatible to each other in general.

ADOL-C and CppAD are C++ AD tools that provide specialized interfaces to 
Ipopt.
See also the list at https://urldefense.proofpoint.com/v2/url?u=https-3A__coin-2Dor.github.io_Ipopt_index.html-23HOWTOUSE&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=2rscMOYKChjkbdHadHebHWj9J-ZdIUzDBZGUV2uBLc8&m=Now9Vz83DsXDOxlV_DCpaUstibK4FssnSoR49vzG_-I&s=DM2MG9qj8LcnQgVjCowg1kDx-n8F-5m7bjVGnqGrBEw&e=

Stefan

On 4/29/19 6:53 PM, To To wrote:
> Hi Stefan,
> 
> Thank you for your suggestion. It was found that the evaluation of jacobian
> of constraints took too much time, and it was due to the if-else used in
> the for-loop when forming the jacobian. Another version of jacobian was
> done without any if-else, then the evaluation of jacobian becomes much much
> quicker. For now, it was shown that the searching direction calculation
> take most of the time (which is supposed to be I guess?), all function and
> derivative evaluations take very little time.
> 
> May I ask is this simply due to the extra calls of if-else that costs much
> more time? Or some other mechanism related with C++ when including if-else
> in the for loop?
> 
> Moreover, is that possible to use automatic differentiation tools to
> generate source transformation codes for jacobian and hessian? I tried some
> AD tools using operator overloading, but with large number of variables
> these tools crash often. If possible, could you recommend AD tools with
> source transformation to be used with IPOPT C++ interface?
> 
> Thank you very much.
> 
> On Mon, Apr 29, 2019 at 4:36 AM Stefan Vigerske <stefan at math.hu-berlin.de>
> wrote:
> 
>> Hi,
>>
>> loops are ok, as long as you use them efficiently.
>> You can run Ipopt with option print_timing_statistics set to yes to get
>> more information about where time is spend.
>>
>> Stefan
>>
>> On 4/28/19 8:15 PM, To To wrote:
>>> Dear all,
>>>
>>> I'm using IPOPT 3.12.12 with the provided C++ interface under Ubuntu
>> 18.04.
>>> I formulated a relatively simple NLP and it works.
>>>
>>> I am totally new to C++, so I form my constraint and jacobian all with
>> for
>>> loop. May I ask is it the best way to formulate constraints and jacobian
>>> using for loop? I tired to increase the number of NLP variables to around
>>> 300000, and I have around 200000 constraints (very sparse). I found that
>> it
>>> is very slow when computing.
>>>
>>> Should I be careful when forming such a big problem with provided C++
>>> interface? Or should I use some other libraries such as EIGEN to better
>>> form the jacobian?
>>>
>>> Thank you very much.
>>>
>>>
>>> _______________________________________________
>>> Ipopt mailing list
>>> Ipopt at list.coin-or.org
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_ipopt&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=2rscMOYKChjkbdHadHebHWj9J-ZdIUzDBZGUV2uBLc8&m=Now9Vz83DsXDOxlV_DCpaUstibK4FssnSoR49vzG_-I&s=uoRQHPGXADVFfy-Ko7MHY3kmdUS7kgWU23_9wq7yPhY&e=
>>>
>>
>>
> 

_______________________________________________
Ipopt mailing list
Ipopt at list.coin-or.org
https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_ipopt&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=2rscMOYKChjkbdHadHebHWj9J-ZdIUzDBZGUV2uBLc8&m=Now9Vz83DsXDOxlV_DCpaUstibK4FssnSoR49vzG_-I&s=uoRQHPGXADVFfy-Ko7MHY3kmdUS7kgWU23_9wq7yPhY&e=

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20190430/f67fb78c/attachment.html>


More information about the Ipopt mailing list