@@ -1,5 +1,10 @@
|
||||
# JavaScript based plotting libraries
|
||||
|
||||
!!! alert "Not working with quarto"
|
||||
Currently, the plots generated here are not rendering within quarto.
|
||||
|
||||
|
||||
|
||||
This section uses this add-on package:
|
||||
|
||||
```julia
|
||||
|
||||
@@ -396,7 +396,39 @@ That is the function $f(x)$, minus the secant line between $(a,f(a))$ and $(b, f
|
||||
nothing
|
||||
```
|
||||
|
||||
An interactive example can be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem).
|
||||
```=html
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```ojs
|
||||
//| echo: false
|
||||
//| output: false
|
||||
|
||||
JXG = require("jsxgraph");
|
||||
|
||||
board = JXG.JSXGraph.initBoard('jsxgraph', {boundingbox: [-5, 10, 7, -6], axis:true});
|
||||
p = [
|
||||
board.create('point', [-1,-2], {size:2}),
|
||||
board.create('point', [6,5], {size:2}),
|
||||
board.create('point', [-0.5,1], {size:2}),
|
||||
board.create('point', [3,3], {size:2})
|
||||
];
|
||||
f = JXG.Math.Numerics.lagrangePolynomial(p);
|
||||
graph = board.create('functiongraph', [f,-10, 10]);
|
||||
|
||||
g = function(x) {
|
||||
return JXG.Math.Numerics.D(f)(x)-(p[1].Y()-p[0].Y())/(p[1].X()-p[0].X());
|
||||
};
|
||||
|
||||
r = board.create('glider', [
|
||||
function() { return JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5); },
|
||||
function() { return f(JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5)); },
|
||||
graph], {name:' ',size:4,fixed:true});
|
||||
board.create('tangent', [r], {strokeColor:'#ff0000'});
|
||||
line = board.create('line',[p[0],p[1]],{strokeColor:'#ff0000',dash:1});
|
||||
```
|
||||
|
||||
This interactive example can also be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem). It shows a cubic polynomial fit to the ``4`` adjustable points labeled A through D. The secant line is drawn between points A and B with a dashed line. A tangent line -- with the same slope as the secant line -- is identified at a point ``(\alpha, f(\alpha))`` where ``\alpha`` is between the points A and B. That this can always be done is a conseuqence of the mean value theorem.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
@@ -285,6 +285,96 @@ gif(anim, imgfile, fps = 1)
|
||||
ImageFile(imgfile, caption)
|
||||
```
|
||||
|
||||
----
|
||||
|
||||
This interactive graphic (built using [JSXGraph](https://jsxgraph.uni-bayreuth.de/wp/index.html)) allows the adjustment of the point `x0`, initially at ``0.85``. Five iterations of Newton's method are illustrated. Different positions of `x0` clearly converge, others will not.
|
||||
|
||||
```=html
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```ojs
|
||||
//| echo: false
|
||||
//| output: false
|
||||
|
||||
JXG = require("jsxgraph");
|
||||
|
||||
// newton's method
|
||||
|
||||
b = JXG.JSXGraph.initBoard('jsxgraph', {
|
||||
boundingbox: [-3,5,3,-5], axis:true
|
||||
});
|
||||
|
||||
|
||||
f = function(x) {return x*x*x*x*x - x - 1};
|
||||
fp = function(x) { return 4*x*x*x*x - 1};
|
||||
x0 = 0.85;
|
||||
|
||||
nm = function(x) { return x - f(x)/fp(x);};
|
||||
|
||||
l = b.create('point', [-1.5,0], {name:'', size:0});
|
||||
r = b.create('point', [1.5,0], {name:'', size:0});
|
||||
xaxis = b.create('line', [l,r])
|
||||
|
||||
|
||||
P0 = b.create('glider', [x0,0,xaxis], {name:'x0'});
|
||||
P0a = b.create('point', [function() {return P0.X();},
|
||||
function() {return f(P0.X());}], {name:''});
|
||||
|
||||
P1 = b.create('point', [function() {return nm(P0.X());},
|
||||
0], {name:''});
|
||||
P1a = b.create('point', [function() {return P1.X();},
|
||||
function() {return f(P1.X());}], {name:''});
|
||||
|
||||
P2 = b.create('point', [function() {return nm(P1.X());},
|
||||
0], {name:''});
|
||||
P2a = b.create('point', [function() {return P2.X();},
|
||||
function() {return f(P2.X());}], {name:''});
|
||||
|
||||
P3 = b.create('point', [function() {return nm(P2.X());},
|
||||
0], {name:''});
|
||||
P3a = b.create('point', [function() {return P3.X();},
|
||||
function() {return f(P3.X());}], {name:''});
|
||||
|
||||
P4 = b.create('point', [function() {return nm(P3.X());},
|
||||
0], {name:''});
|
||||
P4a = b.create('point', [function() {return P4.X();},
|
||||
function() {return f(P4.X());}], {name:''});
|
||||
P5 = b.create('point', [function() {return nm(P4.X());},
|
||||
0], {name:'x5', strokeColor:'black'});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
P0a.setAttribute({fixed:true});
|
||||
P1.setAttribute({fixed:true});
|
||||
P1a.setAttribute({fixed:true});
|
||||
P2.setAttribute({fixed:true});
|
||||
P2a.setAttribute({fixed:true});
|
||||
P3.setAttribute({fixed:true});
|
||||
P3a.setAttribute({fixed:true});
|
||||
P4.setAttribute({fixed:true});
|
||||
P4a.setAttribute({fixed:true});
|
||||
P5.setAttribute({fixed:true});
|
||||
|
||||
sc = '#000000';
|
||||
b.create('segment', [P0,P0a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P0a, P1], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P1,P1a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P1a, P2], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P2,P2a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P2a, P3], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P3,P3a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P3a, P4], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P4,P4a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P4a, P5], {strokeColor:sc, strokeWidth:1});
|
||||
|
||||
b.create('functiongraph', [f, -1.5, 1.5])
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
##### Example: numeric not algebraic
|
||||
|
||||
|
||||
@@ -1430,11 +1430,49 @@ The area under a curve approximated by a Riemann sum.
|
||||
# url = "riemann.js"
|
||||
#CalculusWithJulia.WeaveSupport.JSXGraph(:integrals, url, caption)
|
||||
# This is just wrong...
|
||||
url = "https://raw.githubusercontent.com/jverzani/CalculusWithJulia.jl/master/CwJ/integrals/riemann.js"
|
||||
url = "./riemann.js"
|
||||
CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
|
||||
#CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
```=html
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```ojs
|
||||
//| echo: false
|
||||
//| output: false
|
||||
JXG = require("jsxgraph");
|
||||
|
||||
b = JXG.JSXGraph.initBoard('jsxgraph', {
|
||||
boundingbox: [-0.5,0.3,1.5,-1/4], axis:true
|
||||
});
|
||||
|
||||
g = function(x) { return x*x*x*x + 10*x*x - 60* x + 100}
|
||||
f = function(x) {return 1/Math.sqrt(g(x))};
|
||||
|
||||
type = "right";
|
||||
l = 0;
|
||||
r = 1;
|
||||
rsum = function() {
|
||||
return JXG.Math.Numerics.riemannsum(f,n.Value(), type, l, r);
|
||||
};
|
||||
n = b.create('slider', [[0.1, -0.05],[0.75,-0.05], [2,1,50]],{name:'n',snapWidth:1});
|
||||
|
||||
graph = b.create('functiongraph', [f, l, r]);
|
||||
os = b.create('riemannsum',
|
||||
[f,
|
||||
function(){ return n.Value();},
|
||||
type, l, r
|
||||
],
|
||||
{fillColor:'#ffff00', fillOpacity:0.3});
|
||||
|
||||
b.create('text', [0.1,0.25, function(){
|
||||
return 'Riemann sum='+(rsum().toFixed(4));
|
||||
}]);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
The interactive graphic shows the area of a right-Riemann sum for different partitions. The function is
|
||||
|
||||
@@ -1451,7 +1489,7 @@ numericq(0.1224)
|
||||
When ``n=50`` what is the area of the Riemann sum?
|
||||
|
||||
```julia; hold=true; echo=false
|
||||
numericq(0.1887)
|
||||
numericq(0.1187)
|
||||
```
|
||||
|
||||
Using `quadgk` what is the area under the curve?
|
||||
|
||||
@@ -384,6 +384,43 @@ get close to $c$ - allows us to gather quickly if a function seems to
|
||||
have a limit at $c$, though the precise value of $L$ may be hard to identify.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
This example illustrates the same limit a different way. Sliding the ``x`` value towards ``0`` shows ``f(x) = \sin(x)/x`` approaches a value of ``1``.
|
||||
|
||||
|
||||
```=html
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```ojs
|
||||
//| echo: false
|
||||
//| output: false
|
||||
|
||||
JXG = require("jsxgraph")
|
||||
|
||||
b = JXG.JSXGraph.initBoard('jsxgraph', {
|
||||
boundingbox: [-6, 1.2, 6,-1.2], axis:true
|
||||
});
|
||||
|
||||
f = function(x) {return Math.sin(x) / x;};
|
||||
graph = b.create("functiongraph", [f, -6, 6])
|
||||
seg = b.create("line", [[-6,0], [6,0]], {fixed:true});
|
||||
|
||||
X = b.create("glider", [2, 0, seg], {name:"x", size:4});
|
||||
P = b.create("point", [function() {return X.X()}, function() {return f(X.X())}], {name:""});
|
||||
Q = b.create("point", [0, function() {return P.Y();}], {name:"f(x)"});
|
||||
|
||||
segup = b.create("segment", [P,X], {dash:2});
|
||||
segover = b.create("segment", [P, [0, function() {return P.Y()}]], {dash:2});
|
||||
|
||||
|
||||
txt = b.create('text', [2, 1, function() {
|
||||
return "x = " + X.X().toFixed(4) + ", f(x) = " + P.Y().toFixed(4);
|
||||
}]);
|
||||
```
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
@@ -436,8 +473,6 @@ $g(x) = (x-3)/(x+3)$ when $x \neq 2$. The function $g(x)$ is
|
||||
$g(2) = (2 - 3)/(2 + 3) = -0.2$ it would be made continuous, hence the
|
||||
term removable singularity.
|
||||
|
||||
|
||||
|
||||
## Numerical approaches to limits
|
||||
|
||||
The investigation of $\lim_{x \rightarrow 0}(1 + x)^{1/x}$ by
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name = "CalculusWithJuliaNotes"
|
||||
uuid = "8cd3c377-0a30-4ec5-b85a-75291d749efe"
|
||||
authors = ["jverzani <jverzani@gmail.com> and contributors"]
|
||||
version = "0.1.0"
|
||||
version = "0.1.1"
|
||||
|
||||
[compat]
|
||||
julia = "1"
|
||||
|
||||
2
quarto/.gitignore
vendored
2
quarto/.gitignore
vendored
@@ -1,5 +1,5 @@
|
||||
/.quarto/
|
||||
/_site/
|
||||
/_book/
|
||||
/_freeze/
|
||||
/*/*_files/
|
||||
/*/*.ipynb/
|
||||
@@ -1,10 +0,0 @@
|
||||
[deps]
|
||||
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
|
||||
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
|
||||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
|
||||
MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca"
|
||||
NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
|
||||
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
|
||||
@@ -1,33 +1,7 @@
|
||||
# The `DifferentialEquations` suite
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Euler's method
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# ODEs
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
using WeavePynb
|
||||
using Mustache
|
||||
|
||||
mmd(fname) = mmd_to_html(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
|
||||
## uncomment to generate just .md files
|
||||
mmd(fname) = mmd_to_md(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
|
||||
|
||||
fnames = [
|
||||
"odes",
|
||||
"euler"
|
||||
]
|
||||
|
||||
|
||||
|
||||
function process_file(nm, twice=false)
|
||||
include("$nm.jl")
|
||||
mmd_to_md("$nm.mmd")
|
||||
markdownToHTML("$nm.md")
|
||||
twice && markdownToHTML("$nm.md")
|
||||
end
|
||||
|
||||
process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
|
||||
|
||||
"""
|
||||
## TODO ODEs
|
||||
|
||||
"""
|
||||
@@ -1,33 +1,7 @@
|
||||
# The problem-algorithm-solve interface
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
## TODO
|
||||
|
||||
* download links to Pluto .jl files (if we have .jmd, but we might deprecate...)
|
||||
* PlotlyLight
|
||||
* mermaid, ojs?
|
||||
|
||||
DONE * clean up edit link
|
||||
DONE * remove pinned header
|
||||
DONE * clean up directory
|
||||
DONE (?) * JSXGraph files
|
||||
|
||||
# CalculusWithJulia via quarto
|
||||
|
||||
To compile the pages through quarto
|
||||
@@ -15,6 +26,7 @@ To compile the pages through quarto
|
||||
|
||||
* bump the version number in `_quarto.yml`, `Project.toml`
|
||||
* run `quarto publish gh-pages` to publish
|
||||
* or `quarto publish gh-pages --no-render` to avoid re-rendering, when just done
|
||||
* should also push project to github
|
||||
* no need to push `_freeze` the repo, as files are locally rendered for now.
|
||||
|
||||
27
quarto/_common_code.qmd
Normal file
27
quarto/_common_code.qmd
Normal file
@@ -0,0 +1,27 @@
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
@@ -8,22 +8,20 @@ comments:
|
||||
|
||||
book:
|
||||
title: "Calculus with Julia"
|
||||
date: now
|
||||
author: "John Verzani"
|
||||
date: now
|
||||
search: true
|
||||
repo-url: https://github.com/jverzani/CalculusWithJuliaNotes.jl
|
||||
repo-actions: [edit]
|
||||
downloads: [pdf, epub]
|
||||
repo-subdir: quarto/
|
||||
repo-actions: [edit, issue]
|
||||
navbar:
|
||||
background: light
|
||||
search: true
|
||||
logo: logo.png
|
||||
pinned: true
|
||||
page-footer:
|
||||
left: "Copyright 2022, John Verzani"
|
||||
right:
|
||||
- icon: github
|
||||
href: https://github.com/
|
||||
pinned: false
|
||||
sidebar:
|
||||
collapse-level: 1
|
||||
page-footer: "Copyright 2022, John Verzani"
|
||||
chapters:
|
||||
- index.qmd
|
||||
- part: "Precalculus Concepts"
|
||||
@@ -125,10 +123,11 @@ bibliography: references.bib
|
||||
|
||||
website:
|
||||
favicon: logo.png
|
||||
reader-mode: true
|
||||
|
||||
format:
|
||||
html:
|
||||
theme: lux # spacelab # lux # sketchy # cosmo # https://quarto.org/docs/output-formats/html-themes.html
|
||||
theme: lux #lux # spacelab # lux # sketchy # cosmo # https://quarto.org/docs/output-formats/html-themes.html
|
||||
number-depth: 3
|
||||
toc-depth: 3
|
||||
link-external-newwindow: true
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
[deps]
|
||||
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
|
||||
GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
|
||||
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
|
||||
IntervalRootFinding = "d2bf35a9-74e0-55ec-b149-d360ff49b807"
|
||||
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
|
||||
MDBM = "dd61e66b-39ce-57b0-8813-509f78be4b4d"
|
||||
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
|
||||
Weave = "44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9"
|
||||
@@ -1,33 +1,13 @@
|
||||
# JavaScript based plotting libraries
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
:::{.callout-note}
|
||||
## Not working with quarto
|
||||
Currently, the plots generated here are not rendering within quarto.
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
:::
|
||||
|
||||
This section uses this add-on package:
|
||||
|
||||
|
||||
BIN
quarto/cover.png
BIN
quarto/cover.png
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
@@ -1,17 +0,0 @@
|
||||
[deps]
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949"
|
||||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
|
||||
ImplicitPlots = "55ecb840-b828-11e9-1645-43f4a9f9ace7"
|
||||
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
|
||||
IntervalConstraintProgramming = "138f1668-1576-5ad7-91b9-7425abbf3153"
|
||||
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
|
||||
MDBM = "dd61e66b-39ce-57b0-8813-509f78be4b4d"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
|
||||
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
|
||||
TaylorSeries = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
|
||||
TermInterface = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c"
|
||||
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
|
||||
@@ -1,33 +1,7 @@
|
||||
# Curve Sketching
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Derivatives
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# The first and second derivatives
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Implicit Differentiation
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# L'Hospital's Rule
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Linearization
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# The mean value theorem for differentiable functions.
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
@@ -390,7 +364,39 @@ That is the function $f(x)$, minus the secant line between $(a,f(a))$ and $(b, f
|
||||
nothing
|
||||
```
|
||||
|
||||
An interactive example can be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem).
|
||||
```{=html}
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```{ojs}
|
||||
//| echo: false
|
||||
//| output: false
|
||||
|
||||
JXG = require("jsxgraph");
|
||||
|
||||
board = JXG.JSXGraph.initBoard('jsxgraph', {boundingbox: [-5, 10, 7, -6], axis:true});
|
||||
p = [
|
||||
board.create('point', [-1,-2], {size:2}),
|
||||
board.create('point', [6,5], {size:2}),
|
||||
board.create('point', [-0.5,1], {size:2}),
|
||||
board.create('point', [3,3], {size:2})
|
||||
];
|
||||
f = JXG.Math.Numerics.lagrangePolynomial(p);
|
||||
graph = board.create('functiongraph', [f,-10, 10]);
|
||||
|
||||
g = function(x) {
|
||||
return JXG.Math.Numerics.D(f)(x)-(p[1].Y()-p[0].Y())/(p[1].X()-p[0].X());
|
||||
};
|
||||
|
||||
r = board.create('glider', [
|
||||
function() { return JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5); },
|
||||
function() { return f(JXG.Math.Numerics.root(g,(p[0].X()+p[1].X())*0.5)); },
|
||||
graph], {name:' ',size:4,fixed:true});
|
||||
board.create('tangent', [r], {strokeColor:'#ff0000'});
|
||||
line = board.create('line',[p[0],p[1]],{strokeColor:'#ff0000',dash:1});
|
||||
```
|
||||
|
||||
This interactive example can also be found at [jsxgraph](http://jsxgraph.uni-bayreuth.de/wiki/index.php?title=Mean_Value_Theorem). It shows a cubic polynomial fit to the $4$ adjustable points labeled A through D. The secant line is drawn between points A and B with a dashed line. A tangent line – with the same slope as the secant line – is identified at a point $(\alpha, f(\alpha))$ where $\alpha$ is between the points A and B. That this can always be done is a conseuqence of the mean value theorem.
|
||||
|
||||
|
||||
##### Example
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Derivative-free alternatives to Newton's method
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Newton's method
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
@@ -311,6 +285,97 @@ gif(anim, imgfile, fps = 1)
|
||||
ImageFile(imgfile, caption)
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
This interactive graphic (built using [JSXGraph](https://jsxgraph.uni-bayreuth.de/wp/index.html)) allows the adjustment of the point `x0`, initially at $0.85$. Five iterations of Newton's method are illustrated. Different positions of `x0` clearly converge, others will not.
|
||||
|
||||
|
||||
```{=html}
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```{ojs}
|
||||
//| echo: false
|
||||
//| output: false
|
||||
|
||||
JXG = require("jsxgraph");
|
||||
|
||||
// newton's method
|
||||
|
||||
b = JXG.JSXGraph.initBoard('jsxgraph', {
|
||||
boundingbox: [-3,5,3,-5], axis:true
|
||||
});
|
||||
|
||||
|
||||
f = function(x) {return x*x*x*x*x - x - 1};
|
||||
fp = function(x) { return 4*x*x*x*x - 1};
|
||||
x0 = 0.85;
|
||||
|
||||
nm = function(x) { return x - f(x)/fp(x);};
|
||||
|
||||
l = b.create('point', [-1.5,0], {name:'', size:0});
|
||||
r = b.create('point', [1.5,0], {name:'', size:0});
|
||||
xaxis = b.create('line', [l,r])
|
||||
|
||||
|
||||
P0 = b.create('glider', [x0,0,xaxis], {name:'x0'});
|
||||
P0a = b.create('point', [function() {return P0.X();},
|
||||
function() {return f(P0.X());}], {name:''});
|
||||
|
||||
P1 = b.create('point', [function() {return nm(P0.X());},
|
||||
0], {name:''});
|
||||
P1a = b.create('point', [function() {return P1.X();},
|
||||
function() {return f(P1.X());}], {name:''});
|
||||
|
||||
P2 = b.create('point', [function() {return nm(P1.X());},
|
||||
0], {name:''});
|
||||
P2a = b.create('point', [function() {return P2.X();},
|
||||
function() {return f(P2.X());}], {name:''});
|
||||
|
||||
P3 = b.create('point', [function() {return nm(P2.X());},
|
||||
0], {name:''});
|
||||
P3a = b.create('point', [function() {return P3.X();},
|
||||
function() {return f(P3.X());}], {name:''});
|
||||
|
||||
P4 = b.create('point', [function() {return nm(P3.X());},
|
||||
0], {name:''});
|
||||
P4a = b.create('point', [function() {return P4.X();},
|
||||
function() {return f(P4.X());}], {name:''});
|
||||
P5 = b.create('point', [function() {return nm(P4.X());},
|
||||
0], {name:'x5', strokeColor:'black'});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
P0a.setAttribute({fixed:true});
|
||||
P1.setAttribute({fixed:true});
|
||||
P1a.setAttribute({fixed:true});
|
||||
P2.setAttribute({fixed:true});
|
||||
P2a.setAttribute({fixed:true});
|
||||
P3.setAttribute({fixed:true});
|
||||
P3a.setAttribute({fixed:true});
|
||||
P4.setAttribute({fixed:true});
|
||||
P4a.setAttribute({fixed:true});
|
||||
P5.setAttribute({fixed:true});
|
||||
|
||||
sc = '#000000';
|
||||
b.create('segment', [P0,P0a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P0a, P1], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P1,P1a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P1a, P2], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P2,P2a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P2a, P3], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P3,P3a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P3a, P4], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P4,P4a], {strokeColor:sc, strokeWidth:1});
|
||||
b.create('segment', [P4a, P5], {strokeColor:sc, strokeWidth:1});
|
||||
|
||||
b.create('functiongraph', [f, -1.5, 1.5])
|
||||
|
||||
```
|
||||
|
||||
##### Example: numeric not algebraic
|
||||
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Numeric derivatives
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Optimization
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
using WeavePynb
|
||||
|
||||
using CwJWeaveTpl
|
||||
|
||||
|
||||
|
||||
fnames = [
|
||||
"derivatives", ## more questions
|
||||
"numeric_derivatives",
|
||||
|
||||
"mean_value_theorem",
|
||||
"optimization",
|
||||
"curve_sketching",
|
||||
|
||||
"linearization",
|
||||
"newtons_method",
|
||||
"lhopitals_rule", ## Okay - -but could beef up questions..
|
||||
|
||||
|
||||
"implicit_differentiation", ## add more questions?
|
||||
"related_rates",
|
||||
"taylor_series_polynomials"
|
||||
]
|
||||
|
||||
|
||||
process_file(nm; cache=:off) = CwJWeaveTpl.mmd(nm * ".jmd", cache=cache)
|
||||
|
||||
function process_files(;cache=:user)
|
||||
for f in fnames
|
||||
@show f
|
||||
process_file(f, cache=cache)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
## TODO derivatives
|
||||
|
||||
tangent lines intersect at avearge for a parabola
|
||||
|
||||
Should we have derivative results: inverse functions, logarithmic differentiation...
|
||||
"""
|
||||
@@ -1,33 +1,7 @@
|
||||
# Related rates
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packaages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Symbolic derivatives
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses this add-on package:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Taylor Polynomials and other Approximating Polynomials
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
[deps]
|
||||
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
|
||||
Contour = "d38c429a-6771-53c6-b99e-75d170b6e991"
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
DifferentialEquations = "0c46a032-eb83-5123-abaf-570d42b7fbaa"
|
||||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
|
||||
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953"
|
||||
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
|
||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
MDBM = "dd61e66b-39ce-57b0-8813-509f78be4b4d"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
|
||||
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
|
||||
@@ -1,33 +1,7 @@
|
||||
# 2D and 3D plots in Julia with Plots
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Polar Coordinates and Curves
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
using WeavePynb
|
||||
using Mustache
|
||||
|
||||
mmd(fname) = mmd_to_html(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
|
||||
## uncomment to generate just .md files
|
||||
#mmd(fname) = mmd_to_md(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
|
||||
|
||||
|
||||
|
||||
|
||||
fnames = ["polar_coordinates",
|
||||
"vectors",
|
||||
"vector_valued_functions",
|
||||
"scalar_functions",
|
||||
"scalar_functions_applications",
|
||||
"vector_fields"
|
||||
]
|
||||
|
||||
function process_file(nm, twice=false)
|
||||
include("$nm.jl")
|
||||
mmd_to_md("$nm.mmd")
|
||||
markdownToHTML("$nm.md")
|
||||
twice && markdownToHTML("$nm.md")
|
||||
end
|
||||
|
||||
process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
|
||||
|
||||
|
||||
"""
|
||||
## TODO differential_vector_calcululs
|
||||
|
||||
### Add questions for scalar_function_applications
|
||||
* Newton's method??
|
||||
* optimization. Find least squares for perpendicular distance using the same 3 points...??
|
||||
|
||||
"""
|
||||
@@ -1,33 +1,7 @@
|
||||
# Scalar functions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Applications with scalar functions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Functions $R^n \rightarrow R^m$
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,35 +1,7 @@
|
||||
# Vector-valued functions, $f:R \rightarrow R^n$
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
@@ -2823,3 +2795,4 @@ choices = [
|
||||
answ = 1
|
||||
radioq(choices, answ)
|
||||
```
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Vectors and matrices
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on package:
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,8 +0,0 @@
|
||||
[deps]
|
||||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
|
||||
HCubature = "19dc6840-f33b-545b-b366-655c7e3ffd49"
|
||||
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
|
||||
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
|
||||
@@ -1,33 +1,7 @@
|
||||
# The Gradient, Divergence, and Curl
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Multi-dimensional integrals
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Line and Surface Integrals
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
using WeavePynb
|
||||
using Mustache
|
||||
|
||||
mmd(fname) = mmd_to_html(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
|
||||
## uncomment to generate just .md files
|
||||
#mmd(fname) = mmd_to_md(fname, BRAND_HREF="../toc.html", BRAND_NAME="Calculus with Julia")
|
||||
|
||||
|
||||
|
||||
|
||||
fnames = [
|
||||
"double_triple_integrals",
|
||||
"line_integrals",
|
||||
"div_grad_curl",
|
||||
"stokes_theorem",
|
||||
"review"
|
||||
]
|
||||
|
||||
function process_file(nm, twice=false)
|
||||
include("$nm.jl")
|
||||
mmd_to_md("$nm.mmd")
|
||||
markdownToHTML("$nm.md")
|
||||
twice && markdownToHTML("$nm.md")
|
||||
end
|
||||
|
||||
process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
## TODO integral_vector_calculus
|
||||
* line integrals needs an image (lasso?)
|
||||
* more questions
|
||||
"""
|
||||
@@ -1,33 +1,7 @@
|
||||
# Quick Review of Vector Calculus
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Green's Theorem, Stokes' Theorem, and the Divergence Theorem
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
[deps]
|
||||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
|
||||
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
|
||||
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
|
||||
UnitfulUS = "7dc9378f-8956-57ef-a780-aa31cc70ff3d"
|
||||
@@ -1,33 +1,7 @@
|
||||
# Arc length
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Area under a curve
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
@@ -1442,9 +1416,45 @@ The area under a curve approximated by a Riemann sum.
|
||||
# url = "riemann.js"
|
||||
#CalculusWithJulia.WeaveSupport.JSXGraph(:integrals, url, caption)
|
||||
# This is just wrong...
|
||||
url = "https://raw.githubusercontent.com/jverzani/CalculusWithJulia.jl/master/CwJ/integrals/riemann.js"
|
||||
url = "./riemann.js"
|
||||
CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
|
||||
#CalculusWithJulia.WeaveSupport.JSXGraph(url, caption)
|
||||
nothing
|
||||
```
|
||||
|
||||
```{=html}
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```{ojs}
|
||||
//| echo: false
|
||||
//| output: false
|
||||
JXG = require("jsxgraph");
|
||||
|
||||
b = JXG.JSXGraph.initBoard('jsxgraph', {
|
||||
boundingbox: [-0.5,0.3,1.5,-1/4], axis:true
|
||||
});
|
||||
|
||||
g = function(x) { return x*x*x*x + 10*x*x - 60* x + 100}
|
||||
f = function(x) {return 1/Math.sqrt(g(x))};
|
||||
|
||||
type = "right";
|
||||
l = 0;
|
||||
r = 1;
|
||||
rsum = function() {
|
||||
return JXG.Math.Numerics.riemannsum(f,n.Value(), type, l, r);
|
||||
};
|
||||
n = b.create('slider', [[0.1, -0.05],[0.75,-0.05], [2,1,50]],{name:'n',snapWidth:1});
|
||||
|
||||
graph = b.create('functiongraph', [f, l, r]);
|
||||
os = b.create('riemannsum',
|
||||
[f,
|
||||
function(){ return n.Value();},
|
||||
type, l, r
|
||||
],
|
||||
{fillColor:'#ffff00', fillOpacity:0.3});
|
||||
|
||||
b.create('text', [0.1,0.25, function(){
|
||||
return 'Riemann sum='+(rsum().toFixed(4));
|
||||
}]);
|
||||
```
|
||||
|
||||
The interactive graphic shows the area of a right-Riemann sum for different partitions. The function is
|
||||
@@ -1469,7 +1479,7 @@ When $n=50$ what is the area of the Riemann sum?
|
||||
```{julia}
|
||||
#| hold: true
|
||||
#| echo: false
|
||||
numericq(0.1887)
|
||||
numericq(0.1187)
|
||||
```
|
||||
|
||||
Using `quadgk` what is the area under the curve?
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Area between two curves
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Center of Mass
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Fundamental Theorem or Calculus
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Improper Integrals
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Integration By Parts
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Mean value theorem for integrals
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Partial Fractions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
using CalculusWithJulia
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
fnames = [
|
||||
"area",
|
||||
"ftc",
|
||||
|
||||
"substitution",
|
||||
"integration_by_parts",
|
||||
"partial_fractions", # XX add in trig integrals (cos()sin() stuff? mx or ^m... XXX
|
||||
"improper_integrals", ##
|
||||
|
||||
"mean_value_theorem",
|
||||
"area_between_curves",
|
||||
"center_of_mass",
|
||||
"volumes_slice",
|
||||
#"volumes_shell", ## XXX add this in if needed, but not really that excited to now XXX
|
||||
"arc_length",
|
||||
"surface_area"
|
||||
]
|
||||
|
||||
|
||||
|
||||
function process_file(nm, twice=false)
|
||||
include("$nm.jl")
|
||||
mmd_to_md("$nm.mmd")
|
||||
markdownToHTML("$nm.md")
|
||||
twice && markdownToHTML("$nm.md")
|
||||
end
|
||||
|
||||
process_files(twice=false) = [process_file(nm, twice) for nm in fnames]
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
## TODO integrals
|
||||
|
||||
* add in volumes shell???
|
||||
* mean value theorem is light?
|
||||
* could add surface area problems
|
||||
|
||||
"""
|
||||
@@ -1,33 +1,7 @@
|
||||
# Substitution
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Surface Area
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Volumes by slicing
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
# Introduction
|
||||
|
||||
This is a book created from markdown and executable code.
|
||||
|
||||
See @knuth84 for additional discussion of literate programming.
|
||||
@@ -9,36 +9,40 @@ Base.show(io::IO, ::MIME"text/qmd", content) = Markdown.plain(io, content)
|
||||
## Expects title to be very first thing in a jmd file
|
||||
## Proper way would be to use https://quarto.org/docs/extensions/nbfilter.html
|
||||
function inject_code(io::IO)
|
||||
println(io, """
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\\"math-left-align\\" style=\\"padding-left: 4px; width:0; float:left;\\"> ")
|
||||
println(io, "\\\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
println(io, """
|
||||
{{< include ../_common_code.qmd >}}
|
||||
""")
|
||||
end
|
||||
# println(io, """
|
||||
# ```{julia}
|
||||
# #| echo: false
|
||||
|
||||
# import Logging
|
||||
# Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
# Logging.disable_logging(Logging.Warn)
|
||||
|
||||
# import SymPy
|
||||
# function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
# println(io, "<span class=\\"math-left-align\\" style=\\"padding-left: 4px; width:0; float:left;\\"> ")
|
||||
# println(io, "\\\\[")
|
||||
# println(io, sympy.latex(x))
|
||||
# println(io, "\\\\]")
|
||||
# println(io, "</span>")
|
||||
# end
|
||||
|
||||
# # hack to work around issue
|
||||
# import Markdown
|
||||
# import CalculusWithJulia
|
||||
# function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
# nm = joinpath("..", string(d), f)
|
||||
# u = ""
|
||||
# Markdown.parse(u)
|
||||
# end
|
||||
|
||||
# nothing
|
||||
# ```
|
||||
# """)
|
||||
# end
|
||||
|
||||
## Main function to take a jmd file and turn into an HTML
|
||||
function markdownToHTML(fname::AbstractString; TITLE="", kwargs...)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
[deps]
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
|
||||
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
|
||||
IntervalRootFinding = "d2bf35a9-74e0-55ec-b149-d360ff49b807"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
|
||||
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
|
||||
@@ -1,33 +1,7 @@
|
||||
# Continuity
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Implications of continuity
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Limits
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses the following add-on packages:
|
||||
|
||||
@@ -407,6 +381,43 @@ The graphical approach to limits - plotting $f(x)$ around $c$ and observing if t
|
||||
##### Example
|
||||
|
||||
|
||||
This example illustrates the same limit a different way. Sliding the $x$ value towards $0$ shows $f(x) = \sin(x)/x$ approaches a value of $1$.
|
||||
|
||||
|
||||
```{=html}
|
||||
<div id="jsxgraph" style="width: 500px; height: 500px;"></div>
|
||||
```
|
||||
|
||||
```{ojs}
|
||||
//| echo: false
|
||||
//| output: false
|
||||
|
||||
JXG = require("jsxgraph")
|
||||
|
||||
b = JXG.JSXGraph.initBoard('jsxgraph', {
|
||||
boundingbox: [-6, 1.2, 6,-1.2], axis:true
|
||||
});
|
||||
|
||||
f = function(x) {return Math.sin(x) / x;};
|
||||
graph = b.create("functiongraph", [f, -6, 6])
|
||||
seg = b.create("line", [[-6,0], [6,0]], {fixed:true});
|
||||
|
||||
X = b.create("glider", [2, 0, seg], {name:"x", size:4});
|
||||
P = b.create("point", [function() {return X.X()}, function() {return f(X.X())}], {name:""});
|
||||
Q = b.create("point", [0, function() {return P.Y();}], {name:"f(x)"});
|
||||
|
||||
segup = b.create("segment", [P,X], {dash:2});
|
||||
segover = b.create("segment", [P, [0, function() {return P.Y()}]], {dash:2});
|
||||
|
||||
|
||||
txt = b.create('text', [2, 1, function() {
|
||||
return "x = " + X.X().toFixed(4) + ", f(x) = " + P.Y().toFixed(4);
|
||||
}]);
|
||||
```
|
||||
|
||||
##### Example
|
||||
|
||||
|
||||
Consider now the following limit
|
||||
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Limits, issues, extensions of the concept
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
using CwJWeaveTpl
|
||||
|
||||
fnames = [
|
||||
"limits",
|
||||
"limits_extensions",
|
||||
#
|
||||
"continuity",
|
||||
"intermediate_value_theorem"
|
||||
]
|
||||
|
||||
|
||||
process_file(nm; cache=:off) = CwJWeaveTpl.mmd(nm * ".jmd", cache=cache)
|
||||
|
||||
function process_files(;cache=:user)
|
||||
for f in fnames
|
||||
@show f
|
||||
process_file(f, cache=cache)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
"""
|
||||
## TODO limits
|
||||
|
||||
"""
|
||||
@@ -38,6 +38,7 @@ for DIR ∈ DIRS
|
||||
qmd_file = joinpath(DIR, fnm * ".qmd")
|
||||
jmd_file = joinpath(dir, f)
|
||||
if mtime(jmd_file) > mtime(qmd_file)
|
||||
@show :new, qmd_file
|
||||
open(qmd_file, "w") do io
|
||||
jmd2qmd(io, jmd_file)
|
||||
end
|
||||
@@ -45,7 +46,7 @@ for DIR ∈ DIRS
|
||||
else
|
||||
_, ext = splitext(f)
|
||||
ext == ".toml" && continue
|
||||
@show :cp, f
|
||||
f == "process.jl" && continue
|
||||
try
|
||||
force = isfile(joinpath(DIR, f))
|
||||
cp(joinpath(dir,f), joinpath(DIR,f), force=force)
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
[deps]
|
||||
CalculusWithJulia = "a2e0e22d-7d4c-5312-9169-8b992201a882"
|
||||
HCubature = "19dc6840-f33b-545b-b366-655c7e3ffd49"
|
||||
ImplicitEquations = "95701278-4526-5785-aba3-513cca398f19"
|
||||
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
|
||||
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
|
||||
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
|
||||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
|
||||
SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6"
|
||||
@@ -1,33 +1,7 @@
|
||||
# The `CalculusWithJulia` package
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
To run the commands in these notes, some external packages must be installed and loaded.
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Getting started with Julia
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Julia interfaces
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Quick introduction to Calculus with Julia
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
The `Julia` programming language with a design that makes it well suited as a supplement for the learning of calculus, as this collection of notes is intended to illustrate.
|
||||
|
||||
|
||||
@@ -10,33 +10,7 @@ txt = """
|
||||
CalculusWithJulia.WeaveSupport.HTMLoutput(txt)
|
||||
```
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
# Calculus with Julia
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Usages of Unicode symbols
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
`Julia` allows the use of *Unicode* symbols to replace variable names and for function calls. Unicode operations are entered in this pattern `\name[tab]`. That is a slash, `\`, the name (e.g., `alpha`), and then a press of the `tab` key.
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Using Pluto
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
:::{.callout-note}
|
||||
## Note
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
[deps]
|
||||
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
|
||||
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
|
||||
IntervalArithmetic = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253"
|
||||
Measures = "442fdcdd-2543-5da2-b0f3-8c86c306513e"
|
||||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
|
||||
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
|
||||
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
|
||||
RealPolynomialRoots = "87be438c-38ae-47c4-9398-763eabe5c3be"
|
||||
Richardson = "708f8203-808e-40c0-ba2d-98a6953ed40d"
|
||||
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
|
||||
@@ -1,33 +1,7 @@
|
||||
# From calculator to computer
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Exponential and logarithmic functions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Functions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section will use the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# The Inverse of a Function
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
In this section we will use these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Overview of Julia commands
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Inequalities, Logical expressions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
In this section we use the following package:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Number systems
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# The Graph of a Function
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section will use the following packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Polynomials
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
In this section we use the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Roots of a polynomial
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
In this section we use the following add on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# The Polynomials package
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section will use the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Ranges and Sets
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Rational functions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Function manipulations
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
In this section we will use these add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Trigonometric functions
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
This section uses the following add-on packages:
|
||||
|
||||
|
||||
@@ -1,33 +1,7 @@
|
||||
# Variables
|
||||
|
||||
|
||||
```{julia}
|
||||
#| echo: false
|
||||
|
||||
import Logging
|
||||
Logging.disable_logging(Logging.Info) # or e.g. Logging.Info
|
||||
Logging.disable_logging(Logging.Warn)
|
||||
|
||||
import SymPy
|
||||
function Base.show(io::IO, ::MIME"text/html", x::T) where {T <: SymPy.SymbolicObject}
|
||||
println(io, "<span class=\"math-left-align\" style=\"padding-left: 4px; width:0; float:left;\"> ")
|
||||
println(io, "\\[")
|
||||
println(io, sympy.latex(x))
|
||||
println(io, "\\]")
|
||||
println(io, "</span>")
|
||||
end
|
||||
|
||||
# hack to work around issue
|
||||
import Markdown
|
||||
import CalculusWithJulia
|
||||
function CalculusWithJulia.WeaveSupport.ImageFile(d::Symbol, f::AbstractString, caption; kwargs...)
|
||||
nm = joinpath("..", string(d), f)
|
||||
u = ""
|
||||
Markdown.parse(u)
|
||||
end
|
||||
|
||||
nothing
|
||||
```
|
||||
{{< include ../_common_code.qmd >}}
|
||||
|
||||
## Assignment
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user