Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Substitute variable in differential equation

I have

gamma=var('gamma', latex_name=r'\gamma')
m = function('m')(r)
V=function('V')(r)
phi=gamma*m(r)/r
divG = (diff(diff(phi,r),r)+2/r*diff(phi,r)).full_simplify()

which describes a spherical symmetric source term of a field. Now I want to get this as a function of volume, not of radius and tried:

V(r)=4*pi*r^3/3
a=divG.subs(r=V(r))
b=divG.substitute_function(r,V(r))

I expect the term to be 12piV*d²/dV²m(V), but neither a or b seem to get me near that result. Obviously I am missing something basic.

Substitute variable in differential equation

I have

gamma=var('gamma', latex_name=r'\gamma')
m = function('m')(r)
V=function('V')(r)
phi=gamma*m(r)/r
phi=m(r)/r
divG = (diff(diff(phi,r),r)+2/r*diff(phi,r)).full_simplify()

which describes a spherical symmetric source term of a field. Now I want to get this as a function of volume, not of radius and tried:

V(r)=4*pi*r^3/3
a=divG.subs(r=V(r))
b=divG.substitute_function(r,V(r))

I expect the term Which gets me nothing - How to be 12piV*d²/dV²m(V), but neither a or b seem to get me near that result. Obviously I am missing something basic.solve this?

Substitute variable in differential equation

I have

m = function('m')(r)
V=function('V')(r)
phi=m(r)/r
V = function('V')(r)
phi = m(r)/r
V = 4*pi*r^3/3
divG = (diff(diff(phi,r),r)+2/r*diff(phi,r)).full_simplify()
(diff(phi,r,2)+2/r*diff(phi,r)).full_simplify()

which describes a spherical symmetric source term of a field. field, nice. Now I want to get this as a function of volume, not of radius and tried:

V(r)=4*pi*r^3/3
a=divG.subs(r=V(r))

Which But it gets me nothing nowhere - It should also substitute the differentials - How to solve this?

Substitute variable in differential equation

I have

m = function('m')(r)
V = function('V')(r)
phi = m(r)/r
V = 4*pi*r^3/3
divG = (diff(phi,r,2)+2/r*diff(phi,r)).full_simplify()

!tex [4 \, {\left(3 \, \pi V \frac{\partial^{2}}{(\partial V)^{2}}m\left(V\right) + 2 \, \pi \frac{\partial}{\partial V}m\left(V\right)\right)} {\gamma}]

which describes a spherical symmetric source term of a field, nice. Now I want to get this as a function of volume, not of radius and tried:

a=divG.subs(r=V(r))

But it gets me nowhere - It should also substitute the differentials - How to solve this?

Substitute variable in differential equation

I have

m = function('m')(r)
V = function('V')(r)
phi = m(r)/r
V = 4*pi*r^3/3
divG = (diff(phi,r,2)+2/r*diff(phi,r)).full_simplify()

!tex [4 \, {\left(3 \, \pi V \frac{\partial^{2}}{(\partial V)^{2}}m\left(V\right) + 2 \, \pi \frac{\partial}{\partial V}m\left(V\right)\right)} {\gamma}]

which describes a spherical symmetric source term of a field, nice. Now I want to get this as a function of volume, not of radius and tried:

a=divG.subs(r=V(r))

But it gets me nowhere - It should also substitute the differentials - How to solve this?