Merge pull request #561 from nature-of-code/notion-update-docs
[Notion] Update docs
|
@ -934,7 +934,7 @@ function draw() {
|
||||||
<p>To begin, while it’s so far been helpful to have separate <code>Mover</code> and <code>Attractor</code> classes, this distinction is actually a bit misleading. After all, according to Newton’s third law, all forces occur in pairs: if an attractor attracts a mover, then that mover should also attract the attractor. Instead of two different classes here, what I really want is a single type of thing—called, for example, a <code>Body</code>—with every body attracting every other body.</p>
|
<p>To begin, while it’s so far been helpful to have separate <code>Mover</code> and <code>Attractor</code> classes, this distinction is actually a bit misleading. After all, according to Newton’s third law, all forces occur in pairs: if an attractor attracts a mover, then that mover should also attract the attractor. Instead of two different classes here, what I really want is a single type of thing—called, for example, a <code>Body</code>—with every body attracting every other body.</p>
|
||||||
<p>The scenario being described here is commonly referred to as the <span data-type="equation">n</span><strong>-body problem</strong>. It involves solving for the motion of a group of objects that interact via gravitational forces. The <em>two</em>-body problem is a famously “solved” problem, meaning the motions can be precisely computed with mathematical equations when only two bodies are involved. However, adding one more body turns the <em>two</em>-body problem into a <em>three</em>-body problem, and suddenly no formal solution exists (see Figure 2.10).</p>
|
<p>The scenario being described here is commonly referred to as the <span data-type="equation">n</span><strong>-body problem</strong>. It involves solving for the motion of a group of objects that interact via gravitational forces. The <em>two</em>-body problem is a famously “solved” problem, meaning the motions can be precisely computed with mathematical equations when only two bodies are involved. However, adding one more body turns the <em>two</em>-body problem into a <em>three</em>-body problem, and suddenly no formal solution exists (see Figure 2.10).</p>
|
||||||
<figure>
|
<figure>
|
||||||
<img src="images/02_forces/02_forces_11.jpg" alt="Figure 2.10 Example paths of the two-body (predictable) vs. three-body (complex) problems">
|
<img src="images/02_forces/02_forces_11.png" alt="Figure 2.10 Example paths of the two-body (predictable) vs. three-body (complex) problems">
|
||||||
<figcaption>Figure 2.10 Example paths of the two-body (predictable) vs. three-body (complex) problems</figcaption>
|
<figcaption>Figure 2.10 Example paths of the two-body (predictable) vs. three-body (complex) problems</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
<p>Although less accurate than using precise equations of motion, the examples built in this chapter can model both the two-body and three-body problems. To begin, I’ll move the <code>attract()</code> method from the <code>Attractor</code> class into the <code>Mover</code> class (which I will now call <code>Body</code>).</p>
|
<p>Although less accurate than using precise equations of motion, the examples built in this chapter can model both the two-body and three-body problems. To begin, I’ll move the <code>attract()</code> method from the <code>Attractor</code> class into the <code>Mover</code> class (which I will now call <code>Body</code>).</p>
|
||||||
|
|
|
@ -899,14 +899,7 @@ function draw() {
|
||||||
<p>Instead of using <em>linear</em> acceleration and velocity, I’m going to describe the motion of the pendulum in terms of <em>angular</em> acceleration and <em>angular </em>velocity, which refer to the change of the arm’s angle <span data-type="equation">\theta</span> relative to the pendulum’s resting position. I should first warn you, especially if you’re a seasoned physicist, that I’m going to conveniently ignore several important concepts here: conservation of energy, momentum, centripetal force, and more. This isn’t intended to be a comprehensive description of pendulum physics. My goal is to offer you an opportunity to practice your new skills in trigonometry and further explore the relationship between forces and angles through a concrete example.</p>
|
<p>Instead of using <em>linear</em> acceleration and velocity, I’m going to describe the motion of the pendulum in terms of <em>angular</em> acceleration and <em>angular </em>velocity, which refer to the change of the arm’s angle <span data-type="equation">\theta</span> relative to the pendulum’s resting position. I should first warn you, especially if you’re a seasoned physicist, that I’m going to conveniently ignore several important concepts here: conservation of energy, momentum, centripetal force, and more. This isn’t intended to be a comprehensive description of pendulum physics. My goal is to offer you an opportunity to practice your new skills in trigonometry and further explore the relationship between forces and angles through a concrete example.</p>
|
||||||
<p>To actually calculate the pendulum’s angular acceleration, I’m going to use Newton’s second law of motion, but with a little trigonometric twist. Take a look back at Figure 3.16 and tilt your head so that the pendulum’s arm becomes the vertical axis. The force of gravity suddenly points askew, a little to the left—it’s at an angle with respect to your tilted head. If this is starting to hurt your neck, don’t worry. I’ll redraw the tilted figure and relabel the forces <span data-type="equation">F_g</span> for gravity and <span data-type="equation">T</span> for tension (FIgure 3.17, left).</p>
|
<p>To actually calculate the pendulum’s angular acceleration, I’m going to use Newton’s second law of motion, but with a little trigonometric twist. Take a look back at Figure 3.16 and tilt your head so that the pendulum’s arm becomes the vertical axis. The force of gravity suddenly points askew, a little to the left—it’s at an angle with respect to your tilted head. If this is starting to hurt your neck, don’t worry. I’ll redraw the tilted figure and relabel the forces <span data-type="equation">F_g</span> for gravity and <span data-type="equation">T</span> for tension (FIgure 3.17, left).</p>
|
||||||
<figure>
|
<figure>
|
||||||
<div class="col-list">
|
<img src="images/03_oscillation/03_oscillation_17.png" alt="Figure 3.17: On the left, the pendulum is drawn rotated so that the arm is the y-axis. The right shows F_g zoomed in and divided into components F_{gx} and F_{gy}.">
|
||||||
<div>
|
|
||||||
<img src="images/03_oscillation/03_oscillation_17.png" alt="Figure 3.17: On the left, the pendulum is drawn rotated so that the arm is the y-axis. The right shows F_g zoomed in and divided into components F_{gx} and F_{gy}.">
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<img src="images/03_oscillation/03_oscillation_18.png" alt="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<figcaption>Figure 3.17: On the left, the pendulum is drawn rotated so that the arm is the y-axis. The right shows <span data-type="equation">F_g</span> zoomed in and divided into components <span data-type="equation">F_{gx}</span> and <span data-type="equation">F_{gy}</span>.</figcaption>
|
<figcaption>Figure 3.17: On the left, the pendulum is drawn rotated so that the arm is the y-axis. The right shows <span data-type="equation">F_g</span> zoomed in and divided into components <span data-type="equation">F_{gx}</span> and <span data-type="equation">F_{gy}</span>.</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
<p>Let’s now take the force of gravity and divide its vector into <span data-type="equation">x</span> and <span data-type="equation">y</span> components, with the arm as the new y-axis<em>.</em> These comonents form a right triangle, with the force of gravity as the hypotenuse (Figure 3.16, right). I’ll call them <span data-type="equation">F_{gx}</span> and <span data-type="equation">F_{gy}</span>, but what do these components mean? Well, the <span data-type="equation">F_{gy}</span> component represents the force that’s opposite to <span data-type="equation">T</span>, the tension force. Remember, the tension force is what keeps the bob from falling off.</p>
|
<p>Let’s now take the force of gravity and divide its vector into <span data-type="equation">x</span> and <span data-type="equation">y</span> components, with the arm as the new y-axis<em>.</em> These comonents form a right triangle, with the force of gravity as the hypotenuse (Figure 3.16, right). I’ll call them <span data-type="equation">F_{gx}</span> and <span data-type="equation">F_{gy}</span>, but what do these components mean? Well, the <span data-type="equation">F_{gy}</span> component represents the force that’s opposite to <span data-type="equation">T</span>, the tension force. Remember, the tension force is what keeps the bob from falling off.</p>
|
||||||
|
@ -917,7 +910,7 @@ function draw() {
|
||||||
<div data-type="equation">F_{gx} = F_g \times \sin(\theta)</div>
|
<div data-type="equation">F_{gx} = F_g \times \sin(\theta)</div>
|
||||||
<p>I’ll now rename this force <span data-type="equation">F_p</span> for “force of the pendulum.” In Figure 3.18, I’ve restored the diagram to its original orientation and relabeled the components. I’ve also moved the starting point of <span data-type="equation">F_p</span> from the bottom of the right triangle to the bob’s center, to clarify how this force moves the bob.</p>
|
<p>I’ll now rename this force <span data-type="equation">F_p</span> for “force of the pendulum.” In Figure 3.18, I’ve restored the diagram to its original orientation and relabeled the components. I’ve also moved the starting point of <span data-type="equation">F_p</span> from the bottom of the right triangle to the bob’s center, to clarify how this force moves the bob.</p>
|
||||||
<figure>
|
<figure>
|
||||||
<img src="images/03_oscillation/03_oscillation_19.png" alt="Figure 3.18: F_{gx} is now labeled F_p, the net force in the direction of motion.">
|
<img src="images/03_oscillation/03_oscillation_18.png" alt="Figure 3.18: F_{gx} is now labeled F_p, the net force in the direction of motion.">
|
||||||
<figcaption>Figure 3.18: <span data-type="equation">F_{gx}</span> is now labeled <span data-type="equation">F_p</span>, the net force in the direction of motion.</figcaption>
|
<figcaption>Figure 3.18: <span data-type="equation">F_{gx}</span> is now labeled <span data-type="equation">F_p</span>, the net force in the direction of motion.</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
<p>There it is. The net force of the pendulum that causes the rotation is calculated as follows:</p>
|
<p>There it is. The net force of the pendulum that causes the rotation is calculated as follows:</p>
|
||||||
|
@ -971,7 +964,7 @@ function draw() {
|
||||||
<p>Note that the acceleration calculation now includes a multiplication by –1. When the pendulum is to the right of its resting position, the angle is positive, and so the sine of the angle is also positive. However, gravity should “pull” the bob back toward the resting position. Conversely, when the pendulum is to the left of its resting position, the angle is negative, and so its sine is negative, too. In this case, the pulling force should be positive. Multiplying by –1 is necessary in both scenarios.</p>
|
<p>Note that the acceleration calculation now includes a multiplication by –1. When the pendulum is to the right of its resting position, the angle is positive, and so the sine of the angle is also positive. However, gravity should “pull” the bob back toward the resting position. Conversely, when the pendulum is to the left of its resting position, the angle is negative, and so its sine is negative, too. In this case, the pulling force should be positive. Multiplying by –1 is necessary in both scenarios.</p>
|
||||||
<div class="half-width-right">
|
<div class="half-width-right">
|
||||||
<figure>
|
<figure>
|
||||||
<img src="images/03_oscillation/03_oscillation_20.png" alt="Figure 3.19: A diagram showing the bob position relative to the pivot in polar and Cartesian coordinates">
|
<img src="images/03_oscillation/03_oscillation_19.png" alt="Figure 3.19: A diagram showing the bob position relative to the pivot in polar and Cartesian coordinates">
|
||||||
<figcaption>Figure 3.19: A diagram showing the bob position relative to the pivot in polar and Cartesian coordinates</figcaption>
|
<figcaption>Figure 3.19: A diagram showing the bob position relative to the pivot in polar and Cartesian coordinates</figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1066,7 +1059,7 @@ function draw() {
|
||||||
<h3 id="exercise-316">Exercise 3.16</h3>
|
<h3 id="exercise-316">Exercise 3.16</h3>
|
||||||
<div class="half-width-right">
|
<div class="half-width-right">
|
||||||
<figure>
|
<figure>
|
||||||
<img src="images/03_oscillation/03_oscillation_21.png" alt="">
|
<img src="images/03_oscillation/03_oscillation_20.png" alt="">
|
||||||
<figcaption></figcaption>
|
<figcaption></figcaption>
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
|
|
Before Width: | Height: | Size: 173 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 1.1 MiB |
BIN
content/images/02_forces/02_forces_11.png
Normal file
After Width: | Height: | Size: 195 KiB |
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 192 KiB |
Before Width: | Height: | Size: 159 KiB After Width: | Height: | Size: 121 KiB |
Before Width: | Height: | Size: 156 KiB After Width: | Height: | Size: 151 KiB |
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 238 KiB |
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 251 KiB |
Before Width: | Height: | Size: 167 KiB After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 591 KiB After Width: | Height: | Size: 917 KiB |
Before Width: | Height: | Size: 3 MiB After Width: | Height: | Size: 334 KiB |
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 146 KiB |
Before Width: | Height: | Size: 146 KiB After Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 96 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 105 KiB |
Before Width: | Height: | Size: 336 KiB After Width: | Height: | Size: 328 KiB |
Before Width: | Height: | Size: 116 KiB After Width: | Height: | Size: 118 KiB |
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 77 KiB |
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 155 KiB |
Before Width: | Height: | Size: 610 KiB After Width: | Height: | Size: 590 KiB |
Before Width: | Height: | Size: 235 KiB After Width: | Height: | Size: 204 KiB |
Before Width: | Height: | Size: 375 KiB After Width: | Height: | Size: 380 KiB |
Before Width: | Height: | Size: 471 KiB After Width: | Height: | Size: 469 KiB |