rm WeaveSupport

This commit is contained in:
jverzani
2022-09-19 16:10:49 -04:00
parent 847109baea
commit e35ee2f6ca
66 changed files with 213 additions and 883 deletions

View File

@@ -14,17 +14,6 @@ using LinearAlgebra
using ForwardDiff
```
```{julia}
#| echo: false
#| results: "hidden"
using CalculusWithJulia.WeaveSupport
frontmatter = (
title = "2D and 3D plots in Julia with Plots",
description = "Calculus with Julia: 2D and 3D plots in Julia with Plots",
tags = ["CalculusWithJulia", "differentiable_vector_calculus", "2d and 3d plots in julia with plots"],
);
nothing
```
---
@@ -121,10 +110,10 @@ for t in ts
end
```
```{julia}
#| echo: false
note("""Adding many arrows this way would be inefficient.""")
```
:::{.callout-note}
## Note
Adding many arrows this way would be inefficient.
:::
### Setting a viewing angle for 3D plots
@@ -381,10 +370,10 @@ zs = [Z(1, theta, phi) for theta in thetas, phi in phis]
surface(xs, ys, zs)
```
```{julia}
#| echo: false
note("The above may not work with all backends for `Plots`, even if those that support 3D graphics.")
```
:::{.callout-note}
## Note
The above may not work with all backends for `Plots`, even if those that support 3D graphics.
:::
For convenience, the `plot_parametric` function from `CalculusWithJulia` can produce these plots using interval notation, `a..b`, and a function:
@@ -419,4 +408,3 @@ a,b = 1,3
f(x,y,z) = (x^2+((1+b)*y)^2+z^2-1)^3-x^2*z^3-a*y^2*z^3
CalculusWithJulia.plot_implicit_surface(f, xlim=-2..2, ylim=-1..1, zlim=-1..2)
```

View File

@@ -14,21 +14,6 @@ using Roots
using QuadGK
```
```{julia}
#| echo: false
#| results: "hidden"
using CalculusWithJulia.WeaveSupport
frontmatter = (
title = "Polar Coordinates and Curves",
description = "Calculus with Julia: Polar Coordinates and Curves",
tags = ["CalculusWithJulia", "differentiable_vector_calculus", "polar coordinates and curves"],
);
using LaTeXStrings
nothing
```
---
@@ -785,4 +770,3 @@ r(theta) = sqrt(cos(2theta) * sec(theta)^4)
val, _ = quadgk(t -> sqrt(D(r)(t)^2 + r(t)^2), -pi/4, pi/4)
numericq(val)
```

View File

@@ -26,15 +26,7 @@ import Contour: contours, levels, level, lines, coordinates
```{julia}
#| echo: false
#| results: "hidden"
using CalculusWithJulia.WeaveSupport
using CSV, DataFrames
const frontmatter = (
title = "Scalar functions",
description = "Calculus with Julia: Scalar functions",
tags = ["CalculusWithJulia", "differentiable_vector_calculus", "scalar functions"],
);
nothing
```
@@ -2436,4 +2428,3 @@ What equation does the function $f(x,y) = \cos(x) + \sin(y)$ satisfy?
answ = 5
radioq(ode_choices, answ, keep_order=true)
```

View File

@@ -20,19 +20,6 @@ And the following from the `Contour` package:
import Contour: contours, levels, level, lines, coordinates
```
```{julia}
#| echo: false
#| results: "hidden"
using CalculusWithJulia.WeaveSupport
const frontmatter = (
title = "Applications with scalar functions",
description = "Calculus with Julia: Applications with scalar functions",
tags = ["CalculusWithJulia", "differentiable_vector_calculus", "applications with scalar functions"],
);
nothing
```
This section presents different applications of scalar functions.
@@ -2309,4 +2296,3 @@ ts = fzeros(fn, 0, 2pi)
val = maximum((f∘r).(ts))
numericq(val)
```

View File

@@ -14,19 +14,6 @@ using ForwardDiff
using LinearAlgebra
```
```{julia}
#| echo: false
#| results: "hidden"
using CalculusWithJulia.WeaveSupport
const frontmatter = (
title = "Functions ``R^n \\rightarrow R^m``",
description = "Calculus with Julia: Functions ``R^n \\rightarrow R^m``",
tags = ["CalculusWithJulia", "differentiable_vector_calculus", "functions ``R^n \\rightarrow R^m``"],
);
nothing
```
For a scalar function $f: R^n \rightarrow R$, the gradient of $f$, $\nabla{f}$, is a function from $R^n \rightarrow R^n$. Specializing to $n=2$, a function that for each point, $(x,y)$, assigns a vector $\vec{v}$. This is an example of vector field. More generally, we could have a [function](https://en.wikipedia.org/wiki/Multivariable_calculus) $f: R^n \rightarrow R^m$, of which we have discussed many already:
@@ -1123,5 +1110,3 @@ radioq(choices, answ)
```
(The latter is of interest, as only when the expression is $0$ will the vector field be the gradient of a scalar function.)

View File

@@ -23,18 +23,6 @@ import DifferentialEquations
import DifferentialEquations: ODEProblem, Tsit5
```
```{julia}
#| echo: false
#| results: "hidden"
using CalculusWithJulia.WeaveSupport
frontmatter = (
title = "Vector-valued functions, ``f:R \\rightarrow R^n``",
description = "Calculus with Julia: Vector-valued functions, ``f:R \\rightarrow R^n``",
tags = ["CalculusWithJulia", "differentiable_vector_calculus", "vector-valued functions, ``f:R \\rightarrow r^n``"],
);
nothing
```
---
@@ -2795,4 +2783,3 @@ choices = [
answ = 1
radioq(choices, answ)
```

View File

@@ -13,19 +13,6 @@ using LinearAlgebra
using SymPy
```
```{julia}
#| echo: false
#| results: "hidden"
using CalculusWithJulia.WeaveSupport
const frontmatter = (
title = "Vectors and matrices",
description = "Calculus with Julia: Vectors and matrices",
tags = ["CalculusWithJulia", "differentiable_vector_calculus", "vectors and matrices"],
);
nothing
```
---
@@ -716,13 +703,10 @@ and
```{julia}
[𝓊'; 𝓋']
```
```{julia}
#| echo: false
note("""
:::{.callout-note}
## Note
The adjoint is defined *recursively* in `Julia`. In the `CalculusWithJulia` package, we overload the `'` notation for *functions* to yield a univariate derivative found with automatic differentiation. This can lead to problems: if we have a matrix of functions, `M`, and took the transpose with `M'`, then the entries of `M'` would be the derivatives of the functions in `M` - not the original functions. This is very much likely to not be what is desired. The `CalculusWithJulia` package commits **type piracy** here *and* abuses the generic idea for `'` in Julia. In general type piracy is very much frowned upon, as it can change expected behaviour. It is defined in `CalculusWithJulia`, as that package is intended only to act as a means to ease users into the wider package ecosystem of `Julia`.
""")
```
:::
---
@@ -768,12 +752,11 @@ $$
\vec{u} \times \vec{v} = \| \vec{u} \| \| \vec{v} \| \sin(\theta) \hat{n}.
$$
```{julia}
#| echo: false
note("""
:::{callout-note}
## Note
The right-hand rule is also useful to understand how standard household screws will behave when twisted with a screwdriver. If the right hand fingers curl in the direction of the twisting screwdriver, then the screw will go in or out following the direction pointed to by the thumb.
""")
```
:::
The right-hand rule depends on the order of consideration of the vectors. If they are reversed, the opposite direction is determined. A consequence is that the cross product is **anti**-commutative, unlike multiplication:
@@ -1519,4 +1502,3 @@ choices = [
answ = 1
radioq(choices, answ)
```