Ask Your Question

Revision history [back]

Try this.

sage: eqTest.subs({dphi_x:p_x/m})
t |--> E == 1/2*m*omega^2*\phi_x(t)^2 + 1/2*p_x(t)^2/m

Try this.In this case, substituting an expression with subs and a substitution dictionary seems to work.

So we can avoid using substitute_function.

Example:

sage: eqTest.subs({dphi_x:p_x/m})
t |--> E == 1/2*m*omega^2*\phi_x(t)^2 + 1/2*p_x(t)^2/m

In this case, substituting an expression with subs and a substitution dictionary seems to work.

So we can avoid using substitute_function.

Example:

sage: eqTest.subs({dphi_x:p_x/m})
eqTest.subs({dphi_x: p_x/m})
t |--> E == 1/2*m*omega^2*\phi_x(t)^2 + 1/2*p_x(t)^2/m