I have a somewhat unusual mathematical problem. I need to solve numerically a second order elliptic PDE for u[x,y] with the right hand side given by numerical function F[u], that is, some give function of u, not of [x,y].
In 1D things work well
(* make interpolation of a linear function: *)
FofA = Interpolation[Table[{x, x}, {x, 0, 1, 10^-2}]];
(*construct a numerical function from the interpolation: *)
FofA1[x_] := FofA[z] /. z -> x
(* Find solutions for uÂ’ = FofA1[u] *)
uofx = Flatten[
NDSolve[{Dt[u[x], x] == (FofA1[u[x]]), u[1] == 1},
u, {x, 0, 1}]].{1};
(* Plot it and compare with analytical *)
Show[{Plot[u[x] /. uofx, {x, 0, 1}, PlotRange -> All],
Plot[E^(-1 + x), {x, 0, 1}]}]
But in 2D it fails. One of the hints, I think is: if I try to solve Poisson equation in the form
D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == u[x, y]
the NDSolveValue works OK, but it fails for
D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == u[x, y]^{1.}
(when the rhs is numerically evaluated)
Thanks a lot for the insight.