Numerical boundary conditions for wide approximation finite difference

Click For Summary

Discussion Overview

The discussion revolves around implementing numerical boundary conditions for a finite difference scheme using a wide 5-point stencil to achieve fourth-order accuracy. Participants explore the challenges of defining boundary conditions for points U-1 and UN+1, particularly in the context of Dirichlet boundary conditions.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant presents a finite difference scheme for the second derivative and expresses uncertainty about how to implement numerical boundary conditions for U-1 and UN+1.
  • Another participant suggests creating an unsymmetrical fourth-order approximation for the second derivative at the boundary points, indicating that U-1 and UN+1 may not be necessary.
  • A third participant acknowledges the suggestion but insists on the requirement to use U-1 and UN+1 as instructed.
  • A later reply proposes making finite difference approximations for the derivatives at the boundary points to satisfy the differential equation, implying that this could provide the necessary equations to solve for the boundary points.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the necessity of U-1 and UN+1, with some suggesting alternative approaches while others adhere to the requirement to include these points.

Contextual Notes

The discussion highlights the dependence on specific boundary conditions and the potential for different approaches to numerical boundary conditions, which may not be universally applicable.

amalak
Messages
6
Reaction score
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.
 
Physics news on Phys.org
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.
 
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}##.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 22 ·
Replies
22
Views
4K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 41 ·
2
Replies
41
Views
10K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K