Shoddy Documentation

The Physics Atlas

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.

High school: constants, statics, trajectories

The curriculum asks forThe tree answers with
Algebra on formulas — solve F = ma for anythingalg: AlgParse, AlgSolve, and AlgToFn to turn the rearranged formula into a function value
Quadratics for time of flight under gravityalg symbolically, or eng's polynomial words numerically
Right-triangle trigonometry, resolving vectorsthe Sin/Cos/Atn2 builtins — words built into the language itself — with math's Rad/Deg/Hypot/Angle
Dimensional analysis and unit conversioneng's unit system: EngUnit, EngConvert, which refuses to convert a length into a mass
Physical constantseng's constants table

Lower-division: calculus-based mechanics and circuits

The curriculum asks forThe tree answers with
Derivatives and definite integrals, symbolicalg: differentiation, the bounded integrator, Taylor series for the small-angle pendulum
Derivatives and definite integrals, numericeng: EngDeriv, EngIntegrate — work as the area under a force curve
Systems of linear equations — Kirchhoff's circuit lawsmatrix + lin: LinSolve, which refuses a singular system — one with no single solution — rather than misleading
Dot and cross products — work, torque, angular momentummatrix'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, drivingeng: 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 trialsrandom, with math's Seed once in Main for a reproducible run
Where the planets actually areephemeris — Kepler's equation solved for real bodies, checkable against tonight's sky

Upper-division: what the map deliberately stops short of

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.

The worked example: a damped, driven oscillator

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 plotterEngOdeSolve 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.