I am new to Mathematica, please forgive me asking naive questions. I tried to solve PDEs numerically using NDSolve, but failed to go through due to errors. Two of three PDEs are time-dependent and another one is time-independent (or implicitly time-dependent). Here is the code:
Needs["NDSolve`FEM`"]
dr = 0.5; rx = 2.5/2; xs = -(dr + rx); ys = 0.0;
ec = RegionUnion[Disk[{-rx, 0}, dr], Rectangle[{-rx, -dr}, {rx, dr}],
Disk[{rx, 0}, dr]];
Region[ec]
bmesh = ToBoundaryMesh[ec, "MaxBoundaryCellMeasure" -> .05];
bmesh["Wireframe"]
f = Function[{vertices, area},
area > 0.004 (0.9 - 0.5 Norm[Mean[vertices]])];
(mesh = ToElementMesh[bmesh, MeshRefinementFunction -> f])["Wireframe"]
u0 = 11.2; v0 = 1; d0 = 0.97; V2 = -0.2;
Eqs = {D[u[t, x, y], t] ==
d0 (Laplacian[u[t, x, y], {x, y}] + w[t, x, y]),
D[v[t, x, y], t] == Laplacian[v[t, x, y], {x, y}] - w[t, x, y],
Laplacian[
w[t, x, y], {x, y}] == -4 \[Pi] (v[t, x, y] - u[t, x, y])};
ics = {u[0, x, y] == u0, v[0, x, y] == v0, w[0, x, y] == -0.0};
bcs = DirichletCondition[w[t, x, y] == V2, {x, y} \[Element] bmesh];
{usol, vsol, wsol} =
NDSolveValue[{Eqs, ics, bcs}, {u, v, w}, {t, 0,
10^6}, {x, y} \[Element] mesh];
The result shows errors
LinearSolve::parpiv: Zero pivot was detected during the numerical factorization or there was a problem in the iterative refinement process. It is possible that the matrix is ill-conditioned or singular.
Set::shape: Lists {usol,vsol,wsol} and NDSolveValue[<<1>>] are not the same shape.
LinearSolve::parpiv: Zero pivot was detected during the numerical factorization or there was a problem in the iterative refinement process. It is possible that the matrix is ill-conditioned or singular.
Totally have no ideas where errors come from. Thanks for any instructions and suggestions.
{usol,vsol,wsol}=
and the;
from your last line of code so I can see what yourNDSolveValue
returns. That looks like theNDSolveValue
failed and just returned the original line. So that error message will likely go away if you can fix your "Zero pivot" error. If I use the little search box at the top of the Stackexchange page and enter "zero pivot" with those quotes then I get lots of results and answers related to that. Can you scan through those and see if any look like they might be helpful? $\endgroup$