Thanks in advance!
Pradeep
Purdue University
Pradeep,
I presume you are trying to solve the following linear PDE, where x is
the radial coordinate
D[u[t, x], t] == 1 + D[u[t, x], x, x] + D[u[t, x], x]/x
and the difficulty is the term with 1/x which becomes indeterminate at
x=0. If you apply l'Hopital's rule you find that the appropriate PDE
at x=0 is
D[u[t, x], t] == 1 + 2 D[u[t, x], x, x] at x=0
Thus to solve this system of PDEs we construct the following helper
functions
g1[x_ /; x > 0] := 1
g1[x_ /; x == 0] := 2
g2[x_ /; x > 0] := 1/x
g2[x_ /; x == 0] := 0
sol = NDSolve[{D[u[t, x], t] ==
1 + g1[x] D[u[t, x], x, x] + g2[x] D[u[t, x], x], u[0, x] == 0,
Derivative[0, 1][u][t, 0] == 0, u[t, 1] == 0}, u, {t, 0, 10}, {x,=
0, 1}]
And here is a plot of the solution at various time intervals
Plot[Evaluate[{u[0.02, x], u[0.08, x], u[0.1, x], u[0.4, x], u[1, x],
u[5, x]} /. sol], {x, 0, 1}]
Cheers,
Brian