8.4 Oscillating 1D Systems: A Second Order ODE
259
Note that with the choices f (u ) = 0, s(u) = ku, and F (t) = 0 we recover the
original ODE u + ω 2 u = 0 with ω =
√
k/m.
How can we solve (8.66)? As for the simple ODE u + ω 2 u = 0, we start by
rewriting the second-order ODE as a system of two first-order ODEs:
v
=
1
m
(F (t) − s(u) − f (v)) ,
(8.68)
u
= v .
(8.69)
The initial conditions become u(0) = U 0 and v(0) = V 0 .
Any method for a system of first-order ODEs can be used to solve for u(t) and
v(t).
The Euler-Cromer Scheme An attractive choice from an implementational, accuracy, and efficiency point of view is the Euler-Cromer scheme where we take a
forward difference in (8.68) and a backward difference in (8.69):
v n+1 − v n
Δt
=
1
m
F (t n ) − s(u
n ) − f (v
n )
,
(8.70)
u n+1 − u n
Δt
= v
n+1 ,
(8.71)
We can easily solve for the new unknowns v n+1 and u n+1 :
v
n+1
= v
n
+
Δt
m
F (t n ) − s(u
n ) − f (v
n )
,
(8.72)
u
n+1
= u
n
+ Δtv
n+1 .
(8.73)
Remark on the ordering of the ODEs
The ordering of the ODEs in the ODE system is important for the extended
model (8.68)–(8.69). Imagine that we write the equation for u first and then
the one for v . The Euler-Cromer method would then first use a forward
difference for u n+1 and then a backward difference for v n+1 . The latter would
lead to a nonlinear algebraic equation for v n+1 ,
v
n+1
+
Δt
m
f (v
n+1 ) = v
n
+
Δt
m
F (t n+1 ) − s(u
n+1 )
,
if f (v) is a nonlinear function of v. This would require a numerical method
for nonlinear algebraic equations to find v n+1 , while updating v n+1 through a
forward difference gives an equation for v n+1 that is linear and trivial to solve
by hand.
259
Note that with the choices f (u ) = 0, s(u) = ku, and F (t) = 0 we recover the
original ODE u + ω 2 u = 0 with ω =
√
k/m.
How can we solve (8.66)? As for the simple ODE u + ω 2 u = 0, we start by
rewriting the second-order ODE as a system of two first-order ODEs:
v
=
1
m
(F (t) − s(u) − f (v)) ,
(8.68)
u
= v .
(8.69)
The initial conditions become u(0) = U 0 and v(0) = V 0 .
Any method for a system of first-order ODEs can be used to solve for u(t) and
v(t).
The Euler-Cromer Scheme An attractive choice from an implementational, accuracy, and efficiency point of view is the Euler-Cromer scheme where we take a
forward difference in (8.68) and a backward difference in (8.69):
v n+1 − v n
Δt
=
1
m
F (t n ) − s(u
n ) − f (v
n )
,
(8.70)
u n+1 − u n
Δt
= v
n+1 ,
(8.71)
We can easily solve for the new unknowns v n+1 and u n+1 :
v
n+1
= v
n
+
Δt
m
F (t n ) − s(u
n ) − f (v
n )
,
(8.72)
u
n+1
= u
n
+ Δtv
n+1 .
(8.73)
Remark on the ordering of the ODEs
The ordering of the ODEs in the ODE system is important for the extended
model (8.68)–(8.69). Imagine that we write the equation for u first and then
the one for v . The Euler-Cromer method would then first use a forward
difference for u n+1 and then a backward difference for v n+1 . The latter would
lead to a nonlinear algebraic equation for v n+1 ,
v
n+1
+
Δt
m
f (v
n+1 ) = v
n
+
Δt
m
F (t n+1 ) − s(u
n+1 )
,
if f (v) is a nonlinear function of v. This would require a numerical method
for nonlinear algebraic equations to find v n+1 , while updating v n+1 through a
forward difference gives an equation for v n+1 that is linear and trivial to solve
by hand.
