[CppAD] Multiple Levels of AD
Mathias Wagner
mathias.wagner at physik.tu-darmstadt.de
Sat Jul 19 03:31:29 EDT 2008
Hi,
I just started using algorithmic differentiation. I wonder wether it
is possible to get the derivative of a function as an ADFun object of
the same level.
I have looked into the mul_level example, but this is not enough for
my purpose.
I would like to use it for solving a differential equation
d/dk f_k(x) = 1/(1+f_k''(x))
f_k''(x) denotes the second derivative w.r.t. to x. The value of is
not changed during the iteration.
f_0 is given analytically.
So for example I can start with
f_1(x) = f_0(x) + 1/(1+f''_0(x)) as a first step.
Using the approach described in mul_level I can define f_0 using
ADDDouble and get f_0(x) as ADDouble so I can differentiate f''_0(x).
In the next steps in the iteration I end up with
f_2(x) = f_1(x) + 1/(1+f''_1(x))
which I can calculate because I can calculate the derivatives of f_1(x).
But this value will then be a double and I cannot differentiate it.
I hope you can understand my problem.
Is there any way to get this done using AD? I expect it to be very
slow, because it probably requires to keep the full history of the
iteration of f_k, but this should be acceptable.
Mathias
--
// ***************************************************************
// ** Mathias Wagner **
// ** Institut fuer Kernphysik, TU Darmstadt **
// ** Schlossgartenstr. 9, 64289 Darmstadt, Germany **
// ** **
// ** email: mathias.wagner at physik.tu-darmstadt.de **
// ** www : http://crunch.ikp.physik.tu-darmstadt.de/~wagner **
// ***************************************************************
More information about the CppAD
mailing list