<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi all,<div class=""><br class=""></div><div class="">I have a problem with the derivative checker that’s been puzzling me lately.</div><div class=""><br class=""></div><div class="">I use IPOPT to solve very large NLP problems, with sometimes 10,000+ variables and thousands of constraints. I’m using IPOPT 3.12.4, MA57 solver, on MATLAB R2015b and Mac OS X 10.11.4. The size of the problem comes from defining the states, controls, and dynamics of a model on a temporal grid (a “direct collocation” problem) with a certain number of nodes on that grid. I can dictate the size of the problem by specifying the number of nodes.</div><div class=""><br class=""></div><div class="">The derivative test will often report errors that appear to be inaccurate. For example:</div><div class=""><br class=""></div><div class="">* jac_g [ 44, 44] = -3.4357799114574522e-01 v ~ 0.0000000000000000e+00 [ 3.436e-01]</div><div class=""><br class=""></div><div class="">I’m very confident that the derivative of my 44th constraint with respect to my 44th variable is non-zero. I’ve verified this by visual inspection of the constraint equation, by the form of the equation in my constraints Jacobian, which is generated using symbolic dynamics software, and by performing my own hand-coded finite differencing of this constraint. Here is the specified constraint equation from above:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">f(44) = Fo20*Act20*FL20*FV20 - Fsec20;</div></div><div class=""><br class=""></div><div class="">where FL20 and Fsec20 are both functions of the 44th variable. Here is the specified derivative of that equation with respect to the 44th variable:</div><div class=""><br class=""></div><div class=""><div class="" style="margin: 0px; font-size: 10px; line-height: normal; font-family: Courier;">dfdx(44,44) = Fo20*(Csec*Ksec*exp(Ksec*(-1+(Lm20-Lcc20)/Lu20))/Lu20-2*Act20*(-1+Lcc20/La20)*exp(-(-1+Lcc20/La20)^2/W20^2)*FV20/(W20^2*La20));</div><div class="" style="margin: 0px; line-height: normal; font-family: Courier; min-height: 14px;"><br class=""></div></div><div class="">where all of the variables in that equation have non-zero values. I’ve noticed that these errors seem to appear when the NLP problem gets above a certain size. For smaller problems (few nodes) with the same model, the derivative test passes. Regardless of the size or the success of the derivative check, the model seems to work (converges with acceptable tolerances and produces expected and reasonable results for my problem).</div><div class=""><br class=""></div><div class="">Is there any reason the accuracy of the derivative test would break down for larger problems, or is it more likely there is a mistake in my code somewhere that I’m missing? I’ve tried playing around with the value of <span class="" style="font-family: Courier; font-size: 10px;">derivative_test_perturbation</span> to no effect. </div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Ross</div><div class=""><br class=""><div class=""><div class="">=======================<br class="">Ross H. Miller, Ph.D.<br class="">Assistant Professor<br class="">Department of Kinesiology<br class="">University of Maryland<br class="">Office:<span class="Apple-tab-span" style="white-space: pre;"> </span>2134A SPH Building<br class="">Phone:<span class="Apple-tab-span" style="white-space: pre;"> </span>301-405-2495<br class="">Email:<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="mailto:rosshm@umd.edu" class="">rosshm@umd.edu</a><br class="">Web:<span class="Apple-tab-span" style="white-space: pre;"> </span><a href="http://scholar.google.com/citations?user=TKkdWHMAAAAJ&hl=en" class="">Google Scholar</a></div></div></div></body></html>