6
$\begingroup$

Bug introduced in 12.1 or earlier, fixed in 12.2.


enter image description here

In the above code, the InterpolatingFunction object has order -1. In the documentation https://reference.wolfram.com/language/ref/InterpolationOrder.html, it seems that InterpolationOrder has to be $\geq 0$. What is the meaning of the negative InterpolationOrder?

Added: I am using version 12.1. I obtained many InterpolatingFunction object after the below NDEigensolve command.

NDEigensystem[{{3*psi3[x, y] - 10*psi2[x, y]*Sign[y] - Derivative[0, 1][psi2][x, y] - 
    I*Derivative[1, 0][psi2][x, y], 3*psi4[x, y] - 10*psi1[x, y]*Sign[y] + Derivative[0, 1][psi1][x, y] - 
    I*Derivative[1, 0][psi1][x, y], 3*psi1[x, y] - 10*psi4[x, y]*Sign[y] - Derivative[0, 1][psi4][x, y] - 
    I*Derivative[1, 0][psi4][x, y], 3*psi2[x, y] - 10*psi3[x, y]*Sign[y] + Derivative[0, 1][psi3][x, y] - 
    I*Derivative[1, 0][psi3][x, y]}, PeriodicBoundaryCondition[psi1[x, y], x == 0, 
   TransformationFunction[{{1, 0, 20}, {0, 1, 0}, {0, 0, 1}}]], PeriodicBoundaryCondition[psi2[x, y], x == 0, 
   TransformationFunction[{{1, 0, 20}, {0, 1, 0}, {0, 0, 1}}]], PeriodicBoundaryCondition[psi3[x, y], x == 0, 
   TransformationFunction[{{1, 0, 20}, {0, 1, 0}, {0, 0, 1}}]], PeriodicBoundaryCondition[psi4[x, y], x == 0, 
   TransformationFunction[{{1, 0, 20}, {0, 1, 0}, {0, 0, 1}}]], DirichletCondition[psi1[x, y] == 0, 
   0 < x < 20 && (y == 70 || y == -70)], DirichletCondition[psi2[x, y] == 0, 
   0 < x < 20 && (y == 70 || y == -70)], DirichletCondition[psi3[x, y] == 0, 
   0 < x < 20 && (y == 70 || y == -70)], DirichletCondition[psi4[x, y] == 0, 
   0 < x < 20 && (y == 70 || y == -70)]}, {psi1, psi2, psi3, psi4}, Element[{x, y}, Rectangle[{0,-70}, {20,70}]], 10]

In the code, I am trying to obtain the eigenvalue of a certain $4\times 4$ matrix differential operator. The region I consider is a rectangle of size $20\times 140$. At left and right side, I applied the periodic boundary condition. At top and bottom side, I applied the Dirichlet boundary condition. The differential operator is the form $$h_x \partial_x + h_y \partial_y + h_0(x,y),$$ where $h_x, h_y, h_0(x,y)$ are $4\times 4$ matrices. The dependent variable is denoted as {psi1[x,y], psi2[x,y], psi3[x,y], psi4[x,y]}.

$\endgroup$
5
  • 5
    $\begingroup$ "if necessary, I will provide the detailed code" - I'd recommend you include your code. Code is almost always necessary to answer questions about code. $\endgroup$
    – MarcoB
    Mar 18 at 14:35
  • 4
    $\begingroup$ Even better, provide a minimal example that captures the essence of the issue without extraneous details! $\endgroup$
    – Chris K
    Mar 18 at 14:59
  • $\begingroup$ Also, what version are you using? $\endgroup$
    – user21
    Mar 18 at 15:59
  • $\begingroup$ I updated the question. $\endgroup$
    – eigenvalue
    Mar 20 at 14:24
  • $\begingroup$ @MichaelE2 You are right. Sorry for that and I modified the code. $\endgroup$
    – eigenvalue
    Mar 20 at 14:44
9
$\begingroup$

The typeset results in V12.2 show the interpolating functions are all order 2. I tested the OP's code in V12.1 and V12.2. Both versions produce identical eigenfunctions. It's a typesetting error in V12.1, that can be traced to bug in how the interpolation order is reported. The actual interpolation order in the internal structure in both versions is 2.

In V12.1:

Update: The source of the typesetting error is in InterpolatingFunction:

sols[[1, 1]]["InterpolationOrder"]
(*  -1  *)

In V12.2:

$\endgroup$
4
  • $\begingroup$ Thank you so much. That is a strange phenomenon. $\endgroup$
    – eigenvalue
    Mar 20 at 22:43
  • 1
    $\begingroup$ @eigenvalue You can also check sols[[1, 1]]["InterpolationOrder"] in v12.1. $\endgroup$
    – xzczd
    Mar 21 at 2:40
  • $\begingroup$ No, I don't have access to v12.1 at the moment 囧 . $\endgroup$
    – xzczd
    Mar 21 at 2:48
  • 1
    $\begingroup$ @xzczd Okay, thanks. I bit the bullet and redid the computation. In fact the "InterpolationOrder" method seems to be the source of the error. I just had some work that I needed to get done and didn't want to go back to this. $\endgroup$
    – Michael E2
    Mar 21 at 2:56

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.