0
$\begingroup$

I need to calculate the Gâteaux derivatives of some functional, and I started playing a bit with very simple cases. I know there's the VariationalMethods package that's required, but I don't know how to make things work in higher dimensions.

Let's say I want to calculate the derivative with respect to $u$ of

$$ J(u) = \frac{1}{2} \int |\nabla u|^2 dx.$$

If I am in dimension 1, I type VariationalD[1/2 u'[x]^2 , u[x], x] and it gives me -u''[x] as it's supposed to be, but I can't seem to make it work in higher dimensions. How should I write that?

I tried using Norm[Grad[u[x], {x}]^2 but it doesn't work, I'm doing some mistake with the syntax.

$\endgroup$
5
  • 1
    $\begingroup$ I do not know what a Gâteaux derivative is, but in higher dimension you need the notion of a directional derivative. $\endgroup$ Commented May 31, 2022 at 10:29
  • $\begingroup$ It's exactly that. A directional derivative where the direction is a function though. It's a generalization in infinite dimensional spaces $\endgroup$
    – tommy1996q
    Commented May 31, 2022 at 10:39
  • 1
    $\begingroup$ The directional derivative is defined as: "Grad[f,vars]. dir" where dir is the direction. There are different definitions where dir is a unit vector or not. E.g. a derivative along {1,1} using a unit vector: Grad[3 x^2 y, {x, y}] . {1, 1}/Sqrt[2] $\endgroup$ Commented May 31, 2022 at 10:56
  • 2
    $\begingroup$ The second two examples in the Documentation show how to do this: reference.wolfram.com/language/VariationalMethods/ref/… I think this is what you want. $\endgroup$ Commented Jun 2, 2022 at 1:09
  • $\begingroup$ Yes! Can't believe I missed that! Thanks! $\endgroup$
    – tommy1996q
    Commented Jun 2, 2022 at 12:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.