3
$\begingroup$

I've just begun to use the Mathematica so my question may seem to be naive. To get a solution for my problem I looked at the example provided in help.

{vals, funs} = 
NDEigensystem[{-Laplacian[u[x, y], {x, y}], 
DirichletCondition[u[x, y] == 0, True]}, 
u[x, y], {x, y} ∈ Disk[], 6];

And I tried to apply it for 3D shape like this.

Ω = 
 Pyramid[{{aa, aa, 0}, {aa, -aa, 0}, {-aa, -aa, 0}, {-aa, aa, 0}, {0, 
    0, hh}}];  
Γ = 
 ImplicitRegion[((Abs[x] >= Abs[y] && 
      z == hh*(1 - Abs[x]/aa)) || (Abs[y] >= Abs[x] && 
      z == hh*(1 - Abs[y]/aa)) || z == 0), {{x, -aa, aa}, {y, -aa, 
    aa}, {z, 0, hh}}];  
aa := 1;  
hh := 1;  
NDEigensystem[{-Laplacian[f[x, y, z], {x, y, z}] == 
   NeumannValue[0, Element[{x, y, z}, Γ]]}, f[x, y, z], 
 Element[{x, y, z}, Ω], 6]

But unfortunately it returns the same thing as I have at input. Can anybody explain to me what I'm doing wrong?
I edited this post to make things more clear. I'm looking for natural frequencies of pyramid bounded area. So, my end-goal is to find eigenvalues and eigenfunctions for the Helmholtz equation with Neumann boundary condition u'[x,y,z]=0 on the surface of a pyramid. This task seemed to me to be difficult to start with so I decided to find first eigenvalues for the Laplacian operator. Here is the Helmholtz equation:

 Laplacian[u(x,y,z),{x,y,z}] + k^2u(x,y,z) =0 
$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Michael E2 Jul 18 '16 at 4:39
  • $\begingroup$ You can format inline code and code blocks by selecting the code and clicking the {} button above the edit window. The edit window help button ? is also useful for learning how to format your questions and answers. You may also find this meta Q&A helpful $\endgroup$ – Michael E2 Jul 18 '16 at 4:40
1
$\begingroup$

As shown in the docs for NDEigensystem, the proper way to specify a homogeneous boundary condition with NeumannValue is to add it to the linear operator (only homogeneous boundary conditions are supported at this time, V10.4.1).

Block[{aa = 1, hh = 1},
  Ω = 
   Pyramid[{{aa, aa, 0}, {aa, -aa, 0}, {-aa, -aa, 0}, {-aa, aa, 
      0}, {0, 0, hh}}];
  eigs = NDEigensystem[{-Laplacian[f[x, y, z], {x, y, z}] + 
      NeumannValue[0, True]}, f[x, y, z], 
    Element[{x, y, z}, Ω], 6]

  ];

Grid[Partition[
  MapThread[
   SliceContourPlot3D[#2, 
     "CenterPlanes", {x, y, z} ∈ Ω, 
     PlotRange -> Full, PlotLabel -> #1, ColorFunction -> "Rainbow", 
     Contours -> 19] &, eigs],
  3]]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Thank you Michael, your remark on how to specify correctly Neumann boundary conditions is very helpful. Fortunately, in my case the condition is homogeneous. It did work for my Mathematica 10.3 as well. Are you sure that NeumannValue(0, True) is the same thing as NeumannValue[0, Element[{x, y, z}, Γ]] ? $\endgroup$ – Alex Jul 19 '16 at 2:17
  • $\begingroup$ @Alex Isn't Gamma the boundary of the pyramid? If not, could you describe what it is? (The True in NeumannValue[..., True] defines the condition to apply to the whole boundary of the pyramid.) $\endgroup$ – Michael E2 Jul 19 '16 at 3:48
  • $\begingroup$ Yes, Gamma is supposed to be the boundary of the pyramid. I was just surprised that Mathematica can calculate the derivative on a surface without explicitly given surface. $\endgroup$ – Alex Jul 19 '16 at 11:53
  • $\begingroup$ @Alex There's some discussion about how NeumannValue[val, pred] works here and a little more here. The way FEM works seems to add val to the components of the appropriate system matrices corresponding to boundary elements for which pred is true. (M certainly computes the boundary elements when discretizing a region; try emesh["BoundaryElements"] for any ElementMesh.) $\endgroup$ – Michael E2 Jul 19 '16 at 14:43

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.