Merge branch 'main' into v0.16
This commit is contained in:
commit
e87ff0d15b
@ -6,7 +6,7 @@
|
||||
# which seems to make it all work. The line number 83 might change.
|
||||
|
||||
f = "_book/alternatives/plotly_plotting.html"
|
||||
lineno = 83
|
||||
lineno = 88
|
||||
|
||||
str = """
|
||||
|
||||
|
@ -734,7 +734,9 @@ For parametrically defined surfaces, the $x$ and $y$ values also correspond to m
|
||||
```{julia}
|
||||
#| hold: true
|
||||
r, R = 1, 5
|
||||
X(theta,phi) = [(r*cos(theta)+R)*cos(phi), (r*cos(theta)+R)*sin(phi), r*sin(theta)]
|
||||
X(theta,phi) = [(r*cos(theta)+R)*cos(phi),
|
||||
(r*cos(theta)+R)*sin(phi),
|
||||
r*sin(theta)]
|
||||
|
||||
us = range(0, 2pi, length=25)
|
||||
vs = range(0, pi, length=25)
|
||||
|
@ -230,7 +230,7 @@ plot!(x -> P₀ * exp(r * (x - x₀)), 1950, 1990, linewidth=5, alpha=0.25)
|
||||
plot!(x -> 𝑷₀ * exp(𝒓 * (x - 𝒙₀)), 1960, 2020, linewidth=5, alpha=0.25)
|
||||
```
|
||||
|
||||
(The `unzip` function is from the `CalculusWithJulia` package and will be explained in a subsequent section.) We can see that the projections from the year $1970$ hold up fairly well
|
||||
(The `unzip` function is from the `CalculusWithJulia` package and will be explained in a subsequent section.) We can see that the projections from the year $1970$ hold up fairly well.
|
||||
|
||||
|
||||
On this plot we added two *exponential* models. at $1960$ we added a *roughly* $0.2$ percent per year growth (a rate mentioned in an accompanying caption) and at $2000$ a roughly $0.5$ percent per year growth. The former barely keeping up with the data.
|
||||
@ -486,7 +486,7 @@ If $x$, $y$, and $z$ satisfy $2^x = 3^y$ and $4^y = 5^z$, what is the ratio $x/z
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
raw"``\frac{\log(2)\log(3)}{\log(5)\log(4)}``",
|
||||
raw"``\frac{\log(3)\log(5)}{\log(2)\log(4)}``",
|
||||
raw"``2/5``",
|
||||
raw"``\frac{\log(5)\log(4)}{\log(3)\log(2)}``"
|
||||
]
|
||||
@ -510,14 +510,14 @@ yesnoq(answ)
|
||||
###### Question
|
||||
|
||||
|
||||
The [Richter](https://en.wikipedia.org/wiki/Richter_magnitude_scale) magnitude is determined from the logarithm of the amplitude of waves recorded by seismographs (Wikipedia). The formula is $M=\log(A) - \log(A_0)$ where $A_0$ depends on the epicenter distance. Suppose an event has $A=100$ and $A_0=1/100$. What is $M$?
|
||||
The [Richter](https://en.wikipedia.org/wiki/Richter_magnitude_scale) magnitude is determined from the logarithm of the amplitude of waves recorded by seismographs (Wikipedia). The formula is $M=\log_{10}(A) - \log_{10}(A_0)$ where $A_0$ depends on the epicenter distance. Suppose an event has $A=100$ and $A_0=1/100$. What is $M$?
|
||||
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
A, A0 = 100, 1/100
|
||||
val = M = log(A) - log(A0)
|
||||
val = M = log10(A) - log10(A0)
|
||||
numericq(val)
|
||||
```
|
||||
|
||||
@ -596,8 +596,8 @@ What statement appears to be true?
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
choices = [
|
||||
raw"``\log(1-x) \geq -x - x^2/2``",
|
||||
raw"``\log(1-x) \leq -x - x^2/2``"
|
||||
raw"``\log(1-x) \geq -x - x^2/2, \text{ when }x \leq 0``",
|
||||
raw"``\log(1-x) \leq -x - x^2/2, \text{ when }x \leq 0``"
|
||||
]
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
|
@ -239,7 +239,7 @@ bottom = x-1
|
||||
quo, rem = divrem(top, bottom)
|
||||
```
|
||||
|
||||
The graph of has nothing in common with the graph of the quotient for small $x$
|
||||
The graph has nothing in common with the graph of the quotient for small $x$
|
||||
|
||||
|
||||
```{julia}
|
||||
@ -265,7 +265,7 @@ $$
|
||||
\frac{(x-2)^3\cdot(x-4)\cdot(x-3)}{(x-5)^4 \cdot (x-6)^2}.
|
||||
$$
|
||||
|
||||
By looking at the powers we can see that the leading term of the numerator will the $x^5$ and the leading term of the denominator $x^6$. The ratio is $1/x^1$. As such, we expect the $y$-axis as a horizontal asymptote:
|
||||
By looking at the powers we can see that the leading term of the numerator will the $x^5$ and the leading term of the denominator $x^6$. The ratio is $1/x^1$. As such, we expect the $x$-axis as a horizontal asymptote:
|
||||
|
||||
|
||||
#### Partial fractions
|
||||
@ -378,7 +378,7 @@ plot(𝒇, -5, 5, ylims=(-20, 20))
|
||||
This isn't ideal, as the large values are still computed, just the viewing window is clipped. This leaves the vertical asymptotes still effecting the graph.
|
||||
|
||||
|
||||
There is another way, we could ask `Julia` to not plot $y$ values that get too large. This is not a big request. If instead of the value of `f(x)` - when it is large - -we use `NaN` instead, then the connect-the-dots algorithm will skip those values.
|
||||
There is another way, we could ask `Julia` to not plot $y$ values that get too large. This is not a big request. If instead of the value of `f(x)` - when it is large - we use `NaN` instead, then the connect-the-dots algorithm will skip those values.
|
||||
|
||||
|
||||
This was discussed in an earlier section where the `rangeclamp` function was introduced to replace large values of `f(x)` (in absolute values) with `NaN`.
|
||||
@ -621,7 +621,7 @@ a, b = 4, 6
|
||||
pq = 𝐩 // one(𝐩)
|
||||
x = variable(pq)
|
||||
d = Polynomials.degree(𝐩)
|
||||
numerator(lowest_terms( (x + 1)^2 * pq((a*x + b)/(x + 1))))
|
||||
numerator(lowest_terms( (x + 1)^d * pq((a*x + b)/(x + 1))))
|
||||
```
|
||||
|
||||
---
|
||||
@ -630,7 +630,7 @@ numerator(lowest_terms( (x + 1)^2 * pq((a*x + b)/(x + 1))))
|
||||
Now, why is this of any interest?
|
||||
|
||||
|
||||
Mobius transforms are used to map regions into other regions. In this special case, the transform $\phi(x) = (ax + b)/(x + 1)$ takes the interval $[0,\infty]$ and sends it to $[a,b]$ ($0$ goes to $(a\cdot 0 + b)/(0+1) = b$, whereas $\infty$ goes to $ax/x \rightarrow a$). Using this, if $p(u) = 0$, with $q(x) = (x-1)^d p(\phi(x))$, then setting $u = \phi(x)$ we have $q(x) = (\phi^{-1}(u)+1)^d p(\phi(\phi^{-1}(u))) = (\phi^{-1}(u)+1)^d \cdot p(u) = (\phi^{-1}(u)+1)^d \cdot 0 = 0$. That is, a zero of $p$ in $[a,b]$ will appear as a zero of $q$ in $[0,\infty)$ at $\phi^{-1}(u)$.
|
||||
Mobius transforms are used to map regions into other regions. In this special case, the transform $\phi(x) = (ax + b)/(x + 1)$ takes the interval $[0,\infty]$ and sends it to $[a,b]$ ($0$ goes to $(a\cdot 0 + b)/(0+1) = b$, whereas $\infty$ goes to $ax/x \rightarrow a$). Using this, if $p(u) = 0$, with $q(x) = (x+1)^d p(\phi(x))$, then setting $u = \phi(x)$ we have $q(x) = (\phi^{-1}(u)+1)^d p(\phi(\phi^{-1}(u))) = (\phi^{-1}(u)+1)^d \cdot p(u) = (\phi^{-1}(u)+1)^d \cdot 0 = 0$. That is, a zero of $p$ in $[a,b]$ will appear as a zero of $q$ in $[0,\infty)$ at $\phi^{-1}(u)$.
|
||||
|
||||
|
||||
The Descartes rule of signs applied to $q$ then will give a bound on the number of possible roots of $p$ in the interval $[a,b]$. In the example we did, the Mobius transform for $a=4, b=6$ is $15 - x - 11x^2 - 3x^3$ with $1$ sign change, so there must be exactly $1$ real root of $p=(x-1)(x-3)(x-5)$ in the interval $[4,6]$, as we can observe from the factored form of $p$.
|
||||
@ -640,7 +640,8 @@ Similarly, we can see there are $2$ or $0$ roots for $p$ in the interval $[2,6]$
|
||||
|
||||
|
||||
```{julia}
|
||||
mobius_transformation(𝐩, 2,6)
|
||||
p = fromroots([1,3,5]) # (x-1)⋅(x-3)⋅(x-5) = -15 + 23*x - 9*x^2 + x^3
|
||||
mobius_transformation(p, 2,6)
|
||||
```
|
||||
|
||||
This observation, along with a detailed analysis provided by [Kobel, Rouillier, and Sagraloff](https://dl.acm.org/doi/10.1145/2930889.2930937) provides a means to find intervals that enclose the real roots of a polynomial.
|
||||
@ -662,7 +663,6 @@ Applying these steps to $p$ with an initial interval, say $[0,9]$, we would have
|
||||
|
||||
```{julia}
|
||||
#| hold: true
|
||||
p = fromroots([1,3,5]) # (x-1)⋅(x-3)⋅(x-5) = -15 + 23*x - 9*x^2 + x^3
|
||||
mobius_transformation(p, 0, 9) # 3
|
||||
mobius_transformation(p, 0, 9//2) # 2
|
||||
mobius_transformation(p, 9//2, 9) # 1 (and done)
|
||||
|
@ -206,7 +206,7 @@ Which for sake of memory we will say is $1/6$ (a $5$ percent error). So that ans
|
||||
30 * 3 / 6
|
||||
```
|
||||
|
||||
Similarly, you can use your thumb instead of your first. To use your first you can multiply by $1/6$ the adjacent side, to use your thumb about $1/30$ as this approximates the tangent of $2$ degrees:
|
||||
Similarly, you can use your thumb instead of your fist. To use your fist you can multiply by $1/6$ the adjacent side, to use your thumb about $1/30$ as this approximates the tangent of $2$ degrees:
|
||||
|
||||
|
||||
```{julia}
|
||||
@ -550,7 +550,7 @@ The approximation error is about $2.7$ percent.
|
||||
##### Example
|
||||
|
||||
|
||||
The AMS has an interesting column on [rainbows](http://www.ams.org/publicoutreach/feature-column/fcarc-rainbows) the start of which uses some formulas from the previous example. Click through to see a ray of light passing through a spherical drop of water, as analyzed by Descartes. The deflection of the ray occurs when the incident light hits the drop of water, then there is an *internal* deflection of the light, and finally when the light leaves, there is another deflection. The total deflection (in radians) is $D = (i-r) + (\pi - 2r) + (i-r) = \pi - 2i - 4r$. However, the incident angle $i$ and the refracted angle $r$ are related by Snell's law: $\sin(i) = n \sin(r)$. The value $n$ is the index of refraction and is $4/3$ for water. (It was $3/2$ for glass in the previous example.) This gives
|
||||
The AMS has an interesting column on [rainbows](http://www.ams.org/publicoutreach/feature-column/fcarc-rainbows) the start of which uses some formulas from the previous example. Click through to see a ray of light passing through a spherical drop of water, as analyzed by Descartes. The deflection of the ray occurs when the incident light hits the drop of water, then there is an *internal* deflection of the light, and finally when the light leaves, there is another deflection. The total deflection (in radians) is $D = (i-r) + (\pi - 2r) + (i-r) = \pi + 2i - 4r$. However, the incident angle $i$ and the refracted angle $r$ are related by Snell's law: $\sin(i) = n \sin(r)$. The value $n$ is the index of refraction and is $4/3$ for water. (It was $3/2$ for glass in the previous example.) This gives
|
||||
|
||||
|
||||
$$
|
||||
@ -587,7 +587,7 @@ $$
|
||||
\cos((n+1)\theta) = 2\cos(n\theta) \cos(\theta) - \cos((n-1)\theta).
|
||||
$$
|
||||
|
||||
Let $T_n(x) = \cos(n \arccos(x))$. Calling $\theta = \arccos(x)$ for $-1 \leq x \leq x$ we get a relation between these functions:
|
||||
Let $T_n(x) = \cos(n \arccos(x))$. Calling $\theta = \arccos(x)$ for $-1 \leq x \leq 1$ we get a relation between these functions:
|
||||
|
||||
|
||||
$$
|
||||
|
@ -1,11 +1,14 @@
|
||||
## calculus books
|
||||
@misc{Strang,
|
||||
author = {Gilbert Strang},
|
||||
title = {{MS Windows NT} Kernel Description},
|
||||
title = {Calculus},
|
||||
published = {1991},
|
||||
publisher = {Wellesley-Cambridge Press},
|
||||
url = {https://ocw.mit.edu/courses/res-18-001-calculus-online-textbook-spring-2005/},
|
||||
note = {Published in 1991 by Wellesley-Cambridge Press, the book is a useful resource for educators and self-learners alike.}
|
||||
}
|
||||
|
||||
|
||||
@misc{Knill,
|
||||
author = {Oliver Knill},
|
||||
title = {Some teaching notes},
|
||||
@ -41,13 +44,7 @@
|
||||
year = {2019}
|
||||
}
|
||||
|
||||
@misc{SAMPLE_WEBPAGE,
|
||||
author = {},
|
||||
title = {{MS Windows NT} Kernel Description},
|
||||
url = {},
|
||||
doi = {},
|
||||
note = {}
|
||||
}
|
||||
|
||||
|
||||
@article{knuth84,
|
||||
author = {Knuth, Donald E.},
|
||||
|
Loading…
x
Reference in New Issue
Block a user