Nonlinear parabolic equations: finite difference method

In summary: I'm a bit at a loss. In summary, the problem is that the nonlinear equation involving the boundary conditions does not converge for the first time step, even using a second order accurate nonlinear solver.
  • #1
mercurial
14
0
To the moderator: please move this to the section on differential equations if you think it would be better there.

I'm looking at a reaction-diffusion equation of the form

[tex]\frac{\partial u}{\partial t} = \frac{\partial^2 u}{\partial x^2} + f(u),[/tex]

where, e.g., [tex]f(u) = u(1-u)[/tex] for the Fisher-Kolmogorov eqation, and I'm assuming the spatial domain is the unit interval with Neumann boundary conditions:

[tex]\frac{\partial u}{\partial x}(0, t) = 0, \; \frac{\partial u}{\partial x}(1, t) = 0, \; t\geq 0.[/tex]

To keep things totally simple, I'm using the backward Euler method. When the original equation is just the heat equation, i.e., [tex]f = 0[/tex], this method just involves solving a simple matrix equation,

[tex]BU^{n+1} = U^n,[/tex]

for evolving the solution from time step n to n+1. The matrix of course depends on the boundary conditions. The nonlinear version of Euler's method involves a nonlinear multi-variable equation:

[tex]BU^{n+1} + F(U^{n+1}) = U^n,[/tex]

which can be solved for each time step using Newton's method.

Where I'm getting confused is: exactly how do I incorporate the boundary conditions when deriving the system of nonlinear equations? My reasoning tells me that they should be the same as for the linear equation, i.e., the matrices B are the same for both the linear and nonlinear systems.

My solver works perfectly for the heat equation with Neumann conditions, but gives only garbage for the Fisher-Kolmogorov equation after the first time step (if it converges at all). I'm convinced that the problem is not a bug in programming Newton's method. Anyway I'm using a library for that, and I've checked the functions I've supplied a thousand times already. Anyone here have experience with nonlinear parabolic equations? They're not the kind of thing that's typically covered in basic numerical analysis texts.
 
Physics news on Phys.org
  • #2
Can you show your equations you used for the boundary nodes?Also for inner nodes?i can check them for you.
How i do it is, use central diff to discretize bc's. You solve for the imaginary nodes (for 0, its one right outside say 0-, for 1 its 1+). Then you write the discrete form of the PDE then plug in the values for 1+ in terms of 1- and 0- in terms of 0+ (they are equal for your bcs). I used central diff because its 2nd order accurate in x, like the discrete form for the second derivative.I don't know if f(u) creates some weirdness but i don't think so, its a pretty well behaved function.
Also i use the link below, they have analytical solutions for many types of pde's. You can use that to verify your calculations.

http://eqworld.ipmnet.ru/index.htm
 
  • #3
I'm using FD equations at the boundary nodes exactly like you describe: "central difference" because it's 2nd order accurate. The discretization matrix looks like:

[tex]A =
\begin{pmatrix}
-2 & 2 & 0 & \ldots \\
1 & -2 & 1 & 0 & \ldots \\
0 & 1 & -2 & 1 &\ldots
\end{pmatrix}, [/tex]

and I assume you know the rest. Writing [tex]U^n = (U_0^n,\ldots,U_m^n)^T[/tex] for the approximation at the n-time step, the backward Euler method for the heat equation is:

[tex]\frac{U^{n+1} - U^n}{k} = h^{-2}AU^{n+1},[/tex]

which becomes

[tex](I - (k/h^2)A)U^{n+1} = U^n.[/tex]

The matrix [tex]I - (k/h^2)A[/tex] is what I'm calling [tex]B[/tex]. According to my reasoning, the nonlinear equation involves a function [tex]F:\mathbf{R}^{m+1}\to \mathbf{R}^{m+1}[/tex] yielding a nonlinear backward Euler method:

[tex]\frac{U^{n+1} - U^n}{k} = h^{-2}AU^{n+1} + F(U^{n+1}).[/tex]

In the case of the Fisher-Kolmogorov eqn., [tex]F_i(U) = U_i(1-U_i)[/tex] in each coordinate. Again, I haven't found this in any books, but it's the most obvious thing to do. The system of equations I have to solve in each time step is:

[tex]BU^{n+1} -kF(U^{n+1}) - U^n = 0;[/tex]

sorry for changing my notation from my first post a little. I have to supply the left hand side together with its Jacobian to the nonlinear solver. Here the "current" time step [tex]U^n[/tex] is treated as a constant. The Jacobian of the LHS is [tex]B - kF'[/tex], where the Jacobian [tex]F'[/tex] is the obvious diagonal matrix.

So far so good?

For Newton's method I'm using the multi-root solver in the GNU Scientific Library http://www.gnu.org/software/gsl/. For my initial condition I'm using a Gaussian,

[tex] u_0(r) = \exp(-(r-0.5)^2/\sigma^2),[/tex]

with [tex]\sigma[/tex] chosen so that the function is basically flat at the endpoints [tex]x_0 = 0[/tex] and [tex]x_m = 1.[/tex] The solution I'm getting for the first time step clearly violates the boundary conditions, and taking this [tex]U^1[/tex] as a starting point, the solver doesn't even converge for the second time step.

The logical explanation is that I've done something wrong with the nonlinear solver, and I'll be embarrassed for wasting everyone's time if that turns out to be the case. But I've reexamined that code so often by now, I'm starting to entertain the idea that I've missed something subtle with the boundary conditions for the FD equations.

Thanks for your help in this matter!

Jerry
 
  • #4
It seems fine to me. one issue with Newton's method is you should be close enough to the root, otherwise it might not converge. maybe you might change the IC, if its ok, to something that satisfies the BC's also. then the guess values(the prev values) might be closer to the solution.
 
  • #5
Ah one more thing.first, you can evaluate the nonlinear terms in the current time step, solve the system with regular gauss elimination. Then use those values as the initial guess for the solution of the original equations where the nonlinear terms are evald in the forward time.
 
  • #6
Hi Emreth,

I said in my last post that the initial condition u_0 is "basically flat at the endpoints." Thinking that that may be the problem, I modified it to satisfy the Neumann BC's exactly: to no avail. The same problem persists.

My starting guess for finding [tex]U^{n+1}[/tex] with Newton's method is (the logical choice) [tex]U^n[/tex] itself. The time step [tex]k[/tex] I'm using is so small that the evolution should be tame. I know how solutions of the Fisher-Kolmogorov equation behave, and behavior of my numerical solution on the interior of the domain agrees with that. The problem is just at the boundary, most notably at [tex]x_0 = 0.[/tex]

Thanks too for the tip on solving the linear part of the system forward in time to get a better initial guess for the nonlinear equations. I'll take a look at that later and get back to you.

Jerry
 
  • #7
problem evidently resolved

It looks like I've found the problem, indeed a bug: a typo among variable names in initializing the system. Ludicrous how something like that can "emulate" a numerical error, especially ludicrous when considering how much time I spent looking for it! Thanks anyway to everyone who at least skimmed through the thread or thought about the problem.

Jerry
 

1. What are nonlinear parabolic equations?

Nonlinear parabolic equations are a type of partial differential equation that describes the behavior of a system over time. They are characterized by a time-dependent component and a spatially-dependent component, and involve nonlinear terms that make the equations more complex than linear parabolic equations.

2. What is the finite difference method?

The finite difference method is a numerical technique used to approximate solutions to differential equations. It involves dividing the space and time domain into discrete grid points and using finite difference approximations to calculate the values of the solution at these points. This method is commonly used for solving parabolic equations, including nonlinear ones.

3. How is the finite difference method applied to solve nonlinear parabolic equations?

To solve a nonlinear parabolic equation using the finite difference method, the equation is first discretized using finite difference approximations. This results in a system of algebraic equations that can be solved using numerical methods, such as the Gauss-Seidel or Newton's method. The solution is then reconstructed by interpolating the values at the grid points.

4. What are the advantages of using the finite difference method for nonlinear parabolic equations?

One advantage of the finite difference method is its simplicity and ease of implementation. It is also a versatile method that can be applied to a wide range of nonlinear parabolic equations. Additionally, it allows for fine-tuning of the grid size and time step to achieve desired levels of accuracy.

5. Are there any limitations to using the finite difference method for nonlinear parabolic equations?

One limitation of the finite difference method is that it can only be used for problems with regular geometries. It also requires a large number of grid points to accurately capture the behavior of the solution, making it computationally expensive for complex problems. Additionally, the method may not converge if the equation is highly nonlinear or if the initial and boundary conditions are not well-defined.

Similar threads

  • Atomic and Condensed Matter
Replies
4
Views
1K
Replies
4
Views
748
Replies
3
Views
798
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
991
  • Calculus and Beyond Homework Help
Replies
5
Views
612
  • Differential Equations
Replies
8
Views
4K
  • Atomic and Condensed Matter
Replies
1
Views
1K
Replies
17
Views
2K
Replies
4
Views
637
Back
Top