Question: How can I substitute an alias by a given expression?

In the code above expression #1 contains the term D(Phi)(X): how can I replace the "abstract" function Phi by a "specific" one  phi = k*X(t) ?

alias(X = X(t)):
kin := 1/2*M*diff(X, t)^2 + 1/2*m*diff(Phi, t)^2;  #1

# attempt to replace Phi by phi=k*X(t))
eval(kin, Phi=phi);                                #2 ... I expected phi would replace Phi

The attached file contains a more detailed explanation and a more general situation.

Thanks in advance

Please Wait...