0
$\begingroup$

I am trying to generalize the condition

Derivative[1, 0][ℒp][t, ϕ] -> Derivative[0, 1][ℒp][t, ϕ]/l

for $\ell$ a constant, through the following rule

rule02 = {Derivative[a_, b_][ℒp][t_, ϕ_] :> 1/l D[ℒp[t, ϕ], {t, a}, {ϕ, a}]}

However, when I consider the test

Derivative[0, 1][ℒp][t, ϕ] /. rule02    
(* ℒp[t, ϕ]/l *)

an extra factor $1/\ell$ appear. I understand that my codes replace the factor $1/\ell$ even in spatial derivatives, nonetheless, I don't know how to avoid this mistake (I am biased for my code).

$\endgroup$
4
  • $\begingroup$ Well, the factor $1/\ell$ is there because you explicitly put it there in the replacement rule. Perhaps you mean rule02 = {Derivative[a_, b_][ℒp][t_, ϕ_] :> (1/l)^a D[ℒp[t, ϕ], {t, a}, {ϕ, a}]}? $\endgroup$
    – Domen
    Commented Aug 6 at 16:18
  • $\begingroup$ @Domen, nope. I just want that equation $\dot{\mathcal{L}p}=\frac{1}{\ell}\mathcal{L}p'$ (and its further derivatives) holds. $\endgroup$
    – hyriusen
    Commented Aug 6 at 16:20
  • $\begingroup$ What do you expect your rule to do for Derivative[0, 1][ℒp][t, ϕ] (ie. what is the expected output)? $\endgroup$
    – Domen
    Commented Aug 6 at 16:29
  • $\begingroup$ I expect nothing. As I said before, I am trying to create a rule for equation $\dot{f}=\frac{1}{\ell}f'$ to hold, where $f=f(t,\phi)$. Therefore, $f'$ should give nothing new, since the time-derivative is the one that changes to a spatial one. $\endgroup$
    – hyriusen
    Commented Aug 6 at 16:48

1 Answer 1

2
$\begingroup$

If I understand correctly, you want to transform all time derivatives to spatial derivatives with the general rule:

$$\partial_t^a\partial_\phi^b \mathcal{L}(t,\phi) \mapsto (1/\ell)^a \partial_\phi^{a+b} \mathcal{L}(t,\phi).$$

So you do:

rule = Block[{t, ϕ}, {Derivative[a_, b_][ℒp][t, ϕ] :> 
  (1/l)^a Derivative[0, a + b][ℒp][t, ϕ]}];

Derivative[0, 1][ℒp][t, ϕ] /. rule
(* Derivative[0, 1][ℒp][t, ϕ] *)

Derivative[1, 0][ℒp][t, ϕ] /. rule
(* Derivative[0, 1][ℒp][t, ϕ]/l *)

Derivative[3, 4][ℒp][t, ϕ] /. rule
(* Derivative[0, 7][ℒp][t, ϕ]/l^3 *)
$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.