2

I wanted to use the VariationalD command to calculate a list of variational derivatives.

A simple example is the following and it works perfectly fine.

Needs["VariationalMethods`"];
VariationalD[
 r^3 Sin[f[r]] Cos[g[r]] Sin[b] f'[r]^2 g''[r] + 
  d'[r, y]^2 h''[r, x] Log[r], {f[r], g[r], d[r], h[r]}, r] 

When I use the same command for what I want to calculate, I get a very weird message that I don't understand.

This is the command

VariationalD[
 r^3 Sin[x1]^2 Sin[x2] Sin[
   qb[r]]^3 Sqrt[(1 + r^2 Derivative[1][qb][r]^2)] (1 - 
    1/(L^2 (2 + 2 r^2 Derivative[1][qb][r]^2))
      Csc[x1]^4 Csc[x2]^2 Csc[
      qb[r]]^2 (r^2 Sin[
         x1]^2 (-fbc3r[c3, 
            r]^2 + (-fbc2r[c2, r]^2 - fbc1r[c1, r]^2 Sin[x1]^2) Sin[
            x2]^2) - 
       Csc[qb[r]]^2 (fbc2c3[c2, c3]^2 + fbc1c3[c1, c3]^2 Sin[x1]^2 + 
          fbc1c2[c1, c2]^2 Sin[x1]^2 Sin[x2]^2) (1 + 
          r^2 Derivative[1][qb][r]^2))), {qb[r], fbc3r[c3, r], 
  fbc2r[c2, r], fbc1r[c1, r], fbc1c3[c1, c3], fbc1c2[c1, c2], 
  fbc2c3[c2, c3]}, r]

And this is the error message

VariationalD::argx: The second argument of VariationalD is a list of unknown functions depending on {r}.

VariationalD::args: VariationalD takes a single integrand, a function or list of functions, and a list of variables as input.

Practically, I write the same command twice and I just modify what I need to calculate and it generates the above errors.

Thanks in advance.

  • 1
    Looking at the definition using Spelunk@VariationalD (see (1742)), it seems VariationalD requires every function listed in its second argument to have the same pattern of arguments listed in its third argument, in the same order. – jjc385 Apr 13 '18 at 14:13
  • It also looks like the second error message will fire whenever the first does. – jjc385 Apr 13 '18 at 14:15
  • @jjc385 While this is helpful, even after I reorganised the arguments as [r,c1] and so on, it produces the errors. –  Apr 13 '18 at 15:21

0 Answers0