ForwardDiff for functions of several (vector) variables?

question
#1

Is it possible to use ForwardDiff for functions of several variables? In particular, consider a scalar function L(x,u) of two vector variables x and u. I want to compute the gradient of L() with respect to x.

From the documentation it appears that currently ForwardDiff can only compute derivatives and gradients for functions of a single (vector) variable. Any way?

0 Likes

#2

Pass x -> L(x, u) to ForwardDiff.

3 Likes

#3

Many thanks. Besides having my question answered, I think that I am now significantly closer to understanding anonymous functions in Julia.

0 Likes