5
$\begingroup$

Ok, I give up :) I am trying to verify the eigenvalues for heat PDE in 1D, when left end has homogeneous DirichletCondition but the right end is insulated, so it has homogeneous Neumann conditions. But all the attempts I made do not work. I can't figure the correct syntax or something else I am doing is wrong.

When both ends are DirichletCondition it works and gives correct eigenvalues

ClearAll[y,x,L0];

op={-y''[x]  ,DirichletCondition[y[x]==0,x==0],
              DirichletCondition[y[x]==0,x==L0]};

DEigenvalues[op,y[x],{x,0,L0},5]

Mathematica graphics

Which matches hand solution of $\lambda = \left( \frac{n \pi}{L}\right)^2$ for $n=1,2,\dots$

Now when the RHS of bar is insulated, the eigenvalues are $\lambda = \left( \frac{n \pi}{2 L}\right)^2$ for $n=1,3,4,\dots$. This is what I tried

ClearAll[y,x,L0];
op={-y''[x]==NeumannValue[0,x==L0] ,DirichletCondition[y[x]==0,x==L0]};
DEigenvalues[op,y[x],{x,0,L0},5]

And

ClearAll[y,x,L0];
op={-y''[x]+NeumannValue[0,x==L0] ,DirichletCondition[y[x]==0,x==L0]};
DEigenvalues[op,y[x],{x,0,L0},5]

And

ClearAll[y,x,L0];
op={-y''[x]  ,DirichletCondition[y[x]==0,x==L0],y'[L0]==0};
DEigenvalues[op,y[x],{x,0,L0},5]

And few more tries. Nothing works. I get input echoed.

What is the correct syntax for mixing both DirichletCondition and NeumannValue in DEigenvalues ?

Mathematica 11.1.1

$\endgroup$

1 Answer 1

8
$\begingroup$

1) You are specifying contradictory conditions, namely that the RHS has both Neumann and Dirichlet conditions. That is your basic problem. Fix this, and it is fine.

2) The preferred syntax is to add a NeumannValue to the the DE, list DirichletCondition as separate. This works quite nicely:

ClearAll[y, x, L0];
op = {-y''[x] + NeumannValue[0, x == L0], 
   DirichletCondition[y[x] == 0, x == 0]};
DEigenvalues[op, y[x], {x, 0, L0}, 5]
(*{\[Pi]^2/(4 L0^2), (9 \[Pi]^2)/(4 L0^2), (25 \[Pi]^2)/(4 L0^2), (49 \[Pi]^2)/(4 L0^2), (81 \[Pi]^2)/(4 L0^2)}*)

3) NeumannValue is a somewhat funny symbol. It really is only well-defined for FEM and therefore not applicable to symbolic solutions. But the decision was made to go for consistency with NDEigensystem, and do our best to interpret it as a classical Neumann boundary condition (which is why only the "homegenous value" case is supported.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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