# [ADOL-C] Use ADOL-C on a Function Performing a 1-D Optimization and an Interpolation

Kshitij Kulshreshtha kshitij at math.upb.de
Mon Feb 23 12:59:52 EST 2015

```Hello,

you could try the following:

Firstly compute the 1-D optimal point without the use of ADOL-C with
simple double variables. Once you have the optimal point, evaluate the
interpolation at this point within trace_on() trace_off() using adouble
variables. Then you can call gradient() and get the derivative of the
function at the optimal point.

This means that you need to recreate the trace after each 1-D
optimization step.

It does not see the whole dependency graph due to programming error, or
you are evaluating the derivative w.r.t. the optimization variables at
the local optimal point. In the second case getting an exact zero is
rather unusual, you should get some very small numbers around machine
precision.

Best wishes
Kshitij.

On 2015-02-20 16:18, Shantanu MULLICK wrote:
> Hello,
>
> I need to differentiate a function which requires me to first compute a
> 3-D interpolation, and then do a 1-D optimization using Brent's
> algorithm. I want to know if I can use ADOL-C to differentiate a
> function like this.
>
> I'm particularly concerned by the 1-D optimisation that my function
> performs. It would probably be important to see how the 1-D optimiser is
> coded to decide if ADOL-C can work on it.  The C code for the 1-D
> optimizer using Brent's algorithm can be found
> here: http://people.sc.fsu.edu/~jburkardt/c_src/brent/brent.c  ( I use
> the function "local_min").
>
> There was a previous query on performing ADOL-C on linear interpolation
> guess I can adapt the answer given here to perform 3-D linear interpolation.
>
> I have another question. I previous tried to treat the interpolation and
> the optimizer part of the function as "constants" (not adoubles ). When
> I do this, and use the "gradient" driver to find the derivative, I get
> all zeros as a result ( Despite the "gradient" driver saying that the
> function is locally analytic). My question is what are the most common
> reasons that would lead ADOL-C to return zeros while using the
>
>
> Shantanu,
>
> PhD Candidate at ESSEC
>
>
> _______________________________________________
>

--
Dr. Kshitij Kulshreshtha

Institut für Mathematik,