8.4 Oscillating 1D Systems: A Second Order ODE
261
U_0 = 1
V_0 = 0
T = 12*np.pi
dt = T/5000.
u, v, t = EulerCromer(f=f, s=s, F=F, m=m, T=T,
U_0=U_0, V_0=V_0, dt=dt)
plot_u(u, t)
The plot_u function is a collection of plot commands for plotting u(t), or a part
of it. Figure 8.30 shows the effect of the bu term: we have oscillations with (an
approximate) period 2π, as expected, but the amplitude is efficiently damped.
Remark about working with a scaled problem
Instead of setting b = 0.3 and m = k = U 0 = 1 as fairly “unlikely”
physical values, it would be better to scale the equation mu + bu + ku = 0.
This means that we introduce dimensionless independent and dependent
variables:
¯
t =
t
t c
, ¯
u =
u
u c
,
where t c and u c are characteristic sizes of time and displacement, respectively,
such that ¯
t and ¯
u have their typical size around unity (which minimizes
rounding errors). In the present problem, we can choose u c = U 0 and
t c =
√
m/k. This gives the following scaled (or dimensionless) problem for
the dimensionless quantity ¯
u(¯ t):
d 2 ¯
u
d ¯
t 2 + β
d ¯
u
d ¯
t
+ ¯
u = 0, ¯
u(0) = 1, ¯
u
(0) = 0, β =
b
√
mk
.
The striking fact is that there is only one physical parameter in this
problem: the dimensionless number β. Solving this problem corresponds to solving the original problem (with dimensions) with the
parameters m = k = U 0 = 1 and b = β. However, solving
the dimensionless problem is more general: if we have a solution
¯
u(¯ t; β), we can find the physical solution of a range of problems
since
u(t) = U 0 ¯
u(t
k/m; β) .
As long as β is fixed, we can find u for any U 0 , k, and m from
the above formula! In this way, a time consuming simulation can
be done only once, but still provide many solutions. This demonstrates the power of working with scaled or dimensionless problems.
261
U_0 = 1
V_0 = 0
T = 12*np.pi
dt = T/5000.
u, v, t = EulerCromer(f=f, s=s, F=F, m=m, T=T,
U_0=U_0, V_0=V_0, dt=dt)
plot_u(u, t)
The plot_u function is a collection of plot commands for plotting u(t), or a part
of it. Figure 8.30 shows the effect of the bu term: we have oscillations with (an
approximate) period 2π, as expected, but the amplitude is efficiently damped.
Remark about working with a scaled problem
Instead of setting b = 0.3 and m = k = U 0 = 1 as fairly “unlikely”
physical values, it would be better to scale the equation mu + bu + ku = 0.
This means that we introduce dimensionless independent and dependent
variables:
¯
t =
t
t c
, ¯
u =
u
u c
,
where t c and u c are characteristic sizes of time and displacement, respectively,
such that ¯
t and ¯
u have their typical size around unity (which minimizes
rounding errors). In the present problem, we can choose u c = U 0 and
t c =
√
m/k. This gives the following scaled (or dimensionless) problem for
the dimensionless quantity ¯
u(¯ t):
d 2 ¯
u
d ¯
t 2 + β
d ¯
u
d ¯
t
+ ¯
u = 0, ¯
u(0) = 1, ¯
u
(0) = 0, β =
b
√
mk
.
The striking fact is that there is only one physical parameter in this
problem: the dimensionless number β. Solving this problem corresponds to solving the original problem (with dimensions) with the
parameters m = k = U 0 = 1 and b = β. However, solving
the dimensionless problem is more general: if we have a solution
¯
u(¯ t; β), we can find the physical solution of a range of problems
since
u(t) = U 0 ¯
u(t
k/m; β) .
As long as β is fixed, we can find u for any U 0 , k, and m from
the above formula! In this way, a time consuming simulation can
be done only once, but still provide many solutions. This demonstrates the power of working with scaled or dimensionless problems.
