Numerical solutions to diffusion equations

In summary, The person is looking for a more accurate numerical method for solving reaction-diffusion equations, specifically the advection diffusion equation and IE Fisher's equation. They have been using a simple Euler finite difference approximation for the time derivative and a forward difference approximation for the Laplacian. They are wondering if anyone can recommend a higher order or more accurate method and if there are any good numerical methods books available. One suggestion is Strikwerda's "Finite Difference Schemes and Partial Differential Equations". Another suggestion is to use a 4th order Runge-Kutta method by writing the 2nd order equation as a coupled 1st order set of equations. Another method mentioned is the Crank-Nicholson method, which
  • #1
Signifier
76
0
Hello, the work I am doing now requires numerical solution of several reaction-diffusion equations such as the standard advection diffusion equation (ADE) or IE Fisher's equation. So far I have been using the only method I am familiar with, the simplest one I believe: to express the time derivative as a simple Euler finite difference approximation, and to express the Laplacian using the following approximation:

[tex]\frac {d^2C} {dx^2} = \frac{C(x + 1) - 2C(x) + C(x - 1)}{dx^2}} [/tex]

where C is the density function (the variable diffusing), which is here a 1d matrix and dx is the step size. I approximated dC/dx with a backward difference approximation, and I approximated [itex]\frac {d^2C} {dx^2}[/itex] with a forward difference approximation, then combined these to get the approximation above.

These techniques have worked for what I'm doing fairly well until now, but I would like to try using more accurate numerical methods. I am wondering what a simple, but higher order or more accurate method would be. Can anyone give me a name of a method? Can anyone recommend any good numerical methods books that I might be able to get through my university library or an interlibrary loan?

Also for a more accurate method would I have to keep track for more than just the state of the 1d matrix at the time before? IE would I have to keep track of the last 2 iterations, etc.

Thank you.
 
Technology news on Phys.org
  • #2
This is not my area. Apologies of this is of no help. That said, I once had a complimentary copy, according to my little card, of:

Numerical Methods for Advection-Diffusion Problems:
Notes on Numerical Fluid Mechanics
C. B. Vreugdenhil and B. Koren 1993

I do not how well that meets your needs, but university library will have a copy.
 
  • #3
Strikwerda's "Finite Difference Schemes and Partial Differential Equations" is a general introduction to finite difference methods, with a lot of coverage of convergence, stability, etc.
 
  • #4
What is the full equation?
 
  • #5
4-th order Runge-Kutta would be able to work for you in this case. You would need to write the 2nd order equaiton as a coupled 1st order set of equations. Try www.nr.com for the code and google it for the general method.
 
  • #6
I'm curious as to how you would use R-K for a partial differential equation - I haven't seen that before.

A standard method for the diffusion equation is the Crank-Nicholson method. Basically it's the OP's discretization in space, but a central difference in time, not an Euler forward difference in time.

See http://farside.ph.utexas.edu/teaching/329/lectures/node80.html (and lots more Google hits).

C-N is unconditionally stable and 2nd order accurate, but if the time steps are large the solution has numerical oscillations in time between successive steps.

You can kill the oscillations (and reduce the accuracy) by using a backwards difference in time, or something in between. A general difference scheme is

[tex]T_i^{n+1} - T_i^n = \theta C\left(T_{i-1}^{n+1}-2\,T_i^{n+1}+T_{i+1}^{n+1}\right) + (1-\theta)C\left(T_{i-1}^n-2\,T_i^n+T_{i+1}^n\right).[/tex]

with [tex]\theta = 1/2[/tex] = 1/2 for C-N,

[tex]\theta = 1[/tex] for backward difference (good for severely nonlinear problems)

[tex]\theta[/tex] = about 0.6 or 2/3 is a reasonable compromise between accuracy and damping the oscillations - can work well for mildly nonlnear problems.

[tex]\theta = 0[/tex] (Euler method in time) is neither accurate nor stable. Its only "advantage" is it is an explicit method, i.e. you don't need to solve a set of equations at each time step. But for 1 space dimension, the equations are tridiagonal, therefore quick and easy to solve, so that "advantage" isn't worth much.

For 2 or 3 space dimensions, there are more efficient solution methods - e.g. alternating-direction implicit (ADI) methods, methods based on Fourier transforms, etc. But for one space dimension, C-N is pretty good.
 
Last edited:

1. What is a diffusion equation?

A diffusion equation is a mathematical model that describes the process of diffusion, which is the movement of particles from an area of high concentration to an area of low concentration. It is often used in fields such as physics, chemistry, and biology to study the spread of substances or properties.

2. Why are numerical solutions used for diffusion equations?

Numerical solutions are used for diffusion equations because they allow for the simulation and prediction of diffusion processes in complex systems. These equations are often difficult or impossible to solve analytically, so numerical methods are used to approximate the solution and provide valuable insights and predictions.

3. What are some common numerical methods used for solving diffusion equations?

Some common numerical methods used for solving diffusion equations include finite difference methods, finite element methods, and spectral methods. These methods involve discretizing the equation into smaller parts and using iterative calculations to approximate the solution.

4. How do boundary conditions affect the numerical solutions of diffusion equations?

Boundary conditions play a crucial role in determining the behavior and accuracy of numerical solutions to diffusion equations. They define the values or behavior of the solution at the boundaries of the system, and different boundary conditions can lead to significantly different results.

5. What are some real-world applications of numerical solutions to diffusion equations?

Numerical solutions to diffusion equations have a wide range of applications in various fields, including predicting the spread of pollutants in the environment, modeling drug diffusion in the body, and understanding heat transfer in materials. They are also used in computer simulations for designing and optimizing processes in engineering and industry.

Similar threads

  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
Replies
8
Views
2K
  • Programming and Computer Science
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
4
Views
699
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
Replies
3
Views
1K
  • Quantum Physics
Replies
1
Views
582
Back
Top