I found a solution for this problem, but this is in Scilab and I never use Scilab. Can anyone can help me to translate it in Mathematica? Here is the Link:http://imechanica.org/files/TorqueR.pdf
I solved this problem with NDSolve but now I want to implement it with FDM, like this.
Clear[a, b, n, m, Δx, Δy, G, θ,
sol, vars, ϕsol, eqns, tauyz, tauxz, ϕ, gammaxz, gammayz]
a = 0.04;
b = 0.04;
n = 5;
m = 5;
Δx = a/n;
Δy = b/m;
G = 13.125 10^6;
θ = 0.002;
ϕ[0, j_] = 0;
ϕ[n, j_] = 0;
ϕ[i_, 0] = 0;
ϕ[i_, m] = 0;
Ψ[i_, j_] = -2 G θ;
vars = Flatten[Table[ϕ[i, j], {i, 1, n - 1}, {j, 1, m - 1}]];
eqns =
Flatten[
Table[
(ϕ[i + 1, j] - 2 ϕ[i, j] + ϕ[i - 1, j])/Δx^2 +
(ϕ[i, j + 1] - 2 ϕ[i, j] + ϕ[i, j - 1])/Δy^2 == Ψ[i, j],
{i, 1, n - 1}, {j, 1, m - 1}]];
sol = Solve[eqns, vars][[1]];
ϕsol =
Interpolation[
Flatten[Table[{i Δx, j Δy, ϕ[i, j]}, {i, 0, n}, {j, 0, m}] /. sol, 1]];
tauyz = -D[ϕsol[x, y], x];
tauxz = D[ϕsol[x, y], y];
gammayz = tauyz/G;
gammaxz = tauxz/G;
but this only works for a rectangle, but I need to solve for a rectangle with hole in the center, like this:


ruleiandruleo. If you have any difficulty in understanding, feel free to continue to ask in the comment under my answer. – xzczd Apr 01 '15 at 03:40