1
$\begingroup$

I have this equation:

  EOM1 = Subscript[x1, t, t] + ω1^2*x1 /. 
    Subscript[x1_, m__] :> D[x1[x, t], m] /. 
      x1 -> x1[x, t]

The problem with the rule is that it doubles the argument. How can I avoid writing the arguments [x,t] twice.

Thanks

$\endgroup$

2 Answers 2

1
$\begingroup$

Please try this:

 EOM1 = Subscript[x1, t, t] + \[Omega]1^2*x1[x, t] /. 
   Subscript[x1_, m__] :> D[x1[x, t], m] /. x1 -> x1[x, t] /. x1[x, t] -> x1

Output expression

$\endgroup$
0
$\begingroup$

I am not sure I understand your meaning, but if write

EOM1 = Subscript[x1, t, t] + ω1^2*x1 /. 
Subscript[x1_, m__] :> D[x1[x, t], m] /. 
  x1 -> x1

you obtain

x1 \[Omega]1^2+(x1^(0,2))[x,t]
$\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.