 Summary

Code

Executable on S2

Videos

Isaac Newton, born a few months after Galileo died, is the greatest scientist of all time, known for his contributions to many fields including mathematics, optics, and classical mechanics. Newton built upon the foundation laid by the Italian physicist and astronomer Galileo Galilei, who had made significant contributions to the study of motion and mechanics.

Galileo’s work laid the foundation for classical mechanics by providing key insights into the motion of objects. Galileo’s work on motion and mechanics was based on the idea that the laws of physics applied equally to all objects, regardless of their weight or composition. He demonstrated this with his famous experiment involving two balls of different weights dropped from the Leaning Tower of Pisa, which showed that they hit the ground at the same time.

Newton expanded on Galileo’s work with his three laws of motion and his law of universal gravitation. Newton’s first law of motion, also known as the law of inertia, states that an object at rest will remain at rest and an object in motion will remain in motion at a constant velocity unless acted upon by an external force. This law built on Galileo’s concept of the uniformity of motion, which stated that an object in motion would continue to move at a constant velocity in the absence of external forces.

Newton’s second law of motion states that the force acting on an object is equal to its mass times its acceleration. This law built on Galileo’s work on acceleration, which showed that the rate of change of an object’s velocity was directly proportional to the force applied to it.

Finally, Newton’s third law of motion states that for every action, there is an equal and opposite reaction. This law built on Galileo’s observation that forces always occur in pairs.

In addition to his work on motion and mechanics, Newton is also famous for his law of universal gravitation, which states that every object in the universe is attracted to every other object with a force that is directly proportional to the product of their masses and inversely proportional to the square of the distance between them. This law built on Galileo’s work on gravity, which showed that all objects fall to the ground at the same rate regardless of their weight.

Newton’s achievements in classical mechanics were groundbreaking and provided a new understanding of the physical world that continues to shape our understanding of physics today. His laws of motion and law of universal gravitation were central to the development of the modern scientific method and helped to establish physics as a rigorous, experimental science.

## Newton’s Second Law of Motion

Newton’s second law of motion states that the acceleration of an object is directly proportional to the force applied to it and inversely proportional to its mass. In other words, the second law states that the greater the force applied to an object, the greater the acceleration it will experience. Likewise, the more massive an object is, the less acceleration it will experience for a given force. In layman’s terms, the harder you push, the faster it accelerates. The heavier it is, the slower it accelerates.

Mathematically, here comes the first most famous equation in physics. It states that

$$F = ma \tag{Newton’s second law of motion}$$

where $$F$$ is the force applied or how hard an object is being pushed; $$m$$ is the mass of the object measuring how massive (or on earth how heavy) it is; $$a$$ is the acceleration.

The unit of mass is kg. One kilo-gram is about the weight of a one-liter bottle of soda. Fruits such as small watermelons and pineapples also have a mass of around 1 kilogram.

The unit of acceleration is m/s². $$a = 1 {\text{ m/s}}^{2}$$ means that an object is adding to its speed by 1 m/s every second. Starting from a still speed, it moves at 1 m/s at time 1, then 2 m/s at time 2, then 3 m/s at time 3. We have already seen it speed curve in the topic “Integration”.

The unit of force is, as you would have guessed, Newton or N. This forever makes Isaac Newton forever immortalized. 1N of force applied to a 1kg object will move it so that the object adds 1m/s to its speed every second. That is,

$$1\text{N} = 1\text{kg} \times 1{\text{ m/s}}^{2}$$

Newton’s second law helps us to understand how objects move when forces are applied to them. For example, if a force of 10 newtons is applied to an object with a mass of 2 kilograms, the object will experience an acceleration of 5 meters per second squared (10 N ÷ 2 kg = 5 m/s²). Conversely, if the same force is applied to an object with a mass of 5 kilograms, the object will experience a smaller acceleration of 2 meters per second squared (10 N ÷ 5 kg = 2 m/s²).

The significance of Newton’s second law of motion cannot be overstated. It is the dawn of modern science and finally overturned many of Aristotle’s ideas about the behavior of objects in the physical world. This fundamental principle is essential to our understanding of how objects move and interact with each other in the physical world. Without this law, we would not have been able to develop many of the technologies and scientific discoveries that have revolutionized our lives, even hundreds of years after Newton.

One of the key contributions of Newton’s second law is that it allows us to make accurate predictions about the motion and behavior of objects. By understanding how force, mass, and acceleration are related, we can make calculations and predictions about the behavior of everything from simple machines to complex systems.

In addition, Newton’s second law has led to the development of many technologies that have transformed our world. For example, the law of acceleration is essential for the development of rockets and satellites, which have enabled us to explore space and learn more about the universe. It is also essential for the development of transportation systems such as cars, airplanes, and trains, which allow us to travel faster and more efficiently than ever before.

Furthermore, Newton’s second law is the basis for many other important physical laws and principles, including the laws of thermodynamics, electromagnetism, and relativity. Without a deep understanding of this law, we would not have been able to develop these other important areas of science.

Overall, Newton’s second law of motion is a crucial component of our understanding of the physical world. It has enabled us to make significant scientific discoveries, develop new technologies, and gain a deeper appreciation for the natural world around us.

## Launch a Rocket

This topic assumes that you understand all previous topics in this lesson. So we will use the math symbols more liberally without repeating the explanations. If you are uncomfortable with some of the symbols, please go back to the previous topics and repeat the study.

Newton’s third law of motion says, for every action, there is an equal and opposite reaction. For an example of a rocket, the action is the hot gases shooting out of the engine, and the reaction is the rocket being propelled forward. Specifically, a rocket is propelled by burning fuel inside its engines. When the fuel burns, such as by mixing liquid hydrogen with oxygen, it releases hot gases that shoot out of the back of the rocket, pushing it forward. The burning of the fuel generates a lot of heat and pressure, which forces the hot gases out of the rocket engine’s nozzle at high speeds. a rocket propelled by hot gases, according to Newton’s third law of motion

Newton’s second law of motion says, for this toy rocket of 2,000,000 kg, suppose the net force (hot gases pushing it upward – gravity pulling it downward) is 2,000,000 N, the acceleration is:

$$a = \frac{F}{m} = \frac{2,000,000 \text{ N}}{2,000,000 \text{ kg}} = 1 {\text{ m/s}}^{2}$$

The acceleration is a constant function that is always equal to 1 m/s². We can plot the (constant) function.

// plot the acceleration curve over time
val t = (0..20)

%use plotly
Plotly.plot {
scatter {
x.set(t)
// acceleration = 1 m/s^2 at any time
y.set(t.map { 1.0 }) // a constant acceleration of 1 m/s^2
}

layout{
title = "acceleration curve over time"
xaxis {
title = "time"
}
yaxis {
title = "acceleration"
}
}
}


With acceleration = 1 m/s², the rocket increases its speed by 1 m/s every second. We can be more precise using mathematics. The speed at time $$t$$ is equal to:

$$v(t) = 1 {\text{ m/s}}^{2} \times 1 \text{ s} + … + 1 {\text{ m/s}}^{2} \times 1 \text{ s} = t \text{ m/s}$$

We can rewrite this using the summation symbol to make it look more professional.

$$v(t) = \sum_{1}^{t} 1 = t \text{ m/s}$$

This expression says we add 1 for t times.

Alternatively, we can even be more sophisticated using the integral sign.

$$v(t) = \int_{0}^{t} 1dt = t \text{ m/s}$$

This expression says that for each small time interval $$dt$$, we add a small speed increment $$dt \text{ m/s}$$. We do this from time 0 to time t. They add up to exactly $$t$$.

We are adding 1 m/s every second to the speed. So, at time $$t$$, the speed is $$t \text{ m/s}$$. We can plot the graph to visualize it to make things obvious. It is a linearly increasing function, as we have seen it a few times already.

// the speed for a constant acceleration
fun vt(a: Double, t : Double): Double { // a = acceleration, t = time
return a * t;
}

// the speed for a constant acceleration 1 m/s^2
fun vt1(t : Double): Double { // t = time
return t;
}

// plot the speed curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { vt1(it.toDouble()) })
}

layout{
title = "speed curve over time"
xaxis {
title = "time"
}
yaxis {
title = "speed"
}
}
}


Algebraically, the speed function is:

$$v(t) = t$$

With the speed function that we just computed, we can calculate the distance travelled up to any time t. The idea is the same. We compute the small distance travelled during any small time interval $$dt$$. Then we add up all these small distances to compute the total distance.

The small distance travelled by the rocket at speed $$v(t)$$ for a small time interval $$dt$$ is:

$$\Delta d = v(t) \times dt = t \times dt = vdt$$

Then we sum up the small distances $$\Delta d$$ using the integral sign. The total distance is:

$$D = \sum {\Delta d} = \int_{0}^{t} vdt$$

To compute this integral D, we need to choose how we divide the timeline t into the many dt’s. For example $$t = 20$$, we can choose time points at $$t = 1$$, $$t = 2$$, $$t = 3$$, and so on. In this case, $$dt = 1$$. We also know the speed at all time points from the speed function we computed above. For example, when $$t = 1$$, the speed is $$v(1) = 1$$, the distance travelled by 1 unit of time is $$\Delta d = v(1) \times \Delta t = 1 \times 1 = 1 \text{ m/s}$$.

The distance travelled by 1 s is approximated by the yellow rectangle box. As we see that the box area is bigger than what is under the curve (the little triangle), we know that this approximation over estimates the distance. We will use smaller rectangles later to better fit the area under the speed curve.

The approximation is:

$$D = \int_{0}^{t} vdt = \sum_{1}^{t} i \times 1 \simeq \sum_{1}^{t} i = \frac{(1 + t) * t}{2}$$

$$D = 210 \text{ m}$$ for $$t = 20$$

// compute the distance by summing up rectangles
fun distance1a(t : Int): Double { // t = time
var total_distance = 0.0;

val dt = 1.0;
for (i in 0..t) {
val v = vt1(i.toDouble());
val dd = v * dt;
total_distance = total_distance + dd;
}

}

// plot the distance curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { distance1a(it) })
}

layout{
title = "distance curve over time"
xaxis {
title = "time"
}
yaxis {
title = "distance"
}
}
}


We can do a better approximation by choosing a higher resolution set of points, $$t = 0.5$$, $$t = 1.0$$, $$t = 1.5$$, $$t = 2.0$$, and so on. In this case, $$dt = \frac{1}{2}$$.

The approximation is:

$$D = \int_{0}^{t} vdt = \sum_{1}^{2t} \frac{i}{2} \times \frac{1}{2} \simeq \sum_{1}^{2t} i = \frac{1}{2} \times \frac{(1 + 2t) * 2t}{2} \times \frac{1}{2} = 205$$

$$D = 205 \text{ m}$$ for $$t = 20$$

// compute the distance by summing up smaller rectangles
fun distance1b(t : Int, w : Double): Double { // t = time, // w = the width of the interval
var total_distance = 0.0;

val dt = 1.0 / w;
for (i in 0..t) {
val v = vt1(i.toDouble() / w);
val dd = v * dt;
total_distance = total_distance + dd;
}

}

// plot the distance curve over time
val t = (0..40) // we double the number of time points because we are using 0.5 width intervals

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { distance1b(it, 2.0) })
}

layout{
title = "distance curve over time"
xaxis {
title = "time"
}
yaxis {
title = "distance"
}
}
}


We can repeat the same exercise using $$dt = \frac{1}{4}$$, $$dt = \frac{1}{8}$$ and so on. The small time interval that we use, the more accurate the result. We will notice that the answers are getting closer and closer to 200 m/s, which is the true answer when we take the limit that $$dt$$ goes to 0.

The distance travelled by our toy rocket has the following curve, using the width = 0.001.

// plot the distance curve over time
val t = (0..20000)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { distance1b(it, 1000.0) })
}

layout{
title = "distance curve over time"
xaxis {
title = "time"
}
yaxis {
title = "distance"
}
}
}


We can compute the distance using this curve at time = 20 s.

var D = distance1b(20000, 1000.0)
D

200.00999999999996

Using our integral notation, we have the exact formula to compute the distance at time 20 s.

$$D = \int_{0}^{20} vdt = \int_{0}^{20} tdt = 200$$

We know that the answer will converge to 200 m when we use smaller and smaller width.

## Linear Acceleration

The above example assumes that the acceleration is constant at $$a(t) = 1{\text{ m/s}}^{2}$$. That corresponds to applying a constant force to the rocket by burning fuel at a constant rate. We now consider a more advanced example. We assume that the force is gradually increasing (by buring more and more fuel) such that the acceleration is linearly increasing with time. Specifically,

$$a(t) = t{\text{ m/s}}^{2}$$

To compute the distance traveled by the rocket, we use the same strategy as in the above. From acceleration, we compute the speed. Acceleration is how much the speed change per time unit, i.e., the rate of speed change. We know that speed is the summation of small speed increments at time steps. Each speed increment is the product of acceleration (rate) and time width. From speed, we compute the distance. Speed is how much the distance change per time unit, i.e., the rate of distance change. We know that distance is the summation of distance increments at time steps. Each distance increment is the product of speed (rate) and time width. Threfore, the process to compute speed from acceleration and the process to compute distance from speed is exactly the same. They are both summing up increments computed from the product of the rate and the time width. In general, we can write the sum or the integral as a sum of small increments $$\Delta v$$:

$$I = \sum {\Delta v} = \int vdt$$, and

$$\Delta v = vdt$$

Let’s put the theory into practice and coding. First, we define the acceleration function. The acceleration increases linearly with time.

// the acceleration is linearly increasing with time
fun a(t : Double): Double { // t = time
return t;
}


We can plot the acceleration curve as follows.

// plot the acceleration curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { a(it.toDouble()) })
}

layout{
title = "acceleration curve over time"
xaxis {
title = "time"
}
yaxis {
title = "acceleration"
}
}
}


We now apply the summation method to compute the speed at any time $$t$$. Each small speed increment is:

$$dv = a \times dt$$

The sum over all these small speed increments $$dv$$ are the total speed.

$$v(t) = \sum dv = \sum a \times dt = a \sum dt = at$$

Note that the sum of all the small time increments $$dt$$ is simply $$t$$.

The code is as follows.

// compute the speed by summing up rectangles
fun vt2(t : Double, w : Double): Double { // t = time, // w = inverse of the width of the time interval
var total_speed = 0.0;

val dt = 1.0 / w;
var i = 0.0; // starting time
while (i < t + 1e-8) {
val a = a(i);
val dv = a * dt; // the small speed increment
total_speed = total_speed + dv; // summing up the speed increments

i += dt;
}

}


We can test out a few speeds at various time points.

vt2(10.0, 10.0)

50.49999999999995
vt2(10.0, 10000.0)

50.00049999998577

The second parameter, w, or argument is how much we divide one unit time. The bigger the division is, the finer the grid is, the more accurate the result is. This w is exactly the inverse of the previous w which is the interval width. (Sorry, we use the same symbol but they have exactly the opposite meaning.) In the above example, the speed at time 10 s equals 50 m/s.

We can plot the speed curve to visual the speeds at different times.

// plot the speed curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { vt2(it.toDouble(), 1.0) })
}

layout{
title = "speed curve over time"
xaxis {
title = "time"
}
yaxis {
title = "speed"
}
}
}


We use w = 1.0. The speed curve is as follows.

The curve indicates that the speed at time 10 s equals 55 m/s, which is near the correct answer but not quite. We can improve the accuracy by using a finer grid (smaller rectangles).

// plot the speed curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { vt2(it.toDouble(), 100.0) })
}

layout{
title = "speed curve over time"
xaxis {
title = "time"
}
yaxis {
title = "speed"
}
}
}


The plot is:

The accuracy of computing the speed improves.

With the speed curve, we can use the same summation strategy to compute the distance. The code to compute distance is very similar to the code to compute speed. You should compare these two pieces of code and understand why they are similar and different.

// compute the distance by summing up smaller rectangles
fun distance2(t : Double, w : Double): Double { // t = time
var total_distance = 0.0;

val dt = 1.0 / w;
var i = 0.0;
while (i < t + 1e-8) {
val v = vt2(i, w);
val dd = v * dt; // the small distance increment
total_distance = total_distance + dd; // summing up the distance increments

i += dt;
}

}


To plot the distance curve, we use this code.

// plot the distance curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { distance2(it.toDouble(), 1.0) })
}

layout{
title = "distance curve over time"
xaxis {
title = "time"
}
yaxis {
title = "distance"
}
}
}


This distance curve, with w = 1.0, says that at time = 20 s, the rocket will have travelled 1540 m. The accuracy can be improved. Let’s try w = 100.0.

// plot the distance curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { distance2(it.toDouble(), 100.0) })
}

layout{
title = "distance curve over time"
xaxis {
title = "time"
}
yaxis {
title = "distance"
}
}
}


The distance at time = 20 s is now 1335.334, which is much closer to the real answer (which is 1333.33).

In the above, we first code up the speed function from the acceleration function then we code up the distance function using the speed function. We can combine the two functions into one so we can compute the distance function from the acceleration function.

// compute the distance by summing up smaller rectangles
// merge with the speed code/loop
fun distance3(t : Double, w : Double): Double { // t = time
var total_distance = 0.0;

val dt = 1.0 / w;
var i = 0.0;
while (i < t + 1e-8) {
// compute the speed at time i
// code copied from vt2
var total_speed = 0.0;

val dt = 1.0 / w;
var j = 0.0; // starting time
while (j < i + 1e-8) { // i is the current time in the outer loop
val a = a(j);
val dv = a * dt;
total_speed = total_speed + dv;

j += dt;
}
val v = total_speed;
//        val v = vt2(i, w); // same as total_speed

val dd = v * dt;
total_distance = total_distance + dd;

i += dt;
}

}


There are two (while) loops in this function. The inner loop is to compute the speed at time $$t$$. The outer loop uses the speed computed in the inner loop to compue the distance at time $$t$$. Both loops do exactly the same thing: the sum up the small increments up to time $$t$$.

We can apply this distance function to plot the distance curve.

// plot the distance curve over time
val t = (0..20)

Plotly.plot {
scatter {
x.set(t)
y.set(t.map { distance3(it.toDouble(), 1000.0) })
}

layout{
title = "distance curve over time"
xaxis {
title = "time"
}
yaxis {
title = "distance"
}
}
}


If we compare the distance curve with linearly increasing acceleration to the the distance curve with constant acceleration, we see that the the rocket travels so much faster and so much further distance with increasing acceleration!

## Double Integration

It may be easier to understand the double loops in the code by looking at the mathematics. First, the distance is a summation of the product of speed and time increments $$\Delta t$$.

$$D = \sum v(t) \Delta t$$

The speed is a summation of the product of acceleration and time increments $$\Delta \tau$$. We use different time symbols $$t$$ and $$\tau$$ to represent different times in the two different loops.

$$v(t)= \sum a(\tau) \Delta \tau$$

We can replace the $$v(t)$$ in the distance equation by the speed equation in terms of acceleration. That is,

$$D = \sum \sum a(\tau) \Delta \tau \Delta t$$

This explains why we have the outer loop (for summing up for distance) and the inner loop (for summing up for speed) in the code.

Now if we make $$\Delta \tau$$ and $$\Delta t$$ go to infinitesimally small, then we can replace the summation symbols by the integral symbols. We have:

$$D = \int \int a(\tau) d\tau dt$$

This is a two-dimensional or double integral. Simply put, a double integral is a sum of sums.

In other words, distance is a single integral of speed or equivalently a double integral of acceleration.