Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Numerical boundary conditions for wide approximation finite difference

  1. Jan 21, 2014 #1
    Hi,

    I have to use a wide 5 point stencil to solve a problem to fourth order accuracy. In particular, the one I'm using is:

    u'' = -f(x + 2h) + 16f(x + h) - 30f(x) + 16f(x - h) - f(x - 2h) / 12h2

    or when discretized

    u'' = -Uj-2 + 16Uj-1 -30Uj + 16Uj+1 -Uj+2 / 12h2

    In addition to dirichlet boundary conditions (which are not troubling me to implement), I have to implement numerical boundary conditions for

    U-1 and UN+1

    The problem I'm encountering is I'm not sure what to try for these numerical boundary conditions (as in, I haven't a clue as to what may work). I have the scheme set up without those conditions, but that's not what I want. The only time I know U-1 and UN+1 come up are with Neumann boundary conditions, which I don't have.

    Any help or pointers would be immensely appreciated, thank you.
     
  2. jcsd
  3. Jan 21, 2014 #2

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

  4. Jan 22, 2014 #3
    Thank you very much for your response. That method seems to make more sense, I think, but I've been instructed to use U-1 and UN+1, but thank you again.
     
  5. Jan 22, 2014 #4

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    OK, so they probably want your numerical solution satisfy the differential equation at the boundary points ##u_0## and ##u_N##, not just to satisfy the Dirichlet boundary conditions at the boundary points.

    So, make finite difference approximations for the derivatives at ##u_0## using ##u_{-1}, u_0,. u_1, \dots## and plug them into the differential equation, and similarly at ##u_N##. That will give you two more equations, so you have enough equations to solve for ##u_{-1}, u_0,\dots, u_N, u_{N+1}##.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Numerical boundary conditions for wide approximation finite difference
Loading...