Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One way to approach this differential equation numerically is:

var('r,t')
c1=0.2
c2=10
c3=5
c4=4
g(r,t)=c1*(c2-c3/r)*(1/r+1/sqrt(c4*t))
f=[SR(1),g(r,t)]
soln1=desolve_odeint(f,[1,1],srange(0,10,0.05),[t,r])
p=line(soln1)
p+=plot_vector_field([1/sqrt(1+g(t,r)^2),g(t,r)/sqrt(1+g(t,r)^2)],(t,0,10),(r,0,10))
show(p)

From a local installation of Sage, you can also use maxima to launch a window that contains the direction field and allows you to click in the window to indicate your initial condition.

maxima('plotdf([1,.2*(10-5/r)*(1/r+1/sqrt(4*t))],[t,r],[t,0,10],[r,0,10])')

Finally, for an option outside of Sage that is very nice, I also recommend using pplane and dfield at: http://math.rice.edu/~dfield/dfpp.html