I'm trying to figure out how to do a simple substitution. I've the
following code:

var('r beta beta_0 R a h')
psi=function('psi',r)
sigma=function('sigma',r)

H_0=function('H_0',r)

H_grad = lambda psi : (1/2)*(beta/beta_0)*R^2*(psi.diff(r))^2
H_0(psi) = -(1/2)*(beta/beta_0-1)*psi^2 + beta*a*psi^4 + beta*h*psi

H_1=H_grad((1/R)*(beta_0/beta)^(1/2)*sigma)
H=H_1+H_0((1/R)*(beta_0/beta)^(1/2)*sigma)

H=H.simplify_radical().expand().collect(sigma^2)
H

Let's say I want to rewrite the coefficient on sigma^2 as simply
epsilon, how can I do that?

When I try a simpler example, it's straightforward but the same thing
doesn't seem to work on the expression above:

var('a b c')
f(x)=(a+b)*x^2
f.subs(a+b==c)




--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to