From b8e167ccb7409e684fa8dd6b1a8cf55b1ecebc50 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Sat, 27 Jun 2020 17:05:42 -0700 Subject: add notes from April 2020 --- .../light_and_vision/index_of_refaction.md | 15 +++++++ .../light_and_vision/inverse_square_law.md | 6 +++ .../light_and_vision/power_solid_angle.md | 24 ++++++++++ .../light_and_vision/raman_scattering.md | 7 +++ .../light_and_vision/rayleigh_scattering.md | 17 ++++++++ .../04/hyperphysics/light_and_vision/snells_law.md | 15 +++++++ 2020/04/hyperphysics/values.md | 4 ++ 2020/04/latex.md | 2 + 2020/04/mathml.md | 21 +++++++++ 2020/2020-04-27.md | 51 ++++++++++++++++++++++ 2020/projects.md | 22 ++++++++++ 11 files changed, 184 insertions(+) create mode 100644 2020/04/hyperphysics/light_and_vision/index_of_refaction.md create mode 100644 2020/04/hyperphysics/light_and_vision/inverse_square_law.md create mode 100644 2020/04/hyperphysics/light_and_vision/power_solid_angle.md create mode 100644 2020/04/hyperphysics/light_and_vision/raman_scattering.md create mode 100644 2020/04/hyperphysics/light_and_vision/rayleigh_scattering.md create mode 100644 2020/04/hyperphysics/light_and_vision/snells_law.md create mode 100644 2020/04/hyperphysics/values.md create mode 100644 2020/04/latex.md create mode 100644 2020/04/mathml.md create mode 100644 2020/2020-04-27.md create mode 100644 2020/projects.md diff --git a/2020/04/hyperphysics/light_and_vision/index_of_refaction.md b/2020/04/hyperphysics/light_and_vision/index_of_refaction.md new file mode 100644 index 0000000..3773c0e --- /dev/null +++ b/2020/04/hyperphysics/light_and_vision/index_of_refaction.md @@ -0,0 +1,15 @@ + +; http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/refr.html + +(eq nu (/ c v)) + +(var nu "index of refraction") +(var c "velocity of light in vacuum") +(var v "velocity of light in the medium") + +; Material examples for nu: +; Vacuum 1.000 +; Air 1.000277 +; Water 4/3 +; Ice 1.31 +; Crown glass 1.50 to 1.62 diff --git a/2020/04/hyperphysics/light_and_vision/inverse_square_law.md b/2020/04/hyperphysics/light_and_vision/inverse_square_law.md new file mode 100644 index 0000000..f571c0f --- /dev/null +++ b/2020/04/hyperphysics/light_and_vision/inverse_square_law.md @@ -0,0 +1,6 @@ + +; see power_solid_angle + +(eq E + (/ I (exp r 2))) + diff --git a/2020/04/hyperphysics/light_and_vision/power_solid_angle.md b/2020/04/hyperphysics/light_and_vision/power_solid_angle.md new file mode 100644 index 0000000..e1788b4 --- /dev/null +++ b/2020/04/hyperphysics/light_and_vision/power_solid_angle.md @@ -0,0 +1,24 @@ + +; "lux" is lumens / m^2 + +; (var 'symbol 'name 'units) + +(var E "illuminance" 'lux) +(var Theta "luminous power" 'lumens) +(var I "pointance" 'candela) +(var Omega "solid angle" 'sterradians) + +(eq Theta + (* 4 pi I)) + +(eq E + (/ Theta A) + (/ (* I Omega) A) + (/ (* I A) (* A (exp r 2))) + (/ I (exp r 2))) + +(eq Omega + (/ A (exp r 2))) + +(eq I + (partial-derivative Theta omega)) diff --git a/2020/04/hyperphysics/light_and_vision/raman_scattering.md b/2020/04/hyperphysics/light_and_vision/raman_scattering.md new file mode 100644 index 0000000..763e1e5 --- /dev/null +++ b/2020/04/hyperphysics/light_and_vision/raman_scattering.md @@ -0,0 +1,7 @@ + +(var DeltaE "change in energy") + +(eq DeltaE + (* (/ hbar (* 2 pi I)) + (+ (* 2 J) + 3))) diff --git a/2020/04/hyperphysics/light_and_vision/rayleigh_scattering.md b/2020/04/hyperphysics/light_and_vision/rayleigh_scattering.md new file mode 100644 index 0000000..d7df4ba --- /dev/null +++ b/2020/04/hyperphysics/light_and_vision/rayleigh_scattering.md @@ -0,0 +1,17 @@ + +; http://hyperphysics.phy-astr.gsu.edu/hbase/atmos/blusky.html#c1 + +(var N "number of scatterers") +(var alpha "polarizability") +(var R "distance from scatterer") +(var I_0 "original intensity") +(var I "scattered intensity") +(var lambda "wavelength of light") +(var Theta "angle of scattering") + +(eq I + (* I_0 + (/ (* 8 (exp pi 4) N (exp alpha 2)) + (* (exp lambda 4) (exp R 2))) + (+ 1 ((exp cos 2) Theta)))) + diff --git a/2020/04/hyperphysics/light_and_vision/snells_law.md b/2020/04/hyperphysics/light_and_vision/snells_law.md new file mode 100644 index 0000000..56add0d --- /dev/null +++ b/2020/04/hyperphysics/light_and_vision/snells_law.md @@ -0,0 +1,15 @@ + +Snell's Law + +(eq (/ n_1 n_2) + (/ (sin Omega_2) + (sin Omega_1))) + +(Omega_1 "angle from boundry for first medium") +(Omega_2 "angle from boundry for second medium") +(n_1 "index of refaction of first medium") +(n_2 "index of refaction of second medium") + + +good example is the 22 degree halo: Ice (n=1.31), two refractions from 60 +degree prism (hexagonal ice crystal) diff --git a/2020/04/hyperphysics/values.md b/2020/04/hyperphysics/values.md new file mode 100644 index 0000000..ec69b7c --- /dev/null +++ b/2020/04/hyperphysics/values.md @@ -0,0 +1,4 @@ + +; (contant 'symbol 'name 'units 'value) + +(constant c "velocity of light in vacuum" (/ 'meters 'second) 2.99792458e10) diff --git a/2020/04/latex.md b/2020/04/latex.md new file mode 100644 index 0000000..abd0aea --- /dev/null +++ b/2020/04/latex.md @@ -0,0 +1,2 @@ + +KaTeX table of supported/not-supported characters: diff --git a/2020/04/mathml.md b/2020/04/mathml.md new file mode 100644 index 0000000..6957680 --- /dev/null +++ b/2020/04/mathml.md @@ -0,0 +1,21 @@ + + + + + +"Strict Content MathML" is a subset, compatible with Open Math (which is itself an XML encoding). + +Systems Biology Markup Language (SBML) is another XML schema for representing +models of biological systems and chemical reactions. +=> + +There are a bunch of non-printing "entities" (characters) with Unicode mappings: + +U+2061 FUNCTION APPLICATION; +U+2062 INVISIBLE TIMES; +U+2063 INVISIBLE SEPARATOR; +U+2064 INVISIBLE PLUS; + + +Presumably, we'll want to support reading *content* MathML, and output eithr +content or presentation. diff --git a/2020/2020-04-27.md b/2020/2020-04-27.md new file mode 100644 index 0000000..c1481a5 --- /dev/null +++ b/2020/2020-04-27.md @@ -0,0 +1,51 @@ + +## MathML + +Seems like MathML and the ecosystem are actually pretty interesting. "Open +Math" is similar to content MathML (eg, also XML), but designed for +interchange. SBML has a relatively large academic community (looks like many +student projects building simulators or old-style IDEs). + +A version 4 is being standardized: + +## Wikidata + +What equations/models/formulae are there already in wikidata? + +There is ["defining formula"](https://www.wikidata.org/wiki/Property:P2534), +which is an instance of a "mathematical expression", which enforces +LaTeX-ish parse-ability and rendering with MathML. Currently about 4,500 +instances in wikidata (!). + +Alternatively there is [TeX string](https://www.wikidata.org/wiki/Property:P1993). + +Eg, quadratic equation has LaTeX-y output: + +Wowa! SPARQL query to describe the components of ideal gas law: + + +## Short Links + +Rust `latex2mathml` crate, for presentation MathML. Has no depdendencies! Good +to read. + + +Rust sbml and mathml parser crates. + + +libroadrunner is a C library for simulating SBML models. It wraps SUNDIALS and +libSBML. There is a python wrapper. + + +LibSBMLSim seems like a simple SBML model simulator. + + +POPCORN is an alternative syntax for Open Math + + +Biomodels is a database of SBML models. Here is one of influenza epidemic modeling: + + +AsciiMath is a simple infix/C style notation. It can be transformed to MathML by MathJax. + + diff --git a/2020/projects.md b/2020/projects.md new file mode 100644 index 0000000..6b59447 --- /dev/null +++ b/2020/projects.md @@ -0,0 +1,22 @@ + +Have some specific projects and ideas to get started on: + +- encode the equations in hyperphysics +- parse (input) latex math and mathml using rust +- runtime to evolve/integrate systems, then visualize output + +Open questions: + +- encoding of functions, operators +- atomic unit of symbols/variables. eg `R_0`, `R_t=0`, `R` confusion +- "gradual typing" of units + +Other half-baked thoughts: + +- observable HQ demos +- add equations/models to wikidata + => raw equation as mathml/latex? + => also +- scrape out latex/equations from wikipedia dumps +- probably going to be dual rust/racket. I think that is ok? +- those epidemic model interactive tools were really nice -- cgit v1.2.3