PDEs -- problems solving them numerically

  • Thread starter Vrbic
  • Start date
365
9
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.
 
10,596
4,125
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.
 
365
9
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?
 
10,596
4,125
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.
 
365
9
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?
 

Svein

Science Advisor
Insights Author
1,932
583
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).
 

Want to reply to this thread?

"PDEs -- problems solving them numerically" You must log in or register to reply here.

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top