Numerical boundary conditions for wide approximation finite difference

  • Thread starter amalak
  • Start date
  • #1
7
0
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.
 

Answers and Replies

  • #3
7
0
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.
 
  • #4
AlephZero
Science Advisor
Homework Helper
6,994
291
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}##.
 

Related Threads on Numerical boundary conditions for wide approximation finite difference

Replies
1
Views
1K
Replies
9
Views
2K
Replies
1
Views
1K
  • Last Post
Replies
5
Views
3K
  • Last Post
Replies
5
Views
10K
Replies
0
Views
7K
Replies
6
Views
1K
Replies
0
Views
14K
Replies
1
Views
1K
Replies
0
Views
4K
Top