Main Page | Report this Page
 
   
Science Forum Index  »  Math - Numerical Analysis Forum  »  explicit versus implicit method for the heat equation
Page 1 of 1    
Author Message
Chris
Posted: Thu Feb 22, 2007 12:18 pm
Guest
hi all,

Many people are solving the one-dimensional heat (diffusion) equation
using central finite differences in space and forward Euler in time.
Then, the time step dt is restricted by the well-known stability
condition dt<dx^2/2/D.

To be able to take larger time steps, some people therefore use the
implicit backward Euler scheme. Then, the time step can indeed be
chosen larger than in the explicit case.

However, as both time integration methods are first order methods, and
the error of the full numerical scheme (including spatial and temporal
discretisation errors) is

e=O(C1*dt+C2*dx^2),

I am wondering if putting much effort in using the backward Euler scheme
(which requires to solve a linear system) has much sense. Isn't the time
step dt in this case also restricted to a condition dt<O(dx^2) due to
accuracy arguments?

Or more generally stated: does it only make sense to use implicit time
integration schemes to alleviate the stability restriction if the order
of those schemes is at least 2 (still for the 1D diffusion equation of
course)?


Any comments on my simplistic vision of numerical algebra are welcome!

Chris
Helmut Jarausch
Posted: Thu Feb 22, 2007 1:09 pm
Guest
Chris wrote:
Quote:

hi all,

Many people are solving the one-dimensional heat (diffusion) equation
using central finite differences in space and forward Euler in time.
Then, the time step dt is restricted by the well-known stability
condition dt<dx^2/2/D.

To be able to take larger time steps, some people therefore use the
implicit backward Euler scheme. Then, the time step can indeed be
chosen larger than in the explicit case.

However, as both time integration methods are first order methods, and
the error of the full numerical scheme (including spatial and temporal
discretisation errors) is

e=O(C1*dt+C2*dx^2),

I am wondering if putting much effort in using the backward Euler scheme
(which requires to solve a linear system) has much sense. Isn't the time
step dt in this case also restricted to a condition dt<O(dx^2) due to
accuracy arguments?

Yes and No. If you have 'rough' initial values (at time "t=0") AND
you want to follow the initial, short transient phase, you're right,
you have to take small time steps. (Note, the same situation
can occur for "positive time" if you have time dependent source
terms our the equation is non-linear)

Note, even if the solution is (looks) smooth the time step of an
explicit scheme is restricted by the highest possible frequencies
even if these aren't present in the current solution. If the time
step is too large, even tiny high frequency parts (e.g. due to rounding
errors) blow up immediately.
On the contrary, with an implicit scheme which is A-stable (or L-stable
if the eigenvalues of the operator in space are real) high frequency
components will be damped out immediately for all time steps.

Quote:

Or more generally stated: does it only make sense to use implicit time
integration schemes to alleviate the stability restriction if the order
of those schemes is at least 2 (still for the 1D diffusion equation of
course)?

No, see above

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
Olin Perry Norton
Posted: Thu Feb 22, 2007 3:18 pm
Guest
Crank-Nicholson is no harder to program
than the implicit forward Euler.

It has the same stability and is second-order
in time rather than first-order.

With one spatial dimension the resulting matrix
is tridiagonal, so the inversion is easy.

Olin Perry Norton
Peter Spellucci
Posted: Fri Feb 23, 2007 5:03 am
Guest
In article <erkpdi$3kq$1@nntp.msstate.edu>,
Olin Perry Norton <norton@dial.msstate.invalid> writes:
Quote:


Crank-Nicholson is no harder to program
than the implicit forward Euler.

It has the same stability and is second-order
in time rather than first-order.

With one spatial dimension the resulting matrix
is tridiagonal, so the inversion is easy.

Olin Perry Norton


this is correct ... but it is not L-stable and may give (bounded but
unphysical) oscillations for large time steps. better: BDF2.
of course you need one additional first line, since this is a two step scheme
hth
peter
Chris
Posted: Fri Feb 23, 2007 5:59 am
Guest
Helmut Jarausch wrote:
Quote:
Chris wrote:


hi all,

Many people are solving the one-dimensional heat (diffusion) equation
using central finite differences in space and forward Euler in time.
Then, the time step dt is restricted by the well-known stability
condition dt<dx^2/2/D.

To be able to take larger time steps, some people therefore use the
implicit backward Euler scheme. Then, the time step can indeed be
chosen larger than in the explicit case.

However, as both time integration methods are first order methods, and
the error of the full numerical scheme (including spatial and temporal
discretisation errors) is

e=O(C1*dt+C2*dx^2),

I am wondering if putting much effort in using the backward Euler
scheme (which requires to solve a linear system) has much sense. Isn't
the time step dt in this case also restricted to a condition
dt<O(dx^2) due to accuracy arguments?


Yes and No. If you have 'rough' initial values (at time "t=0") AND
you want to follow the initial, short transient phase, you're right,
you have to take small time steps. (Note, the same situation
can occur for "positive time" if you have time dependent source
terms our the equation is non-linear)

Note, even if the solution is (looks) smooth the time step of an
explicit scheme is restricted by the highest possible frequencies
even if these aren't present in the current solution. If the time
step is too large, even tiny high frequency parts (e.g. due to rounding
errors) blow up immediately.
On the contrary, with an implicit scheme which is A-stable (or L-stable
if the eigenvalues of the operator in space are real) high frequency
components will be damped out immediately for all time steps.


Or more generally stated: does it only make sense to use implicit time
integration schemes to alleviate the stability restriction if the
order of those schemes is at least 2 (still for the 1D diffusion
equation of course)?


No, see above

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany


Dear Helmut,

thanks for your answer, it is quite in line with what I already
suspected. However, only one thing is not yet fully clear to me. If I am
correct, for the specific case of the diffusion equation, the global
error of both the forward and backward euler scheme is

e=O( C1 * d^2u/dt^2 * dt - C2 * d^4u/dx^4 * dx^2 )

Using the PDE itself, this can be rewritten as

e=O( (C1*dt+C2*dx^2) * d^4u/dx^4).

As far as I know, the constants C1 and C2 are now independent of the
solution itself (but they depend on, e.g., the end time of the
integration).

If the above is correct, it is in line with what you are saying:

1)if we are integrating over _short times_, C1 will be of the same
magnitude of C2, and dt must be of the same magnitude as dx^2.

2)if we want to integrate over _longer times_ (to find, e.g., a state
near a steady-state), then I can understand that the error due to the
time integration becomes smaller and smaller, until we only have the
spatial discretisation error left in the steady-state. My intuitive
explanation for this is that if the scheme is stable, then the errors
also go to zero as time goes to infinity (or is this too simplistic?).
Hence in that case the constant C1 would probably be substantially
smaller than C2, and we may take larger time steps (with the implicit
scheme).


The only thing that I do not understand is why you are speaking about
"rough" initial values: the roughness (or derivatives) appear in both
the time and space discretization (for my specific model problem), and
according to the formula above they should hence not matter (right?).
So the roughness or derivatives determine the actual size of the error
e, but not how dt whould be chosen compared to dx.


Do you agree with my reformulation of your answer? Or is there still
something wrong with my reasoning?


Thanks in any case for your excellent help,

Chris
Helmut Jarausch
Posted: Fri Feb 23, 2007 7:28 am
Guest
Chris wrote:
Quote:
Dear Helmut,

thanks for your answer, it is quite in line with what I already
suspected. However, only one thing is not yet fully clear to me. If I am
correct, for the specific case of the diffusion equation, the global
error of both the forward and backward euler scheme is

e=O( C1 * d^2u/dt^2 * dt - C2 * d^4u/dx^4 * dx^2 )

Using the PDE itself, this can be rewritten as

e=O( (C1*dt+C2*dx^2) * d^4u/dx^4).

As far as I know, the constants C1 and C2 are now independent of the
solution itself (but they depend on, e.g., the end time of the
integration).

If the above is correct, it is in line with what you are saying:

1)if we are integrating over _short times_, C1 will be of the same
magnitude of C2, and dt must be of the same magnitude as dx^2.

2)if we want to integrate over _longer times_ (to find, e.g., a state
near a steady-state), then I can understand that the error due to the
time integration becomes smaller and smaller, until we only have the
spatial discretisation error left in the steady-state. My intuitive
explanation for this is that if the scheme is stable, then the errors
also go to zero as time goes to infinity (or is this too simplistic?).
Hence in that case the constant C1 would probably be substantially
smaller than C2, and we may take larger time steps (with the implicit
scheme).


The only thing that I do not understand is why you are speaking about
"rough" initial values: the roughness (or derivatives) appear in both
the time and space discretization (for my specific model problem), and
according to the formula above they should hence not matter (right?).
So the roughness or derivatives determine the actual size of the error
e, but not how dt whould be chosen compared to dx.


Do you agree with my reformulation of your answer? Or is there still
something wrong with my reasoning?

Let's assume we have a Fourier series of u(t,.) in space (for a fixed t).
The (discrete) Laplacian (in space) has only real, negative eigenvalues
which spread out to -infinity as dx->0 . Each Fourier mode will be
multiplied by exp(lambda*t), where lambda is the corresponding eigenvalue.
If lambda is positive, nothing helps, we have to make dt so small, that
we can follow this exploding exponential.
If on the other hand lambda is (strongly) negative and that's the case
for the Laplacian alone, we would have to follow an rapidly vanishing
exponential. An explicit scheme (in time) approximates the exponential
by a polynomial, an implicit scheme does it with rational functions.
If you have a stable implicit scheme and a large time step, there is
an error when e.g. exp(-100*t) is replaced by 1/(100*t)^2, but that's
no problem.

The error estimates you've cited are not helpful here since they
don't distinguish between a large positive eigenvalue and a
large negative one, they just use the standard Lipschitz number
which amounts to the modulus of the eigenvalue.
Since the modulus of the eigenvalues are unbounded as dx->0
there are misleading here.

Now, what did I mean by 'rough'. If the coefficients of the Fourier series of
u(t,.) at any given time t (especially at the initial time) don't decay
very rapidly, the function u(t,.) is rough.
Now, the higher terms decay very rapidly when time proceeds and
you get the well known smoothing effect of parabolic pdes.
Unless you really want to approximate this rapid decay correctly,
you can take large time steps with a stable implicit scheme.
If you want to follow this decay closely you can use an explicit
scheme with a tiny (i.e. small enough) time step. After some
time, the high frequencies of u(t,.) are died out and you
would like to switch to (much) larger time steps without
suffering bad approximation.
But now, even if there are no high frequencies at all, you
get tiny ones all the time, e.g. by rounding errors, nonlinearities
and source terms.
Now the implicit scheme is robust, it will damp these out so they are
kept tiny. On the other hand, an explicit scheme with a too large a
time step will blow them up (it's really like an explosion, they get
magnified several orders of magnitude in each time time.)

So, theoretical error estimates don't always tell the full truth
in practice.

Helmut.


--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
Peter Spellucci
Posted: Tue Feb 27, 2007 7:18 am
Guest
In article <es1gsd$76r$1@nntp.msstate.edu>,
Olin Perry Norton <norton@dial.msstate.invalid> writes:
Quote:
Peter Spellucci wrote:


this is correct ... but it is not L-stable and may give (bounded but
unphysical) oscillations for large time steps. better: BDF2.
of course you need one additional first line, since this is a two step scheme
hth
peter

Could you briefly explain, or provide a pointer to
an explanation of, L-stable and what it means?

I've tried Googling the term, and I find lots of
material on this method or that method is or is
not L-stable or A-stable, but so far I haven't found
a good definition of these terms.

Is L short for Lyapunov?

Olin Perry Norton

no, I don't know for what "L" stands here, but it means

lim _{Re z -> - infinity} g(z) =0
where g(z) is the stability function of the method. for the trapezoidal rule
(Crank Nicholson) this is
g(z)=(1+z/2)/(1-z/2)
which is absolute stable in the left half plane (abs(g(z))<1) but clearly not
L-stable. L-stable implies strong damping of the stiff components.
for BDF2 g(z) must be replaced by the zeroes of the stability polynomial

(1-(2/3)*z)*x^2 -(4/3)*x+1/3 = 0 (z stands for h*\lambda, h the stepsize)

x_{1,2} = (1/(3-2*z))*(2 +/- sqrt(1+2*z) )

which both tend to zero as Re z-> -infinity
hth
peter
Olin Perry Norton
Posted: Tue Feb 27, 2007 11:13 am
Guest
Peter Spellucci wrote:

Quote:

this is correct ... but it is not L-stable and may give (bounded but
unphysical) oscillations for large time steps. better: BDF2.
of course you need one additional first line, since this is a two step scheme
hth
peter

Could you briefly explain, or provide a pointer to
an explanation of, L-stable and what it means?

I've tried Googling the term, and I find lots of
material on this method or that method is or is
not L-stable or A-stable, but so far I haven't found
a good definition of these terms.

Is L short for Lyapunov?

Olin Perry Norton
Helmut Jarausch
Posted: Tue Feb 27, 2007 12:40 pm
Guest
Olin Perry Norton wrote:
Quote:
Peter Spellucci wrote:


this is correct ... but it is not L-stable and may give (bounded but
unphysical) oscillations for large time steps. better: BDF2.
of course you need one additional first line, since this is a two step
scheme
hth
peter

Could you briefly explain, or provide a pointer to
an explanation of, L-stable and what it means?

I've tried Googling the term, and I find lots of
material on this method or that method is or is
not L-stable or A-stable, but so far I haven't found
a good definition of these terms.

Is L short for Lyapunov?

No,

these stability definitions are tied to the solution of a
scalar linear 'test equation'

y' = lambda * y

with the exact solution C*exp(lambda*t) .
This solution is bounded for all t if lambda
has non-positive real part.

If a numerical scheme has bounded solutions for all
negative real lambdas, it's called L-stable.
If, in addition, it's stable for all complex values
of lambda with non-positive real part, it's called A-stable.


--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
Olin Perry Norton
Posted: Thu Mar 01, 2007 11:27 am
Guest
Thanks to Peter Spellucci and Helmut Jarausch
for their answers to my question.

Olin Perry Norton
Chris
Posted: Fri Mar 02, 2007 1:08 pm
Guest
Thanks to all for the interesting discussion!

Chris

Chris wrote:
Quote:

hi all,

Many people are solving the one-dimensional heat (diffusion) equation
using central finite differences in space and forward Euler in time.
Then, the time step dt is restricted by the well-known stability
condition dt<dx^2/2/D.

To be able to take larger time steps, some people therefore use the
implicit backward Euler scheme. Then, the time step can indeed be
chosen larger than in the explicit case.

However, as both time integration methods are first order methods, and
the error of the full numerical scheme (including spatial and temporal
discretisation errors) is

e=O(C1*dt+C2*dx^2),

I am wondering if putting much effort in using the backward Euler scheme
(which requires to solve a linear system) has much sense. Isn't the time
step dt in this case also restricted to a condition dt<O(dx^2) due to
accuracy arguments?

Or more generally stated: does it only make sense to use implicit time
integration schemes to alleviate the stability restriction if the order
of those schemes is at least 2 (still for the 1D diffusion equation of
course)?


Any comments on my simplistic vision of numerical algebra are welcome!

Chris
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Fri Sep 05, 2008 4:18 am