Mathematica 12, Windows 10.
I am trying to solve a PDE in one spatial dimension $R$ and time $t$. I need a solution for displacement $r(R,t)$, radial Cauchy stress $T_{RR}(R,t)$, and radial growth $\gamma_{RR}(R,t)$.
To make things as simple as possible, I first write the static version of the system (two coupled ODEs), making sure we get a solution. Then I add a trivial time evolution turning it into a PDE, and hopefully we can figure out the problem together.
Static problem (coupled ODEs)
γRR[R_, t_] := 3
γθθ[R_, t_] := 4
eqns = {
r[R, t] D[r[R, t], R] == γRR[R, t] γθθ[
R, t] R,
r[R, t]^4 R γθθ[R, t] D[TRR[R, t], R] ==
2 γRR[R,
t] (r[R, t]^4 - R^4 γθθ[R, t]^4)
}
ic = {r[0.1, t] == 0.1, TRR[1, t] == 0}
sol = First@NDSolve[{eqns, ic}, {r[R, t], TRR[R, t]}, {R, 0.1, 1}]
PlotSol[sol_] :=
Plot[{r[R, t], TRR[R, t]} /. sol /. t -> 1 // Evaluate, {R, 0.1, 1},
AxesLabel -> {"R", None},
PlotLegends -> Placed[{"r(R)", "TRR(R)"}, {Center, Top}]]
PlotSol@sol
The solution is as expected:
Dynamic problem (PDE)
Now I simply add a trivial equation to the system of differential equations: The time derivative of $\gamma_{RR}$ is zero, that is $\dot{\gamma}_{RR}=0$. I amend the initial conditions with $\gamma_{RR}(R, t=0)=3$, which of course completely decouples and should give the same result as in the ODE example. I now NDSolve
now over a domain in both $R$ and $t$:
Clear@γRR
AppendTo[eqns, D[γRR[R, t], t] == 0]
AppendTo[ic, γRR[R, 0] == 3 ]
sol = First@
NDSolve[{eqns, ic}, {r[R, t], TRR[R, t]}, {R, 0.1, 1}, {t, 0, 1}]
PlotSol@sol
However, unexpectedly, I get some error messages from the NDSolve
and the correct solution is not returned:
What is going on here? I added a trivial uncoupled set of equations which should not have changed the results.