---
jupytext:
  formats: ipynb,md:myst
  text_representation:
    extension: .md
    format_name: myst
    format_version: 0.13
    jupytext_version: 1.16.4
kernelspec:
  display_name: Python 3 (phys-581)
  language: python
  name: python3
---

```{code-cell}
:tags: [hide-cell]

import mmf_setup;mmf_setup.nbinit()
import logging;logging.getLogger('matplotlib').setLevel(logging.CRITICAL)
%matplotlib inline
import numpy as np, matplotlib.pyplot as plt
```

(sec:LectureNotes)=
# Lecture Notes - Fall 2024

These are lecture notes about what we did in class in the Fall 2024 offering of the
course.

## Mon 2 Dec 2024
* Lumping:
  * Bending of light (example from sailboat).
  * Dissipation of energy by viscosity.
  * Mountain on Mars.
  * Neutron star.
* Probabilistic reasoning:
  * How long until an odor molecule reaches you?
  * Thermal conductivity of mercury (why is it so low?) $\qty{8.3}{W/m/K}$ vs copper
    $\qty{380}{W/m/K}$.
* Easy cases:
  * Regimes and limiting cases:
    * Dimensional analysis.
  * Rolling down a plane (8.3.1.1)
* Spring models:
  * Musical notes from beams and strings.
  * Gravitational radiation.
  * Blue skies.  (How safe is it to look at the sun?)

## Mon 4 Nov 2024
* Dimensions:
  * Kepler.  Sun, Moon, Earth, etc.
* Thermal Equilibrium: Gibbs - see {cite}`Schrodinger:1952`.

```{code-cell}
data = np.array([
   [4.6001e10, 6.9818e10, -1.1462e9],
   [1.0748e11, 1.0894e11, -6.1339e8],
   [1.4710e11, 1.5210e11, -4.4369e8],
   [2.0666e11, 2.4923e11, -2.9119e8],
   [7.4067e11, 8.1601e11, -8.5277e7],
   [1.3498e12, 1.5036e12, -4.6523e7],
   [2.7350e12, 3.0063e12, -2.3122e7],
   [4.4598e12, 4.5370e12, -1.4755e7]])
   
r_min, r_max, V = data.T

fig, ax = plt.subplots()
ax.plot(abs(V), r_min, 'o', label='$r_{\min}$')
ax.loglog(abs(V), r_max, 'x', label='$r_{\max}$')
ax.legend()
```


## Wed 30 Oct 2024
* Dimensions:
  * Find meaningful comparisons:
    * Energy consumption?
      * Solar power at Earth's surface: 10^{17}W
* Problems:
  :::{margin}
  Hints:
  \begin{gather*}
    R_{\text{earth}} \approx 6000\text{km}\\
    \braket{T} \approx 15\text{°C}\\
    k_B \approx 86 \mathrm{\mu eV/K},\\
    \sigma \approx 5.7\times 10^{-8}\mathrm{W/(m^2K^4)}.
  \end{gather*}
  where $\sigma$ is the Stefan-Boltzmann constant.
  :::
  * Estimate the solar power (in watts) falling on the earth's surface. (ANS. $2\times 10^{17}$W.)
* Thermal Equilibrium: Gibbs - see {cite}`Schrodinger:1952`.
* Radiation pressure $p = u/3$.

## Mon 28 Oct 2024
* Discussed projects.
  * What If?
  * Language.



## Wed 18 Sep 2024
* Invariants:
  * Example algorithm for fib(n):

## Wed 11 Sep 2024
* LRC circuits.  Driven oscillator.
* Problem: Can a 9V battery launch itself into space?
* Induction demo.

## Mon 9 Sep 2024
* Energy in bonds.
* Oscillators.

## Wed 28 Aug 2024
* Example: Area of an ellipse in terms of the radii.
* Random variables.
  * How to add (how do errors add in physics lab?):
    \begin{gather*}
      z = x + y, \qquad
      \delta z = \sqrt{(\delta x)^2 + (\delta y)^2}.
    \end{gather*}
    Leads to law of large numbers:
  * Birthday problem: $p\approx 0.315$.  How many trials do we need to estimate this
    with a 95%CI for an error of $\pm 0.05$?
    * Recall that for a binomial distribution with probability $p$ we have $\sigma =
      \sqrt{p(1-p)}$ while the error of the mean should be $\sigma_{\bar{x}} \approx
      \sigma / \sqrt{N_t}$.  For a 95%CI, we should have $2\sigma_{\bar{x}} = 0.05$
      giving $N_t \approx 4\sigma^2/0.05^2 \approx 350$.
  * Background: Need Fourier transform.  Think of basis functions as plane waves:
  
    \begin{gather*}
     \DeclareMathOperator{FT}{\mathcal{F}}
      f(x) = \int_{-\infty}^{\infty} \frac{\d{k}}{2\pi}\; f_k e^{\I k x} = \FT^{-1}[f_k]\\
      f_k = \FT[f] = \int_{-\infty}^{\infty}\d{x}\; e^{-\I k x} f(x),\\
    \end{gather*}

    Convolution Theorem:
    \begin{gather*}
      \FT[f*g] = \FT\left[\int f(y-x)g(x)\d{x}\right] = \FT[f]\; \FT[g]
    \end{gather*}

    \begin{gather*}
      \braket{x|k} = e^{\I k x}\\
      \mat{1} = \int_{-\infty}^{\infty}\d{x} \ket{x}\bra{x} 
              = \int_{-\infty}^{\infty}\frac{\d{k}}{2\pi} \ket{k}\bra{k},\\
      \braket{p|k} = \braket{p|\mat{1}|k} 
                   = \int_{-\infty}^{\infty} \d{x}\braket{p|x}\braket{x|k}
                   = \int_{-\infty}^{\infty} \d{x}e^{-\I p x}e^{\I k x}
                   = \int_{-\infty}^{\infty} \d{x}e^{\I p x(k-p)}
                   = (2\pi)\delta(k-p).
    \end{gather*}
  
    \begin{gather*}
      \delta(x) = \int_{-\infty}^{\infty} e^{\I k x}\frac{\d{k}}{2\pi}, \qquad
      2\pi\delta(k) = \int_{-\infty}^{\infty} e^{\I k x}\d{x}.
    \end{gather*}






    
  

## Mon 26 Aug 2024
* Discussed probability, PDFs etc.  See {ref}`sec:Probability`.
* Discussed {ref}`sec:DeltaFunction`, especially how to use $\delta\bigl(g(x)-g_0\bigr)$.
* Mentioned combining PDFs.

## Wed 21 Aug 2024

* Fun problem: 
  \begin{gather*}
    a+b+c = 0\\
    a^2+b^2+c^2 = \sqrt{74}\\
    a^4 + b^4 + c^4 = ?
  \end{gather*}
* **Question**: 
  1. What is the probability of two people in the room sharing a birthday?
     *(There were $N=17$ in the class, and none shared a birthday)*
  2. If we did an experiment where everyone randomly chose a birthday and we repeated
     again, how many times would we have to run this to get a good estimate of the
     probability?
     :::{margin}
     *(Aside: to test if there are any matches seems to be an $O(N^2)$ problem since we
     need to check all pairs.  We can do it in class by just asking everyone to state
     their birthday once, which is $O(N)$.  Why?  Can we do better?  Why or why not?)*
     :::
  3. Insight: The probably of any one person having a birthday is $1/D = 1/365$, but we
     are really looking at all pairs of people.  There are $N \choose 2 = N(N-1)/2 \sim
     N^2$ such pairs, thus we might expect $p \sim N^2/2/D \sim (17)^2/2/365 \sim
     0.4$.  *(The correct probability is $p=0.315$ in this case.)*
  

## Mon 19 Aug 2024

* Introductions: students introduced themselves, their backgrounds, expertise, and
  interests.
* Overview of iSciMath program and the motivation for the course.
* Problem: How long will one wait for parking in the lot outside of the Moscow farmers
  market? *(5min alone / 10min in groups)*
  * Interesting points: 
    * Vendors might take longer that customers.
    * There is a 3h maximum parking limit.
    * Can we model the vacancy as a distribution?  If so, the relevant question might be
      -- what is the distribution of the minimum of $N$ samples from a given
      distribution?  (Fun little problem.  Hint: it involves the cumulative distribution
      function $C(x) = \int_{-\infty}^{x}P(x)\d{x}$.
* Quick review and discussion of the textbook topics.
* Discussion of dimensional analysis.
* Application to a pendulum.
* **Question**: How high can an animal of height $l$ jump?  (I.e., how does the height $h$
  an animal can jump depend on the linear size of the $l$ animal?)
  * Dimensionally, we worked out that roughly, energy must be conserved, so the work
    done $Fl \approx mgh$ must be related to the potential energy gained:
    \begin{gather*}
      h \propto \frac{Fl}{mg}.
    \end{gather*}
    We estimated that the mass of an animal scales like the volume $m \propto l^3$ but
    left as an exercise how the force $F$ scales?

**Mathematics Portion**

Consider the geometry of the derivative.  The derivative gives a linear approximation
that can be bounded arbitrarily well by a cone of decreasing angle.
  

:::{admonition} To Do
1. Register on the [iSciMath Discourse: <discourse.iscimath.org>][Discourse].
2. Establish a "Lab Notebook" for the course where you record your thoughts, workings,
   questions, etc.  I would like to see this twice during the course (will be returned).
3. **Reading:** [Mahajan: I.1: “Divide and
   conquer”](https://direct.mit.edu/books/oa-monograph/chapter-pdf/2275129/c002500_9780262325233.pdf)
4. **Essay:** Describe something you have mastered.  What does mastery mean?  How did
   you achieve mastery?  What works for you?  What does not?  How long did it take?
   This need not be technical -- music, sports, cooking, hobbies, crafts, etc. are all
   great sources of material.  The goal is for you to identify what works for you, and
   then apply that to your technical training in this course and your program of study.
5. **Podcast:** [How to Become Great at Just About Anything -
   Freakonomics](https://freakonomics.com/podcast/how-to-become-great-at-just-about-anything/).
   Relevant discussion of the 10,000 rule, deliberate practice, etc.  How does your
   experience relate to what is discussed in this podcast?
:::


[Discourse]: <https://discourse.iscimath.org/t/physics-581-estimate-anything-fall-2024/1015>
