I am trying to integrate the output of NDSolve
over 2D-space and time in the triangular domain that it's solved. It should be straight forward, but I haven't been able to set it up. Here is the code.
region = Polygon[{{0, 0}, {0, 1}, {1, 0}}];
fksol = NDSolve[{Derivative[2, 0, 0][u][x, y, t] + Derivative[0, 2, 0]
[u][x, y, t] + Derivative[1, 0, 0][u][x, y, t] + Derivative[0, 1, 0]
[u][x, y, t] == Derivative[0, 0, 1][u][x, y, t] +
NeumannValue[0, x + y >= 1], u[x, y,0] ==
(Erf[x/.1] - Erf[(x - 1)/.1] - 1) (Erf[y/.1] -
Erf[(y - 1)/.1] -1) (PDF[NormalDistribution[.2, .1], x]*
PDF[NormalDistribution[.8, .1], y] // Evaluate),u[0, y,t] == 0,
u[x, 0, t] == 0}, u[x, y,t], {x, y} ∈ region, {t, 0, 1}];
Table[ContourPlot[u[x, y, t] /. fksol /. {t -> tt}, {x, y} ∈
region], {tt, {0.01, 0.3, 0.5, 1}}]
For the integration. I tried to set it up different ways, but nothing is working. I hope someone can suggest me how to set it up. Thanks.
pr[x_, y_, t_] := u[x, y, t] /. fksol
NIntegrate[pr[x, y, t], {x, y} ∈ region, {t,0,1}]
This gives an error.
NIntegrate[pr[x, y, t], {x, 0, 1}, {y, 0, 1}, {t, 0, 1}]
This crashes Mathematica.
fkskol=...
part does not parse, let alone evaluate. So this example needs to be fixed before further investigation. $\endgroup$