5
$\begingroup$

Bug introduced in 8.0.4 or earlier, fixed in 11.0.0.


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 on an NxNxN cubic grid (x, y, z directions). I am getting a weird kernel crash when I am using NDSolve`FiniteDifferenceDerivative. My code is below. The code works fine when computing mixed derivatives with respect to x&y or x&z (MXwx110 and MXwx101), but the kernel crashes every time I compute mixed derivatives with respect to y&z. 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] /. BCwx1;

MXwx011 = D[Subscript[A, 1, 1][x, y, z], {x, 0}, {y, 1}, {z, 1}] -> fdd[0,1,1][Wx1] /. BCwx1;

MXwx101 = D[Subscript[A, 1, 1][x, y, z], {x, 1}, {y, 0}, {z, 1}] -> fdd[1,0,1][Wx1] /. BCwx1;
$\endgroup$
  • $\begingroup$ Try not to use Subscript. It causes many problems... $\endgroup$ – JungHwan Min Apr 26 '16 at 1:24
  • $\begingroup$ Sure, I can try that. I have now localized the issue the definition MXwx011. I do not think the issue is really with the subscript....it would create problems my other two definitions otherwise as well. This is why I am finding it really weird ! $\endgroup$ – singularity Apr 26 '16 at 1:33
  • $\begingroup$ Also, I copied the code from my mathematica notebook....Which is why you are seeing the subscript function explicitly. $\endgroup$ – singularity Apr 26 '16 at 1:38
  • 1
    $\begingroup$ fdd[0,1,1][Wx1] is causing the problem, and it is bizarre that all other possible combination of inputs (like fdd[0,0,1][Wx1]) work as intended... $\endgroup$ – JungHwan Min Apr 26 '16 at 2:37
  • $\begingroup$ Exactly. I narrowed down the error to fdd[0,1,1] as well. But I have no idea why this is happening even though my system is full symmetric (it is a cube). $\endgroup$ – singularity Apr 26 '16 at 3:42
4
$\begingroup$

This is a bug that has been fixed as of Mathematica 11.0.0.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.