I'm writing a solver for a differential equation with two neumann boundaries (u'(0)=u'(1)=0) and I can't figure out how to determine how to solve the problem. What will my boundaries be and how do I figure this out? The differential equation is $$u''(x)+Ku(x)=0.$$
-
1$\begingroup$ Your question is too vague. What do you mean by "What will my boundaries be"? What numerical method do you intend to use? $\endgroup$– Wolfgang BangerthCommented Nov 26, 2014 at 13:52
-
1$\begingroup$ If your both boundaries have nuemann boundary conditions, then you can only get the information about the gradient of the solution quantity. To get the solution, I think you may have to remove the nullspace from matrix and RHS. $\endgroup$– PranavCommented Dec 26, 2014 at 15:35
1 Answer
You should consider what needs to happen between a given pair of u(i) and u(i+1) for a forward difference [or u(i) and u(i-1) for a backwards difference, or whatever scheme you are using] such that u'(i) equals zero. If you just consider the definition of derivative for a forward difference scheme as (u(i+1) - u(i)/dx) where dx is a positive constant, the answer is obvious, u(x) must satisfy the condition:
$\frac{u(i+1)-u(i)}{dx}=0$
Understanding this, I am certain that you will be able to answer your own question. I can comment further if you need more information.