PDEs -- problems solving them numerically

  • Thread starter Thread starter Vrbic
  • Start date Start date
  • Tags Tags
    Pdes
Click For Summary

Discussion Overview

The discussion revolves around the numerical solution of partial differential equations (PDEs), specifically focusing on challenges encountered when applying numerical methods to hydrodynamical equations. Participants share their experiences and seek advice on improving the stability and accuracy of their numerical solutions.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes their experience with a Fortran code for solving a system of five coupled first-order non-linear PDEs, noting issues with noise in the results after rescaling initial conditions.
  • Another participant emphasizes the importance of selecting the appropriate ODE/PDE solver based on the nature of the solution, mentioning that errors can accumulate over time, leading to energy gain or loss in the system.
  • A later reply discusses the potential for sudden changes or inflection points in the solution to cause problems, questioning whether the issue lies in the definition of differentiation or the accuracy of the functions used.
  • Some participants suggest using finer time steps or switching to the Runge-Kutta method (RK4) for improved results, while also acknowledging the trade-offs in implementation and accuracy over time.
  • One participant expresses uncertainty about adapting Runge-Kutta methods for PDEs, seeking clarification on their applicability.
  • Another participant mentions a reference tutorial on using RK4 for both ODE and PDE numerical solutions.
  • One participant categorizes PDEs into hyperbolic, parabolic, and elliptic classes, indicating that different tools are used for solving each type.

Areas of Agreement / Disagreement

Participants express varying opinions on the best numerical methods to use for solving PDEs, with no consensus reached on a single approach. The discussion remains unresolved regarding the optimal strategies for addressing the noise and instability issues described.

Contextual Notes

Participants highlight limitations related to the choice of numerical methods and the potential for error accumulation over time. There is also mention of the need for finer steps and the challenges associated with implementing different solvers.

Who May Find This Useful

This discussion may be useful for individuals working on numerical methods for PDEs, particularly those facing challenges with stability and accuracy in their simulations.

Vrbic
Messages
400
Reaction score
18
Hello,
I have a problem with a solution of PDEs. I understand it is impossible to find my problem but some hint how to look at such problem would be very useful. I have to say it is my first encounter with a numerical solution of PDEs, so be patient with my description.

I have a code (in Fortran but I think it isn't important) for the solution of 5 tied up first order non-linear partial differential equations. I solve hydrodynamical equations (dependent on time) for some compact object. It works for some boundary and initial conditions but if I "rescale it" and I change (decrease) initial mass, i.e. I change all initial function and also the size of step (not a number of steps, but IT is probably important), the results with increasing time aren't smooth. I mean, the code works perfectly from the beginning but after some time most points of all function look very good, but few, let's say 5%, starts to look like noise.

All dif. eqs. are expected as difference eqs. and solved step by step. My idea is that the problem is in numerical differentiation. It is done by definition: F'(x)=(F(x+h)-F(x))/h. I tried to change to "two" steps and "five" steps algorithm of differentiation but it was worse. Even for the condition if it works.
If anyone have some points, hints or where starts to find a problem. Please let me know.

Thank you all.
 
Technology news on Phys.org
When doing any kind of numerical integration, you have to choose the ODE/PDE solver appropriately. Some solvers are good when the solution is monotonically increasing (ie Euler and its alternatives) whereas some are good when the solution is periodic as in orbital motion.

What often happens is small amounts of error are introduced over time causing the system to gain energy or small amounts of error decrease over time appearing a energy loss by the system. You choice of ODE/PDE solver must mitigate that in order to work for longer intervals.
 
  • Like
Likes   Reactions: Klystron
jedishrfu said:
When doing any kind of numerical integration, you have to choose the ODE/PDE solver appropriately. Some solvers are good when the solution is monotonically increasing (ie Euler and its alternatives) whereas some are good when the solution is periodic as in orbital motion.

What often happens is small amounts of error are introduced over time causing the system to gain energy or small amounts of error decrease over time appearing a energy loss by the system. You choice of ODE/PDE solver must mitigate that in order to work for longer intervals.

Yes, understand.

This problem was already solved (but not for all condition I want), I would like to use this result and extend. So, I use the same method (probably something like Euler's method). The resulting functions are not strictly monotonic but not chaotic or periodic (mostly one extreme or inflex point). It is true that problems appear in the very sudden change or inflex point...seems to me.

Is there any procedure how to "cure" such regions if I expect that? Is that problem in the very trivial definition of differentiation or in the accuracy of functions who make up the differentiation?
 
I think your only choice is finer steps and/or go Runge Kutta RK4 as it often works much better than other methods.

https://en.wikipedia.org/wiki/Runge–Kutta_methods

Here's some commentary about their limitations:

https://farside.ph.utexas.edu/teaching/329/lectures/node40.html

which basically are they are easier to implement in code but run slower than the fancier methods and can suffer from accuracy over time due to the infamous truncation error.

And a slideshow on the various methods placed here for others interested in this topic (with MATLAB):

https://www.tu-ilmenau.de/fileadmin/media/simulation/Lehre/div/Lec_Slides3.pdf

You could research your problem online and see if others have solved it using a difference ODE solver.
 
jedishrfu said:
I think your only choice is finer steps and/or go Runge Kutta RK4 as it often works much better than other methods.

https://en.wikipedia.org/wiki/Runge–Kutta_methods

Here's some commentary about their limitations:

https://farside.ph.utexas.edu/teaching/329/lectures/node40.html

which basically are they are easier to implement in code but run slower than the fancier methods and can suffer from accuracy over time due to the infamous truncation error.

And a slideshow on the various methods placed here for others interested in this topic (with MATLAB):

https://www.tu-ilmenau.de/fileadmin/media/simulation/Lehre/div/Lec_Slides3.pdf

You could research your problem online and see if others have solved it using a difference ODE solver.

Thank you, but my problem is PDEs. I know Runge-Kutta but only for ODEs. Is it possible to adjust it to solving PDEs?
 
I found this reference tutorial on using RK4 for ODE and PDE numerical solutions:

https://www.sharcnet.ca/help/index.php/RUNGE-KUTTA_Tutorial

I’m sure there are others available online more specific to your problem.
 
  • Like
Likes   Reactions: Vrbic
My reference books divide the PDEs into three classes: Hyperbolic, parabolic and elliptic. The tools for solving are then discussed separately (sorry, I am no expert on this so I cannot go into details).
 
  • Like
Likes   Reactions: Vrbic

Similar threads

Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
6K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 63 ·
3
Replies
63
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
16
Views
3K