Академический Документы
Профессиональный Документы
Культура Документы
Definition
A function f (t, y) is said to satisfy a Lipschitz condition in the
variable y on a set D R2 if a constant L > 0 exists with
|f (t, y1 ) f (t, y2 )| L|y1 y2 |,
Per-Olof Persson
persson@berkeley.edu
Department of Mathematics
University of California, Berkeley
Definition
Well-Posedness
Theorem
R2 .
Theorem
Suppose that D = {(t, y) | a t b, < y < } and that
f (t, y) is continuous on D. If f satisfies a Lipschitz condition on
D in the variable y, then the initial-value problem
y 0 (t) = f (t, y),
a t b,
y(a) = ,
Definition
The initial-value problem
dy
= f (t, y),
dt
z(a) = + 0 ,
Eulers Method
Theorem
Suppose D = {(t, y) | a t b and < y < }. If f is
continuous and satisfies a Lipschitz condition in the variable y on
the set D, then the initial-value problem
is well-posed.
a t b,
Well-Posedness
y(a) = ,
dy
= f (t, y),
dt
a t b,
a t b,
y(a) =
y(a) =
ti = a + ih,
for each i = 0, 1, 2, . . . , N.
Eulers Method
Error Bound
(ti+1 ti )2 00
y (i )
2
for i (ti , ti+1 ). Since h = ti+1 ti and y 0 (ti ) = f (ti , y(ti )),
y(ti+1 ) = y(ti ) + hf (ti , y(ti )) +
h2 00
h (i ).
2
i = 0, 1, . . . , N 1
Theorem
Suppose f is continuous and satisfies a Lipschitz condition with
constant L on
D = {(t, y) | a t b, < y < }
and that a constant M exists with
|y 00 (t)| M,
a t b,
y(a) = ,
i
hM h L(ti a)
e
1 .
2L
Definition
The difference method
y(a) = .
wi+1 = wi + h(ti , wi )
h2 00
y (ti ) +
2
hn (n)
hn+1 (n+1)
y (ti ) +
y
(i )
n!
(n + 1)!
h2
= y(ti ) + hf (ti , y(ti )) + f 0 (ti , y(ti )) +
2
hn (n1)
hn+1 (n)
=
f
(ti , y(ti )) +
f (i , y(i ))
n!
(n + 1)!
a t b,
for each i = 0, 1, . . . , N 1.
w0 =
wi+1 = wi + hT (n) (ti , wi ),
i = 0, 1, . . . , N 1
where
T (n) (ti , wi ) = f (ti , wi ) +
h 0
h(n1) (n1)
f (ti , wi ) + +
f
(ti , wi )
2
n!
a t b,
y(a) = ,
with step size h and if y C n+1 [a, b], then the local truncation
error is O(hn ).
Theorem
Suppose f (t, y) and partial derivatives up to order n + 1
continuous on D = {(t, y) | a t b, c y d}, let
(t0 , y0 ) D. For (t, y) D, there is [t, t0 ] and [y, y0 ] with
f (t, y) = Pn (t, y) + Rn (t, y)
f
f
Pn (t, y) = f (t0 , y0 ) + (t t0 ) (t0 , y0 ) + (y y0 ) (t0 , y0 )
t
y
(t t0 )2 2 f
2f
+
(t0 , y0 ) + (t t0 )(y y0 )
(t0 , y0 )
2
t2
ty
(y y0 )2 2 f
+
(t0 , y0 ) +
2
y 2
n
nf
X
1
n
+
(t t0 )nj (y y0 )j nj j (t0 , y0 )
n!
t y
j
Theorem
(contd)
Rn (t, y) =
n+1
X n + 1
1
(t t0 )n+1j (y y0 )j
(n + 1)!
j
j=0
n+1 f
n+1j j (, )
t
y
j=0
Runge-Kutta Methods
Runge-Kutta Methods
a1 f (t + 1 , y + 1 ) = a1 f (t, y) + a1 1
h 0
f (t, y) = T (2) (t, y).
2
h f
h f
(t, y) +
(t, y) f (t, y)
2 t
2 y
Runge-Kutta Methods
a1 = 1 a1 1 =
h
,
2
a1 1 =
h
,
2
1 =
h
f (t, y)
2
a1 = 1,
1 =
h
f (t, y)
2
Runge-Kutta Methods
Runge-Kutta Order Four
This gives
T (2) (t, y) = f
t+
h
h
h
h
, y + f (t, y) R1 t + , y + f (t, y)
2
2
2
2
with R1 (, ) = O(h2 )
Midpoint Method
wi+1 = wi + hf
f
(t, y) + a1 R1 (t + 1 , y + 1 )
y
w0 = ,
+ a1 1
f
(t, y)
t
Since
f 0 (t, y) =
h
h
t + , wi + f (ti , wi ) ,
2
2
i = 0, 1, . . . , N 1
w0 =
k1 = hf (ti , wi )
h
1
k2 = hf ti + , wi + k1
2
2
h
1
k3 = hf ti + , wi + k2
2
2
k4 = hf (ti+1 , wi + k3 )
1
wi+1 = wi + (k1 + 2k2 + 2k3 + k4 )
6
Local truncation error O(h4 )
MATLAB Implementation
function [t,w]=rk4(f,a,b,alpha,N)
h=(b-a)/N;
t=a:h:b;
w=zeros(length(alpha),N+1);
w(:,1)=alpha;
for i=1:N
k1=h*f(t(i),w(:,i));
k2=h*f(t(i)+h/2,w(:,i)+k1/2);
k3=h*f(t(i)+h/2,w(:,i)+k2/2);
k4=h*f(t(i)+h,w(:,i)+k3);
w(:,i+1)=w(:,i)+(k1+2*k2+2*k3+k4)/6;
end
w0 =
i, w
w
i+1 = w
i + h(t
i , h)
1
(y(ti+1 ) wi+1 )
h
i+1 (h) =
1
(y(ti+1 ) w
i+1 )
h
We then have
i+1 (h) = i+1 (h) +
1
1
(w
i+1 wi+1 ) (w
i+1 wi+1 )
h
h
since i+1 (h) is O(hn ) and i+1 (h) is O(hn+1 ). Now find a new
step size qh with i+1 (qh) bounded by :
i+1 (h) Khn = i+1 (qh) K(qh)n = q n (Khn ) q n i+1 (h)
Choose q so that
qn
|w
i+1 wi+1 | |i+1 (qh)|
h
or
q
h
|w
i+1 wi+1 |
1/n
Multistep Methods
Multistep Methods
Definition
An m-step multistep method for solving the initial-value problem
y 0 = f (t, y),
a t b,
y(a) = ,
w1 = 1 , w2 = 2 , w3 = 3 ,
h
= wi + [55f (ti , wi ) 59f (ti1 , wi1 )
24
+ 37f (ti2 , wi2 ) 9f (ti3 , wi3 )]
w 1 = 1 ,
...,
wm1 = m1
w0 = ,
wi+1
w1 = 1 , w2 = 2 ,
h
= wi + [9f (ti+1 , wi+1 ) + 19f (ti , wi )
24
5f (ti1 , wi1 ) + f (ti2 , wi2 )]
y = f (t, y),
a t b,
y(a) =
ti+1
f (t, y(t)) dt
s
k f (ti , y(ti )) dt
k
ti
k=0
Z 1
m1
X
s
=
k f (ti , y(ti ))h(1)k
ds
k
0
ti+1
ti
f (t, y(t)) dt
ti
ti
w1 = 1 , w2 = 2 ,
h
= wi + [23f (ti , wi ) 16f (ti1 , wi1 ) + 5f (ti2 , wi2 )]
12
Predictor-Corrector Methods
(0)
s
k
ds
0
1
1
2
5
12
3
8
251
720
95
288
h
(0)
[9f (t4 , w4 ) + 19f (t3 , w3 )
24
5f (t2 , w2 ) + f (t1 , w1 )]
a t b,
y(a) = ,
and
wi+1 =am1 wi + + a0 wi+1m
Error Control
Use the predictor-corrector method for error estimation
Adams-Bashforth and Adams-Moulton truncation errors:
(0)
y(ti+1 ) wi+1
251 (5)
=
y (
i )h4
h
720
y(ti+1 ) wi+1
19 (5)
=
y (
i )h4
h
720
Assuming y (5) (
i ) y (5) (
i ), we have
(0)
wi+1 wi+1
3
h4 y (5) (
i )
h
8
w4 = w3 +
Iterations
sufficient
y 0 = f (t, y),
h
[55f (t3 , w3 ) 59f (t2 , w2 )
24
+ 37f (t1 , w1 ) 9f (t0 , w0 )]
(k)
w4
k
R1
w4 = w3 +
(1)
(1)k
Definition
If y(t) solves
1
5 2
y(ti+1 ) y(ti ) + h f (ti , y(ti )) + f (ti , y(ti )) +
f (ti , y(ti ))
2
12
h
= y(ti ) +
[23f (ti , y(ti )) 16f (ti1 , y(ti1 )) + 5f (ti2 , y(ti2 ))]
12
(0)
(1)k
P (t) dt
Three-step Adams-Bashforth:
wi+1
ti+1 m1
X
k=0
ti+1
or
y (5) (
i )
8
(0)
(wi+1 wi+1 )
3h5
Error Control
Extrapolation Methods
19|wi+1
270h
(0)
wi+1 |
270
h
19 |wi+1 w(0) |
i+1
Extrapolation Methods
y(a) =
!1/4
a t b,
w1 = w0 + h0 f (a, w0 )
w2 = w0 + 2h0 f (a + h0 , w1 )
1
y1,1 = [w2 + w1 + h0 f (a + 2h0 , w2 )]
2
Then set h1 = h/4 and repeat to obtain y2,1
Extrapolation Methods
1
y(a + h) = y2,1 + (y2,1 y1,1 ) 2 +
3
64
y3,1 = w(t, h2 )
y2,2 = y2,1 +
y3,2 = y3,1 +
h2
1
2
h2
0 h1
h2
2
2
h2
1 h2
(y2,1 y1,1 )
(y3,1 y2,1 )
y3,3 = y3,2 +
h2
2
2
h2
0 h2
(y3,2 y2,2 )
Definition
The function f (t, y1 , . . . , ym ), defined on the set
D = {(t, u1 , . . . , um ) | a t b, < ui < , i = 1, 2, . . . , m}
is said to satisfy a Lipschitz condition on D in the variables
u1 , u2 , . . . , um if a constant L > 0 exists with
|f (t, u1 , . . . , um ) f (t, z1 , . . . , zm )| L
for all (t, u1 , . . . , um ) and (t, z1 , . . . , zm ) in D.
m
X
j=1
|uj zj |,
Numerical Methods
Numerical methods for systems of first-order differential equations
are vector-valued generalizations of methods for single equations.
Theorem
Suppose
w0 =
uk (a) = k ,
k1 = hf (ti , wi )
h
1
k2 = hf (ti + , wi + k1 )
2
2
h
1
k3 = hf (ti + , wi + k2 )
2
2
k4 = hf (ti+1 , wi + k3 )
1
wi+1 = wi + (k1 + 2k2 + 2k3 + k4 )
6
k = 1, . . . , m
Definition
A one-step difference-equation with local truncation error i (h) is
said to be consistent if
lim max |i (h)| = 0
Theorem
Suppose the initial-value problem y 0 = f (t, y), a t b,
y(a) = is approximated by a one-step difference method in the
form w0 = , wi+1 = wi + h(ti , wi , h). Suppose also that h0 > 0
exists and (t, w, h) is continuous with a Lipschitz condition in w
with constant L on D, then
h0 1iN
Definition
A one-step difference equation is said to be convergent if
(t, y, 0) = f (t, y)
h0 1iN
Root Condition
(h) L(ti a)
e
.
L
Stability
Definition
Let 1 , . . . , m denote the roots of the characteristic equation
m
m1
P () = am1
a1 a0 = 0
Definition
1 Methods that satisfy the root condition and have = 1 as the
only root of magnitude one are called strongly stable.
2
Methods that satisfy the root condition and have more than
one distinct root with magnitude one are called weakly stable.
Theorem
A multistep method
wi+1 =am1 wi + am2 wi1 + + a0 wi+1m
+ hF (ti , h, wi+1 , wi , . . . , wi+1m )
Stiff Equations
0 t 1.5,
y 0 = y,
y(0) = ,
where < 0
y(0) =
1
3
Multistep Methods
Region of Stability
or
(1 hbm )wj+1 (am1 + hbm1 )wj (a0 + hb0 )wj+1m = 0
m
X
ck (k )j
k=1
Definition
The region R of absolute stability for a one-step method is
R = {h C | |Q(h)| < 1}, and for a multistep method, it is
R = {h C | |k | < 1, for all zeros k of Q(z, h)}.
A numerical method is said to be A-stable is its region R of
absolute stability contains the entire left half-plane.