I think the problem is that you use f.diff(tau) instead of f(tau).diff(tau). The first evaluates to 0, because it doesn't know that f depends on tau.
Aaron Meurer On Apr 25, 2010, at 6:02 PM, Alan Bromborsky wrote: > Here is code - > > dRdtau = R.diff(tau) > print 'e_tau =',dRdtau > dRdtau_sq = (dRdtau|dRdtau)() > print 'e_tau^2 =',dRdtau_sq > dRdtau_sq = trigsimp(simplify(dRdtau_sq)) > print 'e_tau^2 =',dRdtau_sq > dRdtau_sq.subs((g.diff(tau))**2-(f.diff(tau))**2,1) > print 'e_tau^2 =',dRdtau_sq > > Here is output - > > e_tau = > D(g(tau),tau)*e0+(D(f(tau),tau)*cos(th(tau,xth))-D(th(tau,xth),tau)*f(tau)*sin(th(tau,xth)))*e1+(D(f(tau),tau)*sin(th(tau,xth))+D(th(tau,xth),tau)*cos(th(tau,xth))*f(tau))*e2 > e_tau^2 = D(g(tau), tau)**2 - (D(f(tau), tau)*cos(th(tau, xth)) - D(th(tau, > xth), tau)*f(tau)*sin(th(tau, xth)))**2 - (D(f(tau), tau)*sin(th(tau, xth)) + > D(th(tau, xth), tau)*cos(th(tau, xth))*f(tau))**2 > e_tau^2 = D(g(tau), tau)**2 - D(f(tau), tau)**2 - D(th(tau, xth), > tau)**2*f(tau)**2 > e_tau^2 = D(g(tau), tau)**2 - D(f(tau), tau)**2 - D(th(tau, xth), > tau)**2*f(tau)**2 > > A constraint is that - > > D(g(tau), tau)**2 - D(f(tau), tau)**2 = 1 > > My use of subs does not do that. How can I make such a substitution? > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
