264
8 Solving Ordinary Differential Equations
Fig. 8.33 Sketch of a one-dimensional, oscillating dynamic system subject to sliding friction and
a spring force
8.4.11 Spring-Mass System with Sliding Friction
A body with mass m is attached to a spring with stiffness k while sliding on a plane
surface. The body is also subject to a friction force f (u ) due to the contact between
the body and the plane. Figure 8.33 depicts the situation. The friction force f (u )
can be modeled by Coulomb friction:
f (u
) =
⎧
⎨
⎩
−μmg, u < 0,
μmg, u > 0,
0,
u = 0
where μ is the friction coefficient, and mg is the normal force on the surface where
the body slides. This formula can also be written as f (u ) = μmg sign(u ), provided
the signum function sign(x) is defined to be zero for x = 0 (numpy.sign has this
property). To check that the signs in the definition of f are right, recall that the
actual physical force is −f and this is positive (i.e., f < 0) when it works against
the body moving with velocity u < 0.
The nonlinear spring force is taken as
s(u) = −kα
−1 tanh(αu),
which is approximately −ku for small u, but stabilizes at ±k/α for large ±αu. Here
is a plot with k = 1000 and u ∈ [−0.1, 0.1] for three α values:
8 Solving Ordinary Differential Equations
Fig. 8.33 Sketch of a one-dimensional, oscillating dynamic system subject to sliding friction and
a spring force
8.4.11 Spring-Mass System with Sliding Friction
A body with mass m is attached to a spring with stiffness k while sliding on a plane
surface. The body is also subject to a friction force f (u ) due to the contact between
the body and the plane. Figure 8.33 depicts the situation. The friction force f (u )
can be modeled by Coulomb friction:
f (u
) =
⎧
⎨
⎩
−μmg, u < 0,
μmg, u > 0,
0,
u = 0
where μ is the friction coefficient, and mg is the normal force on the surface where
the body slides. This formula can also be written as f (u ) = μmg sign(u ), provided
the signum function sign(x) is defined to be zero for x = 0 (numpy.sign has this
property). To check that the signs in the definition of f are right, recall that the
actual physical force is −f and this is positive (i.e., f < 0) when it works against
the body moving with velocity u < 0.
The nonlinear spring force is taken as
s(u) = −kα
−1 tanh(αu),
which is approximately −ku for small u, but stabilizes at ±k/α for large ±αu. Here
is a plot with k = 1000 and u ∈ [−0.1, 0.1] for three α values:
