I'm modeling a problem with PDEs, So I gotta solve numerically this Reaction-Diffusion Partial Differential Equation
$$ \frac{\partial u(t,x,y)}{\partial t}=D\Big( \frac{\partial^{2}u(t,x,y) }{\partial x^{2}} +\frac{\partial^{2}u(t,x,y) }{\partial y^{2}}\Big)+r\ u(t,x,y) \,\, , $$ where $D$ is the diffusion coeficient and the $r$ is a reaction coefficient (both constants). My boundary conditions are:
$$ \frac{\partial u(t,0,y)}{\partial x}=\frac{\partial u(t,x,0)}{\partial y}=\frac{\partial u(t,a,y)}{\partial x}=\frac{\partial u(t,x,b)}{\partial y}=0 \,\, , $$
and my inicial condition is:
$$ u(0,x,y)=u_{0}\delta (x) \,\, , $$
Where $\delta (x)$ is the Dirac Delta Function. I'm not able to solve this equation on mathematica yet, How could I solve this equation numerically? (I'm not very sure about the boundary conditions, if there's something worong with them, feel free to tell me.)
The code I've tried to make is this:
It defines the EDP I'm dealing.
eqd = D[u[t, x, y], t] ==
D[u[t, x, y], x, x] + D[u[t, x, y], y, y] + u[t, x, y]
It defines the domain of my problem.
\[CapitalOmega] = ImplicitRegion[0 <= x <= 100 && 0 <= y <= 100, {x, y}];
So I've tried to solve this using NDSolve, where I've changed the Dirac Delta by the constant function 100 as inicial condition, and the boundary conditions I tried to express as functions D[u[t,0,y],x]==0 and so on, this way:
NDSolve[{eqd, D[u[t, x, y], x]/.x->0 == 0, D[u[t, x, y], x]/.x->100 == 0,
D[u[t, x, y], y]/.y->0 == 0, D[u[t, x, y], y]/.y->100 == 0,
u[t, x, y] == 100}, u, {x, 0, 100}, {y, 0, 100}, {t, 0, 10}]
What has produced the following message:
"Equation or list of equations expected instead of True in the first \
argument {\!\(\*SuperscriptBox[\"u\", TagBox[
RowBox[{\"(\",
RowBox[{\"1\", \",\", \"0\", \",\", \"0\"}], \")\"}],
Derivative],
MultilineFunction->None][t, x, y] == u[t, x, y] + \
\*SuperscriptBox[\"u\", TagBox[
RowBox[{\"(\",
RowBox[{\"0\", \",\", \"0\", \",\", \"2\"}], \")\"}],
Derivative],
MultilineFunction->None][t, x, y] + \*SuperscriptBox[\"u\", TagBox[
RowBox[{\"(\",
RowBox[{\"0\", \",\", \"2\", \",\", \"0\"}], \")\"}],
Derivative],
MultilineFunction->None][t, x, \
y]\),True,True,True,True,u[0,x,y]==100}"
and didn't give me an answer for my problem...
Thank you for supporting!
NDSolve
andNeumannValue
. $\endgroup$NeumannValue
is convenient but not necessary to solve this system of equations. To obtain more thorough responses, post your equations in Mathematica format. $\endgroup$/.x->0 == 0
evaluate to/.x->True
etc, and the initial condition was wrongly specified asu[t, x, y] == 100
instead ofu[0, x, y] == 100
. Fixing the latter, and using parentheses to fix replacements, e.g.(D[u[t, x, y], x]/.x->0) == 0
gives a solution equivalent to the one in the accepted answer. $\endgroup$