Presentation is loading. Please wait.

Presentation is loading. Please wait.

Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 3 AB2,AB3, Stability, Accuracy Instructor: Tim Warburton.

Similar presentations


Presentation on theme: "Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 3 AB2,AB3, Stability, Accuracy Instructor: Tim Warburton."— Presentation transcript:

1 Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 3 AB2,AB3, Stability, Accuracy Instructor: Tim Warburton

2 CAAM 452 Spring 2005 Recall: Euler-Forward Time Stepping By several different approximations we arrived at the following approximate ODE time-stepping scheme: Assuming: We established the following stability region i.e. if mu*dt is in the yellow region the approximate solution will be bounded. x Re Im

3 CAAM 452 Spring 2005 Recall: Adams Bashford 2 We went on to derive a similar method which uses Namely AB2: This was based on an interpolation of f(u(t)) We next ask which values of mu*dt is this stable for?

4 CAAM 452 Spring 2005 Derivation of AB3 Suppose we wish to use three previous values of f As previously we look for a fit through this data, although this time we choose a different path. (i)Consider dt = 1 (will rescale later) (ii)Will form the coefficients of the interpolant using a Vandermonde matrix and a monomial basis in t (iii)Finally integrate the integrand (easy with this choice of basis).

5 Simpler Approach (i)form quadratic interpolant: (ii)Compute coefficients: (iii)Integrate interpolant:

6 CAAM 452 Spring 2005 AB3 We now have an interpolant for dt=1 based on three time levels: We rescale and shift: And finally have AB3:

7 CAAM 452 Spring 2005 Absolute Stability of AB2 We again assume: AB2 becomes: Tidying up: To start this method we require:

8 CAAM 452 Spring 2005 Absolute Stability of AB2 cont We define the absolute stability region of this method as the set of nu in the complex plane for which the sequence {u n } is bounded as We will make continuous reference to the stability polynomial of this recurrence relationship (obtained by setting : and canceling excess powers of z )

9 CAAM 452 Spring 2005 Note on Solutions of Recurrence Relations Given an s+1 term recurrence relationship (concisely written as): With stability polynomial: which (we suppose) has s distinct roots Then any solution to the recurrence relation can be written as: where the c m depend on the s initiating values for the recurrence. This follows because is a solution, and there is a limited rank of possible solutions because of the linearity of the recurrence in the initial values. Board demo

10 CAAM 452 Spring 2005 cont Since all solutions under these conditions can be written as: We immediately observe that this is bounded if and only if See Trefethen p43-46 for details of the case where the stability polynomial has 1 or more roots with multiplicity greater than 1.

11 CAAM 452 Spring 2005 Root Condition for Absolute Stability A linear multistep formula is absolutely stable for a particular value of nu if and only if all the zeros of the stability polynomial satisfy and any zero with is a simple root. See: Trefethen p58-60

12 CAAM 452 Spring 2005 Drawing the Stability Region We need to find the roots of the stability polynomial: i.e. Which lie on the margin of stability The method we adopt is to set and find the value of nu such that r is a root of the stability polynomial.

13 CAAM 452 Spring 2005 cont We can rearrange the root equation to find nu in terms of z: We can now ask matlab to plot this curve in the complex plane…

14 CAAM 452 Spring 2005 Matlab Plot of Margin of Stability for AB2

15 CAAM 452 Spring 2005 AB2 v. AB3 v. AB4 I repeated this for AB2, AB3, AB4 Notice how the overall region of absolute stability gets smaller as we use more and more previous values of f This translates into stricter restrictions on dt to force nu=mu*dt into the stability regions.

16 CAAM 452 Spring 2005 Zooming Into The All Important Imaginary Axis Recall, we discounted Euler-Forward as useless for time- stepping the advection equation because it had zero coverage of the imaginary axis. This picture does not quite tell us if the imaginary axis is inside the absolute stability region for AB2, AB3 and AB4. So we had better check the root condition.

17 CAAM 452 Spring 2005 Root Condition for AB2 We need to check that the roots of: Are bounded above by 1, and if any roots are on the unit circle we must make sure they are simple. We set nu=i*alpha

18 CAAM 452 Spring 2005 Always Experiment First So rather than waste time figuring out where the roots are, why not let matlab do the hardwork:

19 CAAM 452 Spring 2005 If at first.. Since the plot is not quite clear, we plot: sign(maximum|root|-1)*log10(|maximum|root|-1|) In summary: the only stable point on the imaginary axis for AB2 is the origin. AB3 is stable for nu in i*[-.723…,.723…]

20 CAAM 452 Spring 2005 Accuracy & Consistency We already established experimentally that stability is not enough for a good solution – we also need to examine how accurate a solution will be. Section 1.3 p21-29 Trefethen

21 CAAM 452 Spring 2005 Consistency Linear Multistep schemes (like Euler-Forward, AB2,AB3..) can be written as: It is natural to ask what is the local discretization error (or local truncation error) for the above formula when we substitute We define the residual operator

22 CAAM 452 Spring 2005 Consistency cont If the linear multistep method is accurate the truncation error should be small. Definition: if then we say the scheme is p’th order accurate.

23 CAAM 452 Spring 2005 Example Euler-Forward has: So: The next step is to estimate this in terms of dt and time derivatives of the solution.

24 CAAM 452 Spring 2005 Recall: Taylor’s Theorem Assuming that f is sufficiently smooth (has n bounded derivatives): Then we can evaluate f at x+delta by a linear sum of f at x and its derivatives: The residual takes various forms: http://mathworld.wolfram.com/TaylorsTheorem.html http://mathworld.wolfram.com/LagrangeRemainder.html (Lagrange remainder)

25 CAAM 452 Spring 2005 Back to Forward-Euler We can now express the local truncation error for Forward-Euler in terms of: expanding about t n we obtain:

26 CAAM 452 Spring 2005 cont This indicates that the Euler-Forward method is “first order in time”. So what does this mean for solution accuracy?

27 CAAM 452 Spring 2005 Existance and Uniqueness for the Initial Value Problem Theorem (p13 Trefethen): Let f(u,t) be continuous with respect to t and uniformly Lipschitz continuous with respect to u for.Then there exists a unique differentiable function u(t) that satisfies the initial-value problem : The important condition here is that the right hand side f is not too non-linear. With these conditions – we know we have a single solution to aim for.

28 CAAM 452 Spring 2005 Definition: Convergence A linear multistep method is convergent if, for all IVP’s satisfying the existance/uniqueness theorem conditions on an interval [0,T] and all starting values for the method tend to u(0) as the solution satisfies uniformly for all The notation small ‘o’ of 1 as dt tends to zero, requires that the solution drops to zero as dt tends to 0.

29 CAAM 452 Spring 2005 Dahlquist Equivalence Theorem Theorem: A linear multistep formula is convergent if and only if it is consistent and stable. Proving convergence of a method directly is difficult, however proving consistency and stability is relatively straight forward. p54 Trefethen

30 CAAM 452 Spring 2005 Finally: an estimate for solution accuracy Theorem (global p’th order accuracy): Consider an IVP that satisfies the existance/uniqueness theorem conditions on an interval [0,T] and in addition that the right hand side function f(u,t) is p times continuously differentiable with respect to u and t. Let an approximate solution be computed by a convergent linear multistep formula of accuracy >= p with starting values as in the convergence statement. Then this solution satisfies: uniformly for all

31 CAAM 452 Spring 2005 Summary Stability + consistency  convergence convergence + method accuracy  global solution accuracy

32 CAAM 452 Spring 2005 Sketch of Solution Accuracy Proof (not entirely rigorous) Given the way we constructed the AB schemes it is instructive to write down the following three equations: N=T/dt

33 CAAM 452 Spring 2005 Sketch cont (i)Represents the actual solution (which we know exists and is unique by the Lipschitz assumptions on f) (ii)Represents acknowledges the impact of using an interpolant for f on the ODE (i.e. the local truncation errors represent the residuals) (iii)Represents the numerical solution u tilde.

34 CAAM 452 Spring 2005 Sketch cont Part 1: we used (i)-(ii) (with T=dt) to estimate L for each time step. Part 2: we look at (ii)-(iii)

35 CAAM 452 Spring 2005 Sketch cont We can now try to bound each term: Bounded by assumption on Initial conditions Bounded by assumption on Stability of the Ip interpolation operator (i) Bounded by assumption on consistency. (ii) Estimated by accuracy study.

36 CAAM 452 Spring 2005 Euler-Forward Solution Accuracy Consider: 1)the right hand side function is certainly Lipschitz! 2)It is certainly p=1 times differentiable 3)If we keep mu*dt in the absolute stability region (unit circle centered at -1 in the complex plane) then it is stable. 4)By Taylor’s theorem it is a p=1 order accurate method. 5)All of the above indicate global solution accuracy which is first order in dt, i.e. the error will be O(dt) as dt  0

37 CAAM 452 Spring 2005 AB2 Global Accuracy We already established the stability region for AB2 – so as long as we keep mu*dt in that region we have stability. Now we have to consider accuracy: AB2 is a 2 nd order acurate method

38 CAAM 452 Spring 2005 cont If the AB2 stability condition is met then the global accuracy result indicates that for a solution at fixed time the solution will be Thus we characterize the scheme as 2 nd order method accurate, and 2 nd order solution accurate.

39 CAAM 452 Spring 2005 AB3 Convergence Expand all terms in the local truncation error about tn  The AB3 scheme is 3 rd order accurate as long as the solution is sufficiently smooth.

40 CAAM 452 Spring 2005 Homework 1 Read chapter 1 of Trefethen’s book. Q1) derive AB4 (use Matlab or Mathematica) Q2) plot the stability region for AB4 Q3) indicate which part of the complex plane is inside the AB4 region of absolute stability (you may need to test at least one point in each closed loop of the marginal stability curve) continued on next slide

41 CAAM 452 Spring 2005 Homework 1 cont Q4a) estimate upper bounds for dt to solve the following with AB2,AB3, and AB4 Q4b) write a code which uses Euler-Forward for the first time step, AB2 for the second time step and AB3 for the third time step (use a suitable dt for AB3 for all time steps) Q4c) use this code and plot the error as a function of time for dt, dt/2, dt/4, dt/8 (i.e. run the simulation 4 times). Q4d) estimate the order of accuracy of the code based on the error at t=5 Q4e) (extra credit) compare the code with an AB3 method started with exact initial data.


Download ppt "Numerical Methods for Partial Differential Equations CAAM 452 Spring 2005 Lecture 3 AB2,AB3, Stability, Accuracy Instructor: Tim Warburton."

Similar presentations


Ads by Google