Merge branch 'main' into v0.16

This commit is contained in:
jverzani 2023-03-30 10:22:03 -04:00
commit 35f2ccd2ce
2 changed files with 9 additions and 9 deletions

View File

@ -80,7 +80,7 @@ As floating point numbers may be approximations, some values are not quite what
```{julia}
sqrt(2) * sqrt(2) - 2, sin(pi), 1/10 + 1/5 - 3/10
sqrt(2) * sqrt(2) - 2, sin(1pi), 1/10 + 1/5 - 3/10
```
These values are *very* small numbers, but not exactly $0$, as they are mathematically.
@ -163,7 +163,7 @@ Integers are often used casually, as they come about from parsing. As with a cal
[Floating point](http://en.wikipedia.org/wiki/Floating_point) numbers are a computational model for the real numbers. For floating point numbers, $64$ bits are used by default for both $32$- and $64$-bit systems, though other storage sizes can be requested. This gives a large ranging - but still finite - set of real numbers that can be represented. However, there are infinitely many real numbers just between $0$ and $1$, so there is no chance that all can be represented exactly on the computer with a floating point value. Floating point then is *necessarily* an approximation for all but a subset of the real numbers. Floating point values can be viewed in normalized [scientific notation](http://en.wikipedia.org/wiki/Scientific_notation) as $a\cdot 2^b$ where $a$ is the *significand* and $b$ is the *exponent*. Save for special values, the significand $a$ is normalized to satisfy $1 \leq \lvert a\rvert < 2$, the exponent can be taken to be an integer, possibly negative.
As per IEEE Standard 754, the `Float64` type gives 52 bits to the precision (with an additional implied one), 11 bits to the exponent and the other bit is used to represent the sign. Positive, finite, floating point numbers have a range approximately between $10^{-308}$ and $10^{308}$, as 308 is about $\log_{10}\cdot 2^{1023}$. The numbers are not evenly spread out over this range, but, rather, are much more concentrated closer to $0$.
As per IEEE Standard 754, the `Float64` type gives 52 bits to the precision (with an additional implied one), 11 bits to the exponent and the other bit is used to represent the sign. Positive, finite, floating point numbers have a range approximately between $10^{-308}$ and $10^{308}$, as 308 is about $\log_{10} 2^{1023}$. The numbers are not evenly spread out over this range, but, rather, are much more concentrated closer to $0$.
:::{.callout-warning}

View File

@ -63,7 +63,7 @@ The `Pluto` interface for `Julia` is idiosyncratic, as variables are *reactive*.
:::
`Julia` is referred to as a "dynamic language" which means (in most cases) that a variable can be reassigned with a value of a different type, as we did with `x` where first it was assigned to a floating point value then to an integer value. (Though we meet some cases - generic functions - where `Julia` balks at reassigning a variable if the type if different.)
`Julia` is referred to as a "dynamic language" which means (in most cases) that a variable can be reassigned with a value of a different type, as we did with `x` where first it was assigned to a floating point value then to an integer value. (Though we meet some cases - generic functions - where `Julia` balks at reassigning a variable if the type is different.)
More importantly than displaying a value, is the use of variables to build up more complicated expressions. For example, to compute
@ -115,7 +115,7 @@ By defining a new variable `a` to represent a value that is repeated a few times
A [grass swale](https://stormwater.pca.state.mn.us/index.php?title=Design_criteria_for_dry_swale_(grass_swale)) is a design to manage surface water flow resulting from a storm. Swales detain, filter, and infiltrate runoff limiting erosion in the process.
![Swale cross section](precalc/swale.png)
![Swale cross section](precalc/figures/swale.png)
There are a few mathematical formula that describe the characteristics of swale:
@ -140,14 +140,14 @@ $$
Finally, the *flow quantity* is given by *Manning's* formula:
$$
Q = vA = \frac{R^{2/3} S^{1/2}}{n}, \quad R = \frac{A}{P}.
Q = vA = \frac{R^{2/3} S^{1/2}}{n} A, \quad R = \frac{A}{P}.
$$
With $n$ being Manning's coefficient, $v$ the velocity in feet per second, and $S$ being the slope. Velocity and slope are correlated.
With $n$ being Manning's coefficient, $v$ the velocity in meters per second, and $S$ being the slope. Velocity and slope are correlated.
Manning's coefficient depends on the height of the vegetation in the grass swale. It is $0.025$ when the depth of flow is similar to the vegetation height.
Given all this, compute the flow quantity when $S = 2/90$, $n=0.025$ and $v=1/10$ for a swale with characteristics $b=1$, $\theta=\pi/4$, $d=1$.
Given all this, compute the flow quantity when $S = 2/90$ and $n=0.025$ for a swale with characteristics $b=1$, $\theta=\pi/4$, $d=1$.
```{julia}
b, theta, d = 1, pi/4, 1
@ -155,7 +155,7 @@ n, S = 0.025, 2/90
A = (b + d/tan(theta)) * d
P = b + 2d/sin(theta)
R = A / P
Q = R^(2/3) * S^(1/2) / n
Q = R^(2/3) * S^(1/2) * A / n
```
@ -287,7 +287,7 @@ There is even support for tab-completion of [emojis](https://github.com/JuliaLan
##### Example
As mentioned the value of $e$ is bound to the Unicode value `\euler[tab]` and not the letter `e`, so Unicode entry is required to access this constant This isn't quite true. The `MathConstants` module defines `e`, as well as a few other values accessed via Unicode. When the `CalculusWithJulia` package is loaded, as will often be done in these notes, a value of `exp(1)` is assigned to `e`.
As mentioned the value of $e$ is bound to the Unicode value `\euler[tab]` and not the letter `e`, so Unicode entry is required to access this constant. This isn't quite true. The `MathConstants` module defines `e`, as well as a few other values accessed via Unicode. When the `CalculusWithJulia` package is loaded, as will often be done in these notes, a value of `exp(1)` is assigned to `e`.
## Tuple assignment