I want to solve a Laplace PDE in a polar coordinate system with finite difference method, but I have a problem with boundary conditions at r = 0
.
Here is what I found on the Internet: http://homepages.see.leeds.ac.uk/~amt6xw/Distance%20Learning/CFD5030/node10.html
The formula for discretization is here:
I started off from a Cartesian coordinate system, from a rectangle grid. I tried to transfrom it into polar coordinates, but I don't know how to add/define the boundary conditions at r = 0
, but in r = R = 0
.
R = 0.04;
n = 10;
m = 10;
Δr = R/n;
Δθ = R/m;
ϕ[n, j_] = 0;(*???*)
ϕ[i_, m] = 0;(*???*)
vars = Flatten[Table[ϕ[i, j], {i, 1, n - 1}, {j, 1, m - 1}]];
eqns = Flatten[Table[1/Δr^2 (1 - 1/(2 m)) ϕ[i - 1, j] -
2 ϕ[i, j] + (1 - 1/(2 m)) ϕ[i + 1, j] +
1/(m Δθ)^2 (ϕ[i, j + 1] -
2 ϕ[i, j] + ϕ[i, j - 1]) == 0, {i, 1, n - 1}, {j, 1, m - 1}]];
sol = Solve[eqns, vars][[1]];
ϕsol =
Interpolation[
Flatten[Table[{i Δr, j Δθ, ϕ[i, j]}, {i, 0, n}, {j, 0, m}] /. sol, 1]];
When I solve analitycal the result is here:
But I don't know how to solve numerically