[Ipopt] Problems in models in C++/ Initialization does not succeed

Dan yanndan at yahoo.com
Wed Feb 9 08:01:41 EST 2011

Thank you Hans for your answer.
I am running this program under ubuntu 10.04 coding with CodeBlocks 8.02.I tried your idea of using Valgrind. Code::Blocks does not seem to redirect all the printings to the terminal.  Thanks to valgrind, I was able to see an error message I was missing for a long time.:**********************************************************************Exception of type: OPTION_INVALID in file "../../../../Ipopt/src/Common/IpOptionsList.cpp" at line 638: Exception message: Read Option: "jacobian". It is not a valid option. Check the list of available options.

*** Error during initialization!*********************************************************************
This error seems to come from the piece of code below. I now have an exit error if initialization does not suceed. It is strange this error occurs in this code. 
When I coded my example in hs_071 way, the same piece of code does not return any error.***********************************************************************
// Create an instance of the IpoptApplication//// We are using the factory, since this allows us to compile this// example with an Ipopt Windows DLLSmartPtr<IpoptApplication> app = IpoptApplicationFactory();
// Change some options// Note: The following choices are only examples, they might not be//       suitable for your optimization problem.app->Options()->SetNumericValue("tol", 1e-7);app->Options()->SetStringValue("mu_strategy", "adaptive");app->Options()->SetStringValue("output_file", "ipopt.out");app->Options()->SetStringValue( "jacobian_approximation","finite-difference-values" );app->Options()->SetStringValue( "derivative_test","first-order" );
// Intialize the IpoptApplication and process the optionsApplicationReturnStatus status;status = app->Initialize();if (status != Solve_Succeeded) {printf("\n\n*** Error during initialization!\n");exit(-1);}
I do not understand why there is an initialization problem in this case. I run valgrind to see if there was any memory leak. The code previous at this step of initialization  does not seem to have any. 
If you have any idea how to solve this initialization bug, I will be glad to know them.
Best Regards, Dan

--- En date de : Mer 9.2.11, Hans Pirnay <hans.pirnay at rwth-aachen.de> a écrit :

De: Hans Pirnay <hans.pirnay at rwth-aachen.de>
Objet: Re: [Ipopt] Problems in models in C++
À: "Dan" <yanndan at yahoo.com>
Cc: ipopt at list.coin-or.org
Date: Mercredi 9 février 2011, 11h37

If you are on linux: use valgrind to figure out if your problems may be due to uninitialized values

On Wed, Feb 9, 2011 at 10:57 AM, Dan <yanndan at yahoo.com> wrote:

Dear all,

I have a problem with the C++ Interface. I am currently coding some network models. I tried to model a small instance like the hs_071 example and it went well.

I coded my network in term of functions that my TNLP class will called if needed.  
When I run it, it does not find a solution and it goes into a loop.I caught this message run by IPOPT:"WARNING : Problem in step computation; switching to emergency code."

In order to solve my problem, I tried several thing including the derivative checker and two weird things appears:
my jacobian is not dense. I can not figure why. I checked at almost step and I can not find why the derivative checker of my jacobian is dense.the value found by the derivative checker are eccentric. It says mine are wrong while they are not. It is a adjacency matrix so it is only 1 and -1.
If you have any ideas to solve my problem of ways to find my errors, I would greatly appreciate.



Ipopt mailing list

Ipopt at list.coin-or.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/ipopt/attachments/20110209/6d4c9781/attachment-0001.html 

More information about the Ipopt mailing list