<- integrateODE(
traj ~ u, dy ~ v,
dx ~ 0, dv ~ -9.8, #dynamics
du x=0, y=100, u = 250, v=0, # initial conditions
bounds(t=0:5)
)
46 Force-balance equations
Up to now, we have been studying dynamics in the format of one or more first-order differential equations. For instance,
LAW II: The alteration of motion is ever proportional to the motive force impressed; and is made in the direction of the right line in which that force is impressed. — Source
In contemporary language, we would say things differently. Instead of “alteration of motion” we would write
the form in which beginning physics students first hear it.
Newton, of course, was very interested in gravity. From previous experiments dropping weights and rolling balls down ramps, as was done by Galileo Galilee (1564-1642), Newton knew that the force of gravity on an object (near the surface of Earth) is proportional to the object’s mass, that is
The simple model of an object moving under the force of gravity is
It is worth noticing how much mathematics needs to be understood before this method of solution makes sense. The fundamental theorem of calculus is what tells us that
There is also physical context to be considered. By setting
Anti-differentiating both sides of
where
Still one more way to write the dynamics of falling under the influence of gravity …. Recognizing that
In this chapter, we will study second-order differential equations in a variety of contexts. But, as for Newton, movement under the influence of gravity will be a focus. Since the second-order differentiation can be interpreted as representing the balance between force and acceleration, we will call these force-balance equations.
In general, a force-balance equation has the form
Second-order differential equations can always be written as a pair of first-order differential equations. To see this, let one of the first-order equations be
Since we know how to solve sets of first-order differential equations by Euler’s method, we can always find the solution
46.1 Ballistics
A lot of the theory of second-order differential equations was developed in the setting of a ball being set off with an initial velocity from an initial position. Such a focus on the flight of balls might seem trivial. Fortunately, language allows us to construct a scientific-sounding word by adding the suffix “istic” to the root “ball.” This suffixing produces the word ballistics.
The importance of ballistics to Newton can be seen by a famous diagram he drew, shown in Figure 46.1. In the diagram, Newton traces the path of a ball shot horizontally from a cannon placed at the top of a mountain.
Since the motion in Newton’s diagram has both vertical and horizontal components, we will need two second-order differential equations:
We found a solution for the vertical equation in the previous section,
The solution for the horizontal component of motion can be found by anti-differentiating both sides of the equation of hortizontal motion:
Regrettably, symbolic anti-differentiation works only in simple cases. To support more realistic models of ballistics, let’s see how to translate the two second-order differential equations into sets of first-order equations. The state variables will be
Figure 46.2 shows the trajectory as calculated by integrateODE()
.
traj_plot(y(t) ~ x(t), traj)
traj_plot(v(t) ~ u(t), traj)
The left panel in Figure 46.2 shows that the trajectory is a parabola. At about
The right panel might seem somewhat strange. You can see that the vertical component of velocity,
The ballistics of real world artillery shells is more complex than the simple model we constructed earlier. What’s missing from that model is air resistance, which is a function of the shell’s velocity and altitude. To illustrate, let’s add in a simple model of air resistance to the earlier ballistic model. In this model, the force of air resistance is a vector pointing in the opposite direction to overall velocity and proportional to velocity squared.
The velocity vector is simply
Representing air resistance by the function
integrateODE()
carries out the calculation in R/mosaic.
<- makeFun(alpha*sqrt(u^2 + v^2) ~ u & v, alpha = 0.003)
r <- integrateODE(
traj2 ~ u, dy ~ v, # dynamics
dx ~ -u*r(u,v), # "
du ~ -9.8 - v*r(u,v), # "
dv x=0, y=100, u = 250, v=0, # initial conditions
domain(t=0:6)
)
46.2 The harmonic oscillator
Consider the motion of a weight attached to a spring, as in Figure 49.2. We will denote the vertical position of the mass by

According to Hooke’s Law, a stretched or compressed spring exerts a force that is proportional to the amount of extension or compression. With our measuring
You can see that the motion is oscillatory, which suggests that the solution to the differential equation will be of the form
To find
Instead of using
46.3 Exponential or sinusoid?
Chapter 45 established that solutions to second-order linear differential equations have the form
How is it possible for the solution to be both in the form of a linear combination of exponentials and a linear combination of sine and cosine? Sinusoids oscillate up and down and up and down, whereas exponentials are monotonic.
To find out what might be the relationship between an exponential and a sinusoid, let’s plug an exponential ansatz
In other words,
46.4 Exponentials with “imaginary” inputs
The “imaginary” in the section title is used in its mathematical sense. In interpreting the word “imaginary,” you should keep in mind a long history in mathematics of assigning insulting names to mathematical objects that, at the time they were first introduced. That is why some numbers are vilified as “negative,” and some as “irrational.” The insult is even more dire for numbers like
You will only get comfortable with “imaginary” numbers when you start to work with them extensively, as happens in physics and engineering courses. Our goal here is merely to increase your awareness of imaginary numbers and some of the ways they are used in the sciences. To that end, we offer three different approaches to understanding the function
Basic, pragmatic understanding. This is the level of understanding that you must have to make sense of the rest of this chapter. Here it is:
So whenever you see , think of .Algebraic understanding via Taylor Polynomials. (optional) This level of understanding can give you confidence that the basic, pragmatic understanding in (1) has honest roots. It also shows the way that (1) is not 100% on target (although good enough for a large fraction of mathematical work). But for many people, algebra is a rocky road to understanding.
The starting point for the algebraic understanding is the Taylor polynomial approximation for
- The arithmetic of complex numbers. (optional) A complex number is a number like
which consists of two parts: the real-part and the imaginary part . When you multiply one complex number by another you get a complex number (although either the real or imaginary parts might happen to be zero.) For example: R knows the rules for arithmetic on complex numbers. To demonstrate, consider the oscillations that result from raising a complex number to successive powers.
Notice that the real part of the result oscillates between negative and positive. The imaginary part also oscillates, but delayed a bit from the real part. Just like sine and cosine.
We can get a clearer picture by plotting Re()
and Im()
do this work.
46.5 Damping
It is common for there to be friction, called damping, in a spring mass system. To keep things very simple, we will consider that the friction is proportional to the velocity and, as in the cannonball example, in the direction opposite to velocity. That is:
As always, this second-order differential equation can be written as a pair of first-order differential equations. One of the first-order differential equations will be
In the previous chapter, we wrote such a pair of linear first-order differential equations as a vector
We used the R function eigen()
to compute the eigenvalues and eigenvectors of the matrix, given numerical values for
As an ansatz for the for the original second-order differential equation
Suppose the stiffness of the spring is much larger than the friction. Then
To graph this function, we need to choose appropriate numerical values for
<- integrateODE(dv~ -r*v - b*y, dy ~ v,
traj v=10, y=0, r=1, b=6,
bounds(t=0:20))
## Solution containing functions v(t), y(t).
traj_plot(y(t) ~ t, traj)
This is the situation with a swinging door. You shove it to swing open, after which it oscillates with a decreasing amplitude.
In contrast, suppose the spring is weak compared to the damping such that
<- integrateODE(dv~ -r*v - b*y, dy ~ v,
traj2 v=10, y=0, r=1, b=0.1,
bounds(t=0:20))
## Solution containing functions v(t), y(t).
traj_plot(y(t) ~ t, traj2) %>%
gf_lims(y = c(0, NA))
The situation in Figure 46.7 is the sort of behavior one expects when giving a shove to an exit door in theater or stadium. The shove causes the door to swing open, after which it slowly returns to the closed position. That gives plenty of time for the people following you to get to the door before it closes.
Finally, consider the case where
<- integrateODE(dv~ -r*v - b*y, dy ~ v, v=10, y=0, r=1, b=0.25, bounds(t=0:20))
traj3 ## Solution containing functions v(t), y(t).
traj_plot(y(t) ~ t, traj3) %>%
gf_lims(y = c(0, NA))
This is a situation called critically damped. The door swings open, then closes as fast as it can without any oscillation.
Let’s return to the car-following control system introduced in Chapter 45. Recall that
it is remarkable that the same
appears both in Newton’s Second Law and in the description of the force of gravity. There was no mathematical theory for this until Albert Einstein (1879-1955)↩︎Another bit of physics which is still not included in the differential equation is that the dynamics hold only until the object hits the ground, at which point the force of gravity will be counter-acted by the force of the ground on the object.↩︎