Difference in numerical approach for PDE vs ODE

Click For Summary

Discussion Overview

The discussion focuses on the differences in numerical approaches for solving partial differential equations (PDEs) versus ordinary differential equations (ODEs), particularly through the lens of finite difference methods. Participants explore algorithmic distinctions, stability issues, and the implications of using different numerical techniques.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant expresses confusion about the differences in algorithms for solving PDEs and ODEs, specifically regarding the use of finite difference methods and the role of derivatives.
  • Another participant notes that straightforward finite differencing for PDEs often leads to numerically unstable behavior, resulting in exponentially growing numerical errors, and mentions alternative schemes like Crank-Nicolson and semi-implicit methods.
  • A participant acknowledges the stability concerns for PDEs and seeks clarification on why ODEs do not typically experience the same level of instability.
  • It is mentioned that while finite difference methods can also be unstable for ODEs, such occurrences are rarer and are associated with "stiff" ODEs.

Areas of Agreement / Disagreement

Participants generally agree on the instability issues associated with PDEs when using straightforward finite differencing, but there is no consensus on the reasons for the differences in stability between PDEs and ODEs. The discussion remains unresolved regarding the specific conditions that lead to instability in ODEs.

Contextual Notes

Participants have not fully explored the conditions under which ODEs become stiff or the specific characteristics of different numerical methods that affect stability. There are also unresolved mathematical steps related to the implementation of these methods.

TheCanadian
Messages
361
Reaction score
13
I think I am missing something painfully obvious, but what exactly is the difference in algorithms used to solve PDEs vs ODEs? For example, I've been looking at finite difference methods and the general steps (from what I've seen, although particular approaches may vary) used to numerically solve PDEs and ODEs using this method is to set up a grid for your domain, define boundary/initial conditions, and then take the total (partial) derivative and add it to the previous step's value to find adjacent values.

For example (after initializing values), if I have a function P composed of two variables (t and z) with the total (partial) derivative operator given by Dt for the time derivative and Dz for the spatial derivative, then I set up a loop and it might look something like this:

Code:
j = 0
i = 0
while i < len(t):
    DtP = Dt(P[j,i])
    P[j,i+1] = P[j,i] + ht*DtP

    while j < len(z):
       DzP = Dz(P[j,i])
       P[j+1,i] = P[j,i] + hz*DzP
       j = j + 1

    i = i + 1

Please correct my huge misunderstanding here (or if my basic code is incredibly wrong in its approach), but how exactly is the finite difference method different for the two approaches, besides using a partial or total derivative to iterate the next step?

If you have any other methods besides finite difference methods that could also help distinguish the two approaches to solving ODEs and PDEs, that would be helpful as well.[/code]
 
Last edited:
Technology news on Phys.org
If you use the straightforward finite differencing for a PDE, you usually encounter numerically unstable behavior, which means that the numerical errors in your solution grow exponentially as a function of the time variable t. That is why there are Crank-Nicolson schemes and semi-implicit schemes for solution of PDE:s.
 
  • Like
Likes   Reactions: TheCanadian
hilbert2 said:
If you use the straightforward finite differencing for a PDE, you usually encounter numerically unstable behavior, which means that the numerical errors in your solution grow exponentially as a function of the time variable t. That is why there are Crank-Nicolson schemes and semi-implicit schemes for solution of PDE:s.

Thank you for the clarifying that. I'll definitely read more about the stability of the different approaches for PDE solvers. In case I'm misinterpreting you, why do ODE not encounter the same unstable behaviour for the different approaches?
 
Sometimes the finite difference method can be unstable for ODE:s too, but it's more rare. When it happens, the equation is called a "stiff" ODE.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K