Open Xiaobing-Shen opened 3 years ago
Looks like there are some NaNs/Infinity coming from the calculations, possibly causing the problems.
I would recommend running again with the following options to help debug:
Print frequency 1
Summary frequency 1
System information Yes
Verify level 3
Major Print level 11
Minor print level 11
Solution Yes
Verify level 3
in particular will check your derivatives. You should look at the output to make sure all of the derivatives are "ok". Any potentially incorrect derivatives will be marked with "bad?" in the output.
Thanks for your suggestions. I just checked the derivative and found the following information.
Itn 0: Making the linear rows feasible
Itn 0: Feasible linear rows
Itn 0: PP1. Minimizing Norm(x-x0)
Itn 0: Feasible norm(x-x0) problem
Minor NonOpt LP mult LP Step LP objective
0 0.0000000E+00
Itn 0: PP1. Norm(x-x0) approximately minimized (0.00E+00)
The user has defined 262 out of 262 first derivatives
SNOPTA EXIT 50 -- error in the user-supplied functions
SNOPTA INFO 51 -- incorrect objective derivatives
Problem name NetFlow
No. of iterations 0 Objective 6.5000000000E+01
No. of major iterations 0 Linear obj. term 0.0000000000E+00
Penalty parameter -1.111E+04 Nonlinear obj. term 6.5000000000E+01
User function calls (total) 76
No. of degenerate steps 0 Percentage 0.00
Max x 3 6.7E+01 Max pi 1 0.0E+00
Max Primal infeas 81 7.8E+01 Max Dual infeas 32 1.9E-01
Nonlinear constraint violn 7.8E+01
My objective function is $$f(x) = c\sqrt{x}$$ and I used $\frac{c}{2}*\max(x, 1e-6)^{-1/2}$ as the gradient. I do not know why the information shows that the objective derivatives is incorrect.
Look inside the print output file and check which derivatives are incorrect.
If you don't have an output file, then re-run with options.printfile
set to an output file name (e.g., options.printfile = 'myoutput.out'
).
Hi @gnowzil ,
I corrected the objective function and its gradient. From the .out file, all of my derivatives are OK. But the problem is I still got the
SNOPTA EXIT 40 -- terminated after numerical difficulties
SNOPTA INFO 41 -- current point cannot be improved
Does that means this initial point is a local minimum and we cannot improve it?
Here is my .out file.
It looks like there is still an issue with your objective gradient. I see the following in your output
XXX The objective gradients seem to be incorrect.
Gradient projected in one direction 1.60007623746E-03
Difference approximation 1.34250615375E+02
Sometimes, the .out will show the objective gradient is wrong. But when the objective gradient is ok, I got the same exit info.
When I use snopt to solve a nonlinear problem, it always shows “SNOPTA EXIT 40 -- terminated after numerical difficulties” even I give the optimal solution as the initial solution.
Here is the output:
It seems it runs nothing. Can anyone help me with this?