We are trying to use AMPL and KNITRO to solve an optimization problem. Specifically, we use Python/pandas to process data, and AMPL to formulate the problem and specify the solver (KNITRO). Then we use the amplpy package to pass the data from Python to AMPL, and AMPL calls the solver to take care of the rest.
In our problem, we do not have the functional forms for the derivative information, and would like AMPL to derive it automatically. Two questions are as follows:
First, we notice that there are several KNITRO options (e.g., gradopt, hessopt, etc.) regarding derivative calculation. In our case, how should we specify KNITRO options (maybe AMPL options as well) so that we make sure AMPL performs automatic differentiation and feeds that information to KNITRO? Note that this means KNITRO does not perform derivative calculation, but instead, uses that information provided by AMPL.
Second, we also notice that even if we do not provide derivative information, specifying gradopt and hessopt to be 1 still makes the program run and converge. In this case, what is the assumption on the derivative information?
Thank you very much for your help!