[Ipopt] Ipopt Digest, Vol 38, Issue 8

Stefan Vigerske stefan at math.hu-berlin.de
Tue Feb 26 14:37:23 EST 2008


ZhangWeizhong wrote:
> hI, all:     Now the problem is " Invalid number in NLP function or derivative detected"     And  number of iteration is "0"    Can anyone give me any suggestions?

Probably your code that computes function values and jacobian returns an
invalid number.
>From the valgrind message you send I would guess that you might not set
all values in the arrays that Ipopt provides you when it asks for a
function or jacobian evaluation.

You should make sure that you implemented the evaluation routines
eval_f, eval_grad_f, eval_g, and eval_jac_g such that you return correct
numbers in obj_value, grad_f, g, and values, repectively.
E.g., in the eval_jac_g routine make sure that you have set all nele_jac
entries of values and did not leave some out.
Also you should not assume that values array is initialized with 0'th.

Adding some printf's in your evaluation routines that tell which values
you return to Ipopt should help to find the problem.

(Andreas, you could make this error message a bit clearer by at least
telling whether it was a function value or a gradient :-).)


Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics

More information about the Ipopt mailing list