Skip to content

Commit

Permalink
Merge pull request #561 from nature-of-code/notion-update-docs
Browse files Browse the repository at this point in the history
[Notion] Update docs
  • Loading branch information
shiffman authored Nov 11, 2023
2 parents fadb980 + 5c37a50 commit 9299f66
Show file tree
Hide file tree
Showing 28 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion content/02_forces.html
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ <h2 id="the-n-body-problem">The n-Body Problem</h2>
<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>
<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>
</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>
Expand Down
15 changes: 4 additions & 11 deletions content/03_oscillation.html
Original file line number Diff line number Diff line change
Expand Up @@ -899,14 +899,7 @@ <h2 id="the-pendulum">The Pendulum</h2>
<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>
<figure>
<div class="col-list">
<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>
<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}.">
<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>
<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>
Expand All @@ -917,7 +910,7 @@ <h2 id="the-pendulum">The Pendulum</h2>
<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>
<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>
</figure>
<p>There it is. The net force of the pendulum that causes the rotation is calculated as follows:</p>
Expand Down Expand Up @@ -971,7 +964,7 @@ <h2 id="the-pendulum">The Pendulum</h2>
<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">
<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>
</figure>
</div>
Expand Down Expand Up @@ -1066,7 +1059,7 @@ <h3 id="exercise-315">Exercise 3.15</h3>
<h3 id="exercise-316">Exercise 3.16</h3>
<div class="half-width-right">
<figure>
<img src="images/03_oscillation/03_oscillation_21.png" alt="">
<img src="images/03_oscillation/03_oscillation_20.png" alt="">
<figcaption></figcaption>
</figure>
</div>
Expand Down
Binary file modified content/images/02_forces/02_forces_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed content/images/02_forces/02_forces_11.jpg
Binary file not shown.
Binary file added content/images/02_forces/02_forces_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/02_forces/02_forces_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed content/images/03_oscillation/03_oscillation_21.png
Binary file not shown.
Binary file modified content/images/03_oscillation/03_oscillation_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/03_oscillation/03_oscillation_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/06_libraries/06_libraries_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/07_ca/07_ca_13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/08_fractals/08_fractals_24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/08_fractals/08_fractals_25.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/08_fractals/08_fractals_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/08_fractals/08_fractals_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/08_fractals/08_fractals_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/10_nn/10_nn_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/10_nn/10_nn_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content/images/10_nn/10_nn_8.png

0 comments on commit 9299f66

Please sign in to comment.