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.(adsbygoogle = window.adsbygoogle || []).push({});

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:

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?Code (Text):

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

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]

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Python Difference in numerical approach for PDE vs ODE

Have something to add?

Draft saved
Draft deleted

Loading...

Similar Threads - Difference numerical approach | Date |
---|---|

Python Numerical integration 'quad' error | Jan 29, 2018 |

FORTRAN: Differences between "cabs" and "csqrt" | Sep 7, 2017 |

Finite difference Method of Wave Equation | Mar 11, 2017 |

Python and MATLAB giving different results for same code? | Feb 24, 2017 |

What are the differences between DFA's and FSM's? | Jan 18, 2017 |

**Physics Forums - The Fusion of Science and Community**