Numerical integration of PDEs: How do you satisfy boundary conditions

In summary, numerical integration of PDEs is a method used to approximate the solution of a partial differential equation (PDE) by breaking it down into smaller discrete equations that can be solved using numerical methods. Boundary conditions are essential in this process as they define the values of the solution at the boundaries of the problem domain. There are three main types of boundary conditions in numerical integration of PDEs: Dirichlet, Neumann, and Robin. These conditions are typically satisfied by incorporating them into the numerical methods used to solve the PDE, but this can be challenging due to the need to maintain stability and accuracy in the solution and ensure that the conditions accurately reflect the physical behavior of the PDE.
  • #1
davidbenari
466
18
Suppose we are solving a diffusion equation.

##\frac{\partial}{\partial t} T = k\frac{\partial^2}{\partial x^2} T##

On the domain ##0 < x < L##

Subject to the conditions

##T(x,0) = f(x) ## and ##T = 0 ## at the end points.

My question is:

Suppose we solve this with some integration scheme (forward time centered space), such that we use a formula like

##T_{i}^{n+1} = \frac{k\tau}{h^2} (T_{i+1}^{n} - 2 T_{i}^{n} + T_{i-1}^n)+T_{i}^n##

how is it that we are ensuring that ##T=0## at the end points in the future?

Is a partial differential equation completely determined by its initial configuration (including its initial boundary)?

How are we respecting the boundary conditions when we do such integration of the pde ?
 
Mathematics news on Phys.org
  • #2
That finite difference scheme you supplied is a central difference scheme, meaning it applies exactly as written only for spatial mesh points (x points) between the end points (exclusively). Its easiest to supply the boundary conditions if you treat that recurrence relation as a matrix (or an excel formula). For consistency, let's say each column holds data varying over time at constant position and each row contains data sampled over space (x coordinate) at a fixed time. Then your initial condition ( t = 0 ) fills all the data in the top row ( n = 0 ). This isn't enough information to fully determine the unknown data. If you put that recursion formula into a rectangular table in excel and filled the top row only with givens, it wouldn't find any data when it looks left ( i - 1 ) and right ( i + 1 ). It would only see the data above it ( n - 1 ).
The end points correspond to the leftmost ( i = i_min, x = 0 ) and rightmost ( i = i_max, x = L) columns of the array. What I've done in the past and worked in MATLAB is to overwrite these side columns with the fixed boundary value data (in your case, T = 0 for all entries in both the first and last columns). Then you have 1 temporal constraint and 2 spatial constraints for a difference scheme that is 1st order in time and 2nd order in space. It's fully defined.
 
  • #3
Hmm. So you only overwrite the boundary points?
 
  • #4
You're not supposed to ensure the boundary conditions hold as such, the boundary conditions tell you what the value should be.

Think of a guitar string. No amount of plucking will move the endpoints of the string. They're fixed in place.
 
  • #5
Lord Crc said:
You're not supposed to ensure the boundary conditions hold as such,

When you solve these problems analytically you basically force your solution to be zero at the end points. Think of when, when applying separation of variables and you get some sine function as a solution, you construct the sine's argument to ensure that its zero on the endpoints.

When we solve PDEs numerically, I don't see how were forcing our boundaries to hold a specific condition. It seems logical to me to just overwrite the boundaries in each iteration step though.
 
  • #6
Disclaimer: it has been a few years since I left uni, so maybe a bit rusty...

davidbenari said:
When you solve these problems analytically you basically force your solution to be zero at the end points. Think of when, when applying separation of variables and you get some sine function as a solution, you construct the sine's argument to ensure that its zero on the endpoints.

Yes that's what I mean. You assume that nothing your solution does affects that value, and so you use the value as-is at the boundary. Thus your solution does not ensure the boundary conditions hold, it assumes they do.

davidbenari said:
When we solve PDEs numerically, I don't see how were forcing our boundaries to hold a specific condition.

Let's write out explicitly how to compute [itex]T^{n+1}_1[/itex] given your above formula:[tex]T^{n+1}_1 = \frac{k\tau}{h^2}\left(T^n_2 - 2T^n_1 + T^n_0\right) + T^n_1[/tex]

If [itex]n > 1[/itex], what value will you use for [itex]T^n_0[/itex]? You can't compute it using your formula, because then you'd need to know the value of [itex]T^n_{-1}[/itex] which is outside the domain and thus not defined.

But, you have a boundary condition saying that [itex]T^n_0 = 0[/itex]. So let's use that: [tex]T^{n+1}_1 = \frac{k\tau}{h^2}\left(T^n_2 - 2T^n_1 + 0\right) + T^n_1[/tex][tex]T^{n+1}_1 = \frac{k\tau}{h^2}\left(T^n_2 - 2T^n_1\right) + T^n_1[/tex]
Now you've forced the value at [itex]T^n_0[/itex] to be zero, and used that to solve the PDE, instead of ensuring it winds up as zero afterwards.

Of course, in this case you could have just overwritten the boundary values in your array holding T in your program, as Twigg suggested, and used your regular formula for all internal points. However in some cases you have more complicated boundary conditions where it makes more sense to change the expression used to evaluate the points near the boundaries, like I did above for [itex]T^{n+1}_1[/itex].
 

1. What is numerical integration of PDEs?

Numerical integration of PDEs is a method used to approximate the solution of a partial differential equation (PDE) by breaking it down into smaller discrete equations that can be solved using numerical methods. This allows for the solution of complex PDEs that cannot be solved analytically.

2. Why is it important to satisfy boundary conditions in numerical integration of PDEs?

Boundary conditions are essential in numerical integration of PDEs as they define the values of the solution at the boundaries of the problem domain. Without satisfying these conditions, the solution obtained may not accurately represent the behavior of the PDE in the real-world scenario.

3. What are the different types of boundary conditions in numerical integration of PDEs?

The three main types of boundary conditions in numerical integration of PDEs are Dirichlet boundary conditions, Neumann boundary conditions, and Robin boundary conditions. Dirichlet boundary conditions specify the value of the solution at the boundary, Neumann boundary conditions specify the derivative of the solution at the boundary, and Robin boundary conditions are a combination of both.

4. How do you satisfy boundary conditions in numerical integration of PDEs?

Boundary conditions are typically satisfied by incorporating them into the numerical methods used to solve the PDE. This can be done by modifying the discrete equations or by using special techniques such as ghost points or penalty methods. It is important to carefully choose and implement the appropriate method for satisfying the specific boundary conditions of the problem.

5. What are some common challenges in satisfying boundary conditions in numerical integration of PDEs?

One common challenge in satisfying boundary conditions is maintaining stability and accuracy in the solution while incorporating the conditions. Some numerical methods may also have difficulty handling certain types of boundary conditions, requiring the use of more complex techniques. Additionally, it is important to ensure that the boundary conditions accurately reflect the physical behavior of the PDE in the real-world scenario being modeled.

Similar threads

Replies
3
Views
433
Replies
4
Views
1K
Replies
17
Views
2K
  • Differential Equations
Replies
3
Views
369
  • Classical Physics
Replies
1
Views
133
  • Differential Equations
Replies
1
Views
888
Replies
5
Views
671
  • Quantum Physics
Replies
17
Views
806
Replies
2
Views
1K
Replies
2
Views
246
Back
Top