8.4 Oscillating 1D Systems: A Second Order ODE
257
the Euler-Cromer method (error ∼ Δt) or the second-order Runge-Kutta, or Heun’s,
method (error ∼ Δt 2 ).
Note that the fourth-order Runge-Kutta method is fully explicit so there is never
any need to solve linear or nonlinear algebraic equations, regardless of what f
looks like. However, the stability is conditional and depends on f . There is a large
family of implicit Runge-Kutta methods that are unconditionally stable, but require
solution of algebraic equations involving f at each time step. The Odespy package
has support for a lot of sophisticated explicit Runge-Kutta methods, but not yet
implicit Runge-Kutta methods.
8.4.8 More Effects: Damping, Nonlinearity, and External Forces
Our model problem u + ω 2 u = 0 is the simplest possible mathematical model for
oscillating systems. Nevertheless, this model makes strong demands to numerical
methods, as we have seen, and is very useful as a benchmark for evaluating the
performance of numerical methods.
Real-life applications involve more physical effects, which lead to a differential
equation with more terms and also more complicated terms. Typically, one has
a damping force f (u ) and a spring force s(u). Both these forces may depend
nonlinearly on their argument, u or u. In addition, environmental forces F (t) may
act on the system. For example, the classical pendulum has a nonlinear “spring”
or restoring force s(u) ∼ sin(u), and air resistance on the pendulum leads to a
damping force f (u ) ∼ |u |u . Examples on environmental forces include shaking
of the ground (e.g., due to an earthquake) as well as forces from waves and
wind.
With three types of forces on the system: F , f , and s, the sum of forces is
written F (t) − f (u ) − s(u). Note the minus sign in front of f and s, which
indicates that these functions are defined such that they represent forces acting
against the motion. For example, springs attached to the wheels in a car are
combined with effective dampers, each providing a damping force f (u ) = bu
that acts against the spring velocity u . The corresponding physical force is then
−f : −bu , which points downwards when the spring is being stretched (and u
points upwards), while −f acts upwards when the spring is being compressed (and
u points downwards).
Figure 8.28 shows an example of a mass m attached to a potentially nonlinear
spring and dashpot, and subject to an environmental force F (t). Nevertheless, our
general model can equally well be a pendulum as in Fig. 8.29 with s(u) = mg sin θ
and f ( ˙
u) =
1
2 C D AA ˙
θ| ˙
θ | (where C D = 0.4, A is the cross sectional area of the
body, and is the density of air).
Newton’s second law for the system can be written with mass times acceleration
on the left-hand side and the forces on the right-hand side:
mu
= F (t) − f (u
) − s(u) .
257
the Euler-Cromer method (error ∼ Δt) or the second-order Runge-Kutta, or Heun’s,
method (error ∼ Δt 2 ).
Note that the fourth-order Runge-Kutta method is fully explicit so there is never
any need to solve linear or nonlinear algebraic equations, regardless of what f
looks like. However, the stability is conditional and depends on f . There is a large
family of implicit Runge-Kutta methods that are unconditionally stable, but require
solution of algebraic equations involving f at each time step. The Odespy package
has support for a lot of sophisticated explicit Runge-Kutta methods, but not yet
implicit Runge-Kutta methods.
8.4.8 More Effects: Damping, Nonlinearity, and External Forces
Our model problem u + ω 2 u = 0 is the simplest possible mathematical model for
oscillating systems. Nevertheless, this model makes strong demands to numerical
methods, as we have seen, and is very useful as a benchmark for evaluating the
performance of numerical methods.
Real-life applications involve more physical effects, which lead to a differential
equation with more terms and also more complicated terms. Typically, one has
a damping force f (u ) and a spring force s(u). Both these forces may depend
nonlinearly on their argument, u or u. In addition, environmental forces F (t) may
act on the system. For example, the classical pendulum has a nonlinear “spring”
or restoring force s(u) ∼ sin(u), and air resistance on the pendulum leads to a
damping force f (u ) ∼ |u |u . Examples on environmental forces include shaking
of the ground (e.g., due to an earthquake) as well as forces from waves and
wind.
With three types of forces on the system: F , f , and s, the sum of forces is
written F (t) − f (u ) − s(u). Note the minus sign in front of f and s, which
indicates that these functions are defined such that they represent forces acting
against the motion. For example, springs attached to the wheels in a car are
combined with effective dampers, each providing a damping force f (u ) = bu
that acts against the spring velocity u . The corresponding physical force is then
−f : −bu , which points downwards when the spring is being stretched (and u
points upwards), while −f acts upwards when the spring is being compressed (and
u points downwards).
Figure 8.28 shows an example of a mass m attached to a potentially nonlinear
spring and dashpot, and subject to an environmental force F (t). Nevertheless, our
general model can equally well be a pendulum as in Fig. 8.29 with s(u) = mg sin θ
and f ( ˙
u) =
1
2 C D AA ˙
θ| ˙
θ | (where C D = 0.4, A is the cross sectional area of the
body, and is the density of air).
Newton’s second law for the system can be written with mass times acceleration
on the left-hand side and the forces on the right-hand side:
mu
= F (t) − f (u
) − s(u) .
