So I copied and modified that start of schwarzschild.cnb to my own notebook which I'll call Laplacian.cnb
I modified the first code block to add some more coordinates vr, vtheta, vphi (intended to represent velocities -- I'm working in velocity phase space).
{t,r,\theta,\phi, vt, vr, vtheta, vphi}::Coordinate;
{\mu,\nu,\rho,\sigma,\lambda,\kappa,\chi,\gamma}::Indices(values={t,r,\phi,\theta}, position=fixed);
\partial{#}::PartialDerivative;
g_{\mu\nu}::Metric.
g^{\mu\nu}::InverseMetric.
Now I try to define a simple (scalar) function
f, which is just f() = r + vtheta**2
and try to evaluate \partial_r f
. My code block is
f::Depends(r,\theta,\phi, vr, vtheta, vphi);
exf:= { f = r + vtheta**2 } ;
exfr:= { fr = \partial_r{f} };
evaluate(exfr,exf);
The final line of output is just \partial_r f
.
I.e., it didn't perform the partial derivative.
(The answer should have been 1.)
What am I doing wrong?