I have a feeling the solution to my problem is very simple… but my knowledge of differential equations is pretty weak.
I am trying to solve a scalar diffusion equation (used in NMR spectroscopy, but from what I understand, modeled after heat and Fickian diffusion). I've tried following model equations, but whenever I ask Mathematica to evaluate, it returns the original equation. What am I missing here?
Here is my code:
With[{Dif = 2300, pde = D[u[t, r], t] == Dif/r*D[u[t, r]*r, r, r] -
1/(0.0945 E^(0.000212+0.4077r))*(u[t, r]+1.2004)},
soln = NDSolve[{pde, u[0, r] == 0, Derivative[0, 1][u][t, 0] == 0,
Limit[u[t, r], r -> \[Infinity]] == 0}, u, {t, 0, 10}, {r, 0, 500}]]
Upon evaluation, it returns an error stating that the equation is "overdetermined". Removing a single one of the 3 boundary conditions results in an "underdetermined" error.
Is this possible to solve using NDSolve, or do I need to break down the equation?
Thanks for the help!
Answer
As Andrew stated above, changing the lower limit to something non-zero takes care of the problem.
The following code gives a speedy answer:
With[{Dif = 2300}, pde = D[u[t, r], t] == Dif/r*D[u[t, r]*r, r, r] -
1/(0.0945 E^(0.000212 + 0.4077 r))*(u[t, r] + 1.2004);
soln = NDSolve[{pde, u[0, r] == 0, Derivative[0, 1][u][t, 10^-8] == 0,
u[t, 500] == 0}, u, {t, 0, 10}, {r, 10^-8, 500}]]
Comments
Post a Comment