MATH 417 Lecture 16

From Notes
Jump to navigation Jump to search

« previous | Thursday, March 20, 2014 | next »


Differential Equations

Initial value problem ODE:

{dydt=f(t,y(t))y(a)=α

for t[a,b].

Discretize the interval into n points, and let h=ban

ti=a+hi for i0,1,,n

We are given a method

{w0=αwi+1=wi+hϕ(ti,wi)

Last Time: Euler

Let ϕ(t,y(t))=f(t,y(t))

  1. Given a current approximation wi, we want {y(t)=f(t,y(t))y(ti)=wi
  2. Approximate f(t,y(t))f(ti,wi)
  3. w(t)=f(ti,wi) by ODE definition
  4. w(ti+1)=wi+hf(ti,wi)


Error

|yiwi|hM2L(eL(tia)1)

In order for |y(b)wn|O(h), we must have |y(t)|M and the IVP must be well-posed:

  1. f(t,y) is continuous in D={(t,y)atb,y}
  2. f must be Lipschitz continuous: |f(t,x)f(t,y)|L|xy| for all (t,x),(t,y)D
  3. D must be a convex set: for every two points in the set, the line between them must lie entirely in the set.


Lipschitz Continuity

There is an easy way to verify Lipschitz continuity using partial derivatives:

Rewrite definition as

|f(t,x)f(t,y)xy|L

Then |fy(t,ξ)|L


Euler Method Roundoff Error

Each step has a small δi, so the accumulated error is δ

On most machines, δ1016

Then the error equation becomes |y(b)wn|O(h+δh)

Don't make h too small, otherwise accumulated error δ will be more than the error of h


Cost of evaluating is number of steps × local cost

Let error term be bounded by ϵ.

For euler, the cost is baϵ1

Euler is an order-1 method


Taylor Series Based Methods

y(ti+h)=y(ti)+hy(ti)+h22y(ti)+h33!y(ti)+errorhT(n)(t,y)=h(y(ti)+h2y(ti)+h26y(ti)+)

Let's calculate for multiple values of n:

n = 1

hT(1)(t,y)=hy(ti)=hf(t,y)

(this is Euler's method)

Our numerical method is then wi+1=wi+hf(ti,wi)


n = 2

hT(2)(t,y)=hy(ti)+h22y(ti)=hf(t,y)+h22ddt(f(t,y(t)))=hf+h22(ft+fyy(t))=hf(t,y)+h22(ft(t,y)+fy(t,y)f(t,y))

Our numerical method is then wi+1=wi+hf(ti,wi)+h22(ft(ti,wi)+fy(ti,wi)f(ti,wi))


Local Truncation Error

At each step, how far off is our approximation?

τi+1(h)=yi+1(yi+hϕ(ti,yi))h

For Taylor-series-based methods, ϕ=T(n)(ti,yi), and

τi+1(h)=hn+1(n+1)!y(n+1)(ξ)1h=Chn



n = 3

hT(3)(t,y)=hy(ti)+h22y(ti)+h36y(ti)

Then

wi+1=wi+hT(3)(ti,wi)==wi+h(hf+h22(ft+fyf)+h36(ftt+ftyf+f(fyt+fyyf)+ft(ft+fyf)))

Numerical Integration Methods

Given wi, we want to construct wi+1

So far, we have seen:

  • Euler: wi+1=wi+hf(ti,wi)
  • Taylor: wi+1=wi+hT(n)(ti,wi)

When we evaluate the exact solution to an ODE, we solve

yi+1=y(ti+h)=wi+titi+hf(t,y(t))dt

Let the integrand term be represented by g(t) (assume these values are approximated with accuracy O(h2)):

yi+1=y(ti+h)=wi+titi+hg(t)dt


Modified Euler Method

Euler's method is analogous to evaluating the integral by using the left-riemann summ (a horrible approximation)

Let's use the trapezoidal rule instead:

wi+1=wi+h2(g(ti)+g(ti+1))=wi+h2(f(ti,wi)+f(ti+1,wi+hf(ti,wi)))

If we let zi+1=wi+hf(ti,wi) be the standard Euler method, we can simplify the expression to:

wi+1=wi+h2(f(ti,wi)+f(ti+1,zi+1))


Midpoint Method

Let's try using the midpoint method; this requires evaluation at half-time-steps

wi+1=wi+hf(ti+h2,wi+h2f(ti,wi))

Let zi+12=wi+h2f(ti,wi)

wi+1=wi+hf(ti+h2,zi+12)

Heun's Method

Let's use Gaussian Quadrature with 01f(x)dx14f(0)+34f(23).

Then wi+1=wi+h4(f(ti,wi)+3f(ti+2h3ti+23,wi+2h3f(ti,wi)wi+23))