How can i calculate the derivative of the discretization of an integral?

211 Views Asked by At

I have to minimize an integral of the type:

$J[f] = \int_a^b \, L(x,f,\dot{f}) \, dx $

subject to some constraints. The minimization is carried out numerically, using Ipopt library. Thus, I've discretized $J$ making use of the finite difference method for approximating the derivative of $f$ and of the Simpson method for the integral.

I have to calculate the gradient of $J$ wrt to $f$. I thought of using the functional derivative $\frac{\delta J}{\delta f}$, which can be computed analytically, but in this way the results are bad, as Ipopt optimization algorithm fails to converge.

Now, my question is:

what method may I use to calculate the derivative of $J$ wrt $f$, i.e. the derivative of an integral functional, approximated as a discrete sum, with respect to the function $f(x)$ on which it depends?

Thanks! Francesco

1

There are 1 best solutions below

0
On

This is a suggestion, not a complete solution. In my opinion, a natural approach would be to expand $f$ over B-Spline basis functions.

B-Spline basis is very interesting here because:

  • numerically stable and efficient evaluation procedures exist
  • it allows computation of $f'$, $f''$...
  • it allows integration to get the $J[f]$ functional
  • it is very versatile and you can encode some constraints directly by a proper choice of the B-Spline basis functions.

Some examples of this approach:

Unfortunately I do not know dedicated software (on github for instance)... but this must exist I guess.