Hi, I am using Mathematica 10.4.0 on ubuntu 16.04.
I am trying to solve a set of differential equations using finite difference method. I am getting a weird crash everytime I define lists of mixed finite difference derivatives together. My code is below. If I delete the last two lines of the code (MXwx011 and MXwx101), it works fine…but the kernel crashes everytime I run the last three lines together (MXwx110, MXwx011, and MXwx101). I do not understand what is wrong. This is really weird.The whole thing was running perfectly fine before I had inserted boundary conditions (BCwx1) in the definition of the grid (Wx1) to make the code faster. I would really appreciate any help to resolve this issue. Thank you.
NN = 20; RMax = 20.0; delta = 1.0/NN;
xgrid = RMax*N[delta* Range[0, NN]]; ygrid = RMax*N[delta* Range[0, NN]]; zgrid = RMax*N[delta* Range[0, NN]];
fdd[l_, m_, n_] := NDSolve`FiniteDifferenceDerivative[
Derivative[l, m, n], {xgrid, ygrid, zgrid},
"DifferenceOrder" -> {4, 4, 4}];
BCwx1 = Flatten[{Table[{Subscript[wx1, 0, j, k] -> 0.0}, {j, 0, NN}, {k, 0, NN}],
Table[{Subscript[wx1, i, 0, k] -> 0.0}, {i, 0, NN}, {k, 0, NN}],
Table[{Subscript[wx1, i, j, 0] -> 0.0}, {i, 0, NN}, {j, 0, NN}],
Table[{Subscript[wx1, NN, j, k] -> 0.0}, {j, 0, NN}, {k, 0, NN}],
Table[{Subscript[wx1, i, NN, k] -> 0.0}, {i, 0, NN}, {k, 0, NN}],
Table[{Subscript[wx1, i, j, NN] -> 0.0}, {i, 0, NN}, {j, 0, NN}]},
3];
Wx1 = Table[Subscript[wx1, i, j, k] /. BCwx1, {i, 0, NN}, {j, 0, NN}, {k, 0, NN}];
MXwx110 = D[Subscript[A, 1, 1][x, y, z], {x, 1}, {y, 1}, {z, 0}] -> fdd[1, 1, 0][Wx1];
MXwx011 = D[Subscript[A, 1, 1][x, y, z], {x, 0}, {y, 1}, {z, 1}] -> fdd[0, 1, 1][Wx1];
MXwx101 = D[Subscript[A, 1, 1][x, y, z], {x, 1}, {y, 0}, {z, 1}] -> fdd[1, 0, 1][Wx1];