Shoddy Documentation
A physics curriculum mapped onto the machines, tier by tier
There is no physics.shoddy, on purpose. The mathematics a
physics course uses is already owned, machine by machine, across the
mathematical family. A physics machine would therefore re-own words a dozen
machines already publish — the largest available act of disjointedness in a
tree that keeps refusing second spellings. What a student or a modeller needs
instead is the map: for each thing the curriculum asks for, which machine
answers, and with what words. This page is that map. It closes with one
worked example, at the level where the family genuinely had a gap until
EngOde filled it.
| The curriculum asks for | The tree answers with |
|---|---|
Algebra on formulas — solve F = ma for anything | alg: AlgParse, AlgSolve, and AlgToFn to turn the rearranged formula into a function value |
| Quadratics for time of flight under gravity | alg symbolically, or eng's polynomial words numerically |
| Right-triangle trigonometry, resolving vectors | the Sin/Cos/Atn2 builtins — words built into the language itself — with math's Rad/Deg/Hypot/Angle |
| Dimensional analysis and unit conversion | eng's unit system: EngUnit, EngConvert, which refuses to convert a length into a mass |
| Physical constants | eng's constants table |
| The curriculum asks for | The tree answers with |
|---|---|
| Derivatives and definite integrals, symbolic | alg: differentiation, the bounded integrator, Taylor series for the small-angle pendulum |
| Derivatives and definite integrals, numeric | eng: EngDeriv, EngIntegrate — work as the area under a force curve |
| Systems of linear equations — Kirchhoff's circuit laws | matrix + lin: LinSolve, which refuses a singular system — one with no single solution — rather than misleading |
| Dot and cross products — work, torque, angular momentum | matrix's Dot and lin's LinCross |
| First-order ODEs, symbolic — decay, drag, RC circuits (an ODE is an ordinary differential equation: one linking a quantity to its own rate of change) | alg's first-order ODE words |
| Any ODE, numeric — oscillators, damping, driving | eng: EngOdeStep, EngOdeSolve, and the Sys pair for second-order equations — the worked example below |
| Simulation and Monte Carlo — answering a question by running many random trials | random, with math's Seed once in Main for a reproducible run |
| Where the planets actually are | ephemeris — Kepler's equation solved for real bodies, checkable against tonight's sky |
Fourier transforms, Bessel and Legendre functions, partial differential
equations, contour integration and Dirac notation serve the quantum
mechanics and electrodynamics courses. They sit past what a
Number-only classroom library honestly reaches. The boundary is
drawn here rather than left to be discovered. Probability and statistics run
out through stats and eng's distributions.
Error propagation runs through EngDeriv. The rest waits until a
mill — a complete Shoddy program — actually
wants it.
A second-order equation — one that involves a rate of change of a rate of
change, like acceleration — can be rewritten as a pair of first-order
equations. That pair is what EngOdeSysAt is for: the state is
{ y, y′ } and the derivative hands back
{ y′, y″ }. Here is a mass on a spring with damping
c and a sinusoidal drive — a push that varies like a sine
wave:
Include "eng.shoddy"
Include "seq.shoddy"
Rem y'' = -k y - c y' + A sin(w t), as the pair { y, y' }.
Def Oscillator(t As Number, s As List Of Number) As List Of Number
{ Nth(s, 2), 0 - 4 * Nth(s, 1) - 0.4 * Nth(s, 2) + Sin(2 * t) }
Def Main()
Rem Released from rest at y = 1, integrated across ten seconds.
Let final = EngOdeSysAt(Oscillator, 0, { 1, 0 }, 10, 1000)
Print(Nth(final, 1)) ' where it is
Print(Nth(final, 2)) ' how fast it is moving
Rem The undriven, undamped case checks itself against the closed
Rem form: after one full period the state comes home.
Let period = EngOdeSysAt(Fn(t, s) => { Nth(s, 2), 0 - Nth(s, 1) },
0, { 1, 0 }, 2 * Pi(), 400)
Print(Nth(period, 1)) ' 1.0000...
Print(Nth(period, 2)) ' 0.0000...
Run it with build.ps1 run FILE.shoddy. For a plot, feed the
scalar form's trajectory to plotter —
EngOdeSolve answers one value per sample point for exactly that
reason.
The family design behind this page — the eleven clauses and the layer map — is the charter.