PDEs -- problems solving them numerically

  • Thread starter Vrbic
  • Start date
  • Tags
    Pdes
In summary: PDEs?In summary, I am having difficulty with solving PDEs and I am looking for guidance on how to approach the problem.
  • #1
Vrbic
407
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
  • #2
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 Klystron
  • #3
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?
 
  • #4
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.
 
  • #5
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?
 
  • #6
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 Vrbic
  • #7
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 Vrbic

1. What are PDEs and why do we need to solve them numerically?

PDEs, or partial differential equations, are mathematical equations that involve multiple variables and their partial derivatives. They are used to model many physical phenomena, such as heat transfer, fluid dynamics, and quantum mechanics. Solving them numerically allows us to approximate solutions when analytical solutions are not possible or practical.

2. What numerical methods can be used to solve PDEs?

There are various numerical methods that can be used to solve PDEs, including finite difference methods, finite element methods, and spectral methods. Each method has its own advantages and drawbacks, and the choice of method depends on the specific problem at hand.

3. How do you ensure the accuracy of the numerical solution of a PDE?

The accuracy of a numerical solution of a PDE depends on the choice of numerical method, the grid size or spatial resolution, and the time step or temporal resolution. Generally, using a finer grid and smaller time step will result in a more accurate solution, but it also increases the computational cost.

4. Can PDEs be solved on a computer using software?

Yes, there are many software packages available for solving PDEs numerically, such as MATLAB, Mathematica, and COMSOL. These software packages offer a user-friendly interface and a variety of numerical methods for solving different types of PDEs.

5. What are the applications of solving PDEs numerically?

Solving PDEs numerically has numerous applications in various fields, such as engineering, physics, and finance. It is used to model and predict the behavior of complex systems, design and optimize new technologies, and analyze data in scientific research. Examples of applications include weather forecasting, designing aircrafts, and predicting stock prices.

Similar threads

Replies
5
Views
596
  • Differential Equations
Replies
1
Views
871
  • Programming and Computer Science
Replies
3
Views
2K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
2
Replies
63
Views
3K
Replies
4
Views
1K
  • Programming and Computer Science
Replies
8
Views
2K
  • Science and Math Textbooks
Replies
8
Views
1K
Replies
93
Views
4K
Back
Top