I am new to Mathematica, trying to solve two PDEs (for f[x,y] and g[x,y]) coupled through Grad[f[x,y]]. In the following code when n is set to 1, NDSolve seems to be able to solve for f[x,y] and g[x,y], and the two obtained functions seem to be coupled as expected. However, when n is set to 2, which is really the case I would like to study, an error message that begins with "NDSolve::femnonlinear: Nonlinear coefficients are not supported in this version of NDSolve. >>" and a bunch of others that follow this message appear. I would say that I understand what the main error message implies, but I would believe that there exists a solution to this issue. I would also think it might be just a simple thing I am missing (e.g. extra boundary conditions are required for n>=2, etc.). I read "Wolfram Mathematica Tutorial Collection/Advanced Numerical Differential Equation Solving in MATHEMATICA" and many posts that seemed to be related to this issue, but I still have not found a way to move forward, so I thought it's time to ask for help.
ClearAll[f, g, x, y, eq1, eq2, eq3, n]
n = 1;
eq1[f_] := Div[Grad[f[x, y], {x, y}], {x, y}]
eq2[g_] := Div[Grad[g[x, y], {x, y}], {x, y}]
eq3[f_] := Grad[f[x, y], {x, y}][[1]]^n + Grad[f[x, y], {x, y}][[2]]^n
sol = NDSolve[{eq1[f] == 0, eq2[g] - eq3[f] == 0, f[0, y] == 1,
f[10, y] == 0, g[0, y] == 300, g[10, y] == 300}, {f[x, y],
g[x, y]}, {x, 0, 10}, {y, 0, 5}];
{
DensityPlot[f[x, y] /. sol, {x, 0, 10}, {y, 0, 5},
PlotLegends -> Automatic, AspectRatio -> Automatic],
DensityPlot[g[x, y] /. sol, {x, 0, 10}, {y, 0, 5},
PlotLegends -> Automatic, AspectRatio -> Automatic]
}
MethodOfLines. Have success! – Alexei Boulbitch Mar 28 '16 at 12:54