Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mark Trew CT1 2002. BARDS of Passion and of Mirth, Ye have left your souls on earth! Have ye souls in heaven too, Double-lived in regions new? Yes, and.

Similar presentations


Presentation on theme: "Mark Trew CT1 2002. BARDS of Passion and of Mirth, Ye have left your souls on earth! Have ye souls in heaven too, Double-lived in regions new? Yes, and."— Presentation transcript:

1 Mark Trew CT1 2002

2 BARDS of Passion and of Mirth, Ye have left your souls on earth! Have ye souls in heaven too, Double-lived in regions new? Yes, and those of heaven commune With the spheres of sun and moon; With the noise of fountains wond’rous, And the parle of voices thund’rous; With the whisper of heaven’s trees And one another, in soft ease Seated on Elysian lawns Brows’d by none but Dian’s fawns; Underneath large blue-bells tented, Where the daisies are rose-scented, And the rose herself has got Perfume which on earth is not; Where the nightingale doth sing Not a senseless, tranced thing, But divine melodious truth; Philosophic numbers smooth; Tales and golden histories Of heaven and its mysteries. John Keats (1795-1821)

3 Ode

4 Ordinary Differential Equations

5 Mark Trew CT1 2002 Ordinary Differential Equations x – independent variable y – dependent variable First order ODE, dependent variable function of one independent variable Example: growth of bacteria Other examples: Pendulum: ODEs can be used to “model” behaviour Higher order ODEs can always be expressed as 1 st order Vibrating mass on spring:

6 Mark Trew CT1 2002 Solutions General solutions or level curves Particular solution specified by initial value x y e.g. In general: Separable ODEs So:

7 Mark Trew CT1 2002 Solutions Closed form solutions: e.g.where: gives: Not a closed form solution What should we do when no suitable closed form solution exists? Answer: form a numerical model of the ODE to give approximate y values at a number of x points. Advantages of a numerical model: Disadvantages of a numerical model: Can handle any ODE, quickly generate solutions without Extensive maths, good for solving on computers. Stability (solution can be badly behaved – thus, inaccurate), accuracy (can be well-behaved but inaccurate).

8 Mark Trew CT1 2002 Numerical Solutions Initial value problems: Step by step methods: Use information from current position, not future General solution stepping fromtois: knowdon’t know? Modelling challenge: Represent or approximate:

9 Mark Trew CT1 2002 Euler’s Method Assume that from Integration becomes: so that: to

10 Mark Trew CT1 2002 Euler’s Method Geometric interpretation: x x y f(x,y) polygon approx to y and constant approximation to f(x,y) Reasonable model/approximation if y is smooth and not varying fast. A sequence of steps gives the solution at discrete points.

11 Mark Trew CT1 2002 Improving the Euler Method Assume that from x 0 to x 1, f(x,y) is varying linearly: Integration becomes: h f Problem. y 1 is the unknown! f(x 1,y 1 ) cannot be evaluated.

12 Mark Trew CT1 2002 Improving the Euler Method Solution. Use the Euler prediction of y 1 to evaluate f(x 1,y 1 ) predictor corrector Geometric interpretation: x x y f(x,y * ) polygon approx to y and trapezoidal approximation to f(x,y * )

13 Mark Trew CT1 2002 Next time… Accuracy, Stability and Convergence to a Solution

14 Mark Trew CT1 2002 Accuracy – Truncation or Discretisation Error Taylor series expansion of unknown function y(x) : Euler’s method truncates this series from 3 rd term, i.e. h 2. First order method. Error is proportional to step length. Improved Euler. Expand f(x 1,y 1 ) using Taylor series: Substitute into Improved Euler update and compare with expansion for y 1. Improved Euler method truncates y 1 expansion at 4 th term. Second order method. Error decreases twice as fast as the step length.

15 Mark Trew CT1 2002 Stability Generally indicates how much impact inaccuracy will have on solution behaviour. e.g. Unexpected behaviour that is a property of the discretisation and not accumulation error decaying exponential for a < 0 For this same behaviour to be observed in an approximate solution calculated using Euler’s method: Otherwise, y (and error) grows with x, rather than decaying

16 Mark Trew CT1 2002 Convergence to a Solution Accumulation error: a large number of small steps allows numerical arithmetic errors to accumulate. Choose step size to give: -a sufficiently accurate solution (least truncation error) -least accumulation error (also most computationally economic) How do we determine “sufficiently accurate” when true y is not known? Convergence analysis. In practice, for a given x n point: -calculate y(x n ) for a range of h values -plot y(x n ) vs h and look for convergent behaviour h yy(x n )


Download ppt "Mark Trew CT1 2002. BARDS of Passion and of Mirth, Ye have left your souls on earth! Have ye souls in heaven too, Double-lived in regions new? Yes, and."

Similar presentations


Ads by Google