Invntr
Source

All instruments

pendulum

Rigid pendulum released from rest at any amplitude, with optional viscous damping: exact period by the arithmetic-geometric mean (T/T0 = 1/AGM(1, cos(a/2))), the error of the small-angle formula and the amplitude up to which it holds, an RK4 time history with its period, energy drift, speed and rod tension at the bottom, and the measured decay rate of the swing. Writes trace.csv and peaks.csv.

Field
Dynamics and control
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.05 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replaypendulum 0.1.0 · files 5a7c2bd08f68…66a6
  1. r0001small-angle formula T0 = 2 pi sqrt(L/g): L = 0.25 m with g = pi^2 m/s^2 is exactly 1 s; at 0.1 deg the ratio is the textbook series 1 + a^2/16 + 11 a^4/3072 = 1.00000019038592 (closed forms, 1e-9)passed

    small_angle_period_s1 ± 1e-091lockedunder 0.01 % of the tolerance used
    period_ratio1 ± 1e-091lockedunder 0.01 % of the tolerance used
    natural_frequency_rad_per_s6.28319 ± 6.3e-096.28319lockedunder 0.01 % of the tolerance used
  2. r000290 deg: T/T0 = 2K(1/sqrt 2)/pi = Gamma(1/4)^2 / (2 pi^1.5) = 1.1803405990161 (lemniscate case; Abramowitz & Stegun table 17.1, K(45 deg) = 1.85407467730137); small-angle error 1/1.18034 - 1 = -15.2787 %; closed forms, 1e-9passed

    period_ratio1.18034 ± 1.2e-091.18034lockedunder 0.01 % of the tolerance used
    exact_period_s2.36825 ± 2.4e-092.36825lockedunder 0.01 % of the tolerance used
    small_angle_error_pct-15.2787 ± 1.5e-07-15.2787lockedunder 0.01 % of the tolerance used
    small_angle_ok= falsefalselockedexact match
  3. r000360 deg: T/T0 = 2K(1/2)/pi = 1.0731820071494 (Abramowitz & Stegun table 17.1, K(30 deg) = 1.68575035481260; checked by the power series in k^2); closed form, 1e-9passed

    period_ratio1.07318 ± 1.1e-091.07318lockedunder 0.01 % of the tolerance used
  4. r0004120 deg: T/T0 = 2K(sin 60 deg)/pi = 1.3728805006183 (Abramowitz & Stegun table 17.1, K(60 deg) = 2.15651564749964); closed form, 1e-9passed

    period_ratio1.37288 ± 1.4e-091.37288lockedunder 0.01 % of the tolerance used
  5. r0005RK4 against exact answers, release from horizontal with L = g so T0 = 2 pi: period 2 pi x 1.18034059901610 = 7.41629870920549 s, bottom speed sqrt(2 g L) = g sqrt 2, rod tension 3 x weight, energy conserved. RK4 at 2000 steps per period has a global error near (w h)^4 = 2e-10, so 1e-7 on the readings and 1e-8 on the energy driftpassed

    small_angle_period_s6.28319 ± 6.3e-096.28319lockedunder 0.01 % of the tolerance used
    rk4_period_s7.4163 ± 7.4e-077.4163lockedunder 0.01 % of the tolerance used
    rk4_period_rel_error≤ 1e-076.97125e-13lockedinside the range
    bottom_speed_m_per_s13.8687 ± 1.4e-0813.8687lockedunder 0.01 % of the tolerance used
    rk4_bottom_speed_m_per_s13.8687 ± 1.4e-0613.8687lockedunder 0.01 % of the tolerance used
    bottom_tension_over_weight3 ± 3e-073lockedunder 0.01 % of the tolerance used
    energy_initial_J_per_kg96.1704 ± 9.6e-0896.1704lockedunder 0.01 % of the tolerance used
    energy_drift_rel≤ 1e-081.08003e-12lockedinside the range
    energy_final_fraction1 ± 1e-081lockedunder 0.01 % of the tolerance used
  6. r0006light damping, linear theory: zeta = 0.02 with w0 = 1 rad/s gives an envelope exp(-zeta w0 t), so decay rate 0.02 /s, period 2 pi / sqrt(1 - zeta^2) = 6.28444232135785 s, amplitude ratio per cycle exp(-2 pi zeta / sqrt(1 - zeta^2)) = 0.881889207074743. Run at 0.1 deg, where sin(theta) differs from theta by a^2/6 = 5e-7, hence 2e-6passed

    decay_rate_per_s0.02 ± 4e-080.02locked3 % of the tolerance used
    decay_rate_theory_per_s0.02 ± 2e-110.02lockedunder 0.01 % of the tolerance used
    damping_ratio_measured0.02 ± 4e-080.02locked3 % of the tolerance used
    rk4_period_s6.28444 ± 1.3e-056.28444locked3.4 % of the tolerance used
    damped_period_small_angle_s6.28444 ± 6.3e-096.28444lockedunder 0.01 % of the tolerance used
    amplitude_ratio_per_cycle0.881889 ± 1.8e-060.881889locked0.81 % of the tolerance used
    half_amplitude_time_s34.6574 ± 6.9e-0534.6574locked3 % of the tolerance used
    quality_factor25 ± 2.5e-0825lockedunder 0.01 % of the tolerance used
  7. r0007where the small-angle formula stops being good: by the series T/T0 = 1 + a^2/16 + 11 a^4/3072, so T0/T = 1 - a^2/16 + a^4/3072, a period error of 1e-4 % is reached at a = 0.004 rad x (1 + 4e-8) = 0.2291831276 deg; 10 deg (error about a^2/16 = 0.19 %) is outside that tolerance; series truncation is below 1e-9 here, 1e-6passed

    small_angle_limit_deg0.229183 ± 2.3e-070.229183lockedunder 0.01 % of the tolerance used
    small_angle_ok= falsefalselockedexact match
  8. r0008critical damping and beyond does not swing: zeta = 2 gives no zero crossing, so no period (null) and energy only falls (final fraction below 1)passed

    turning_points= 11lockedexact match
    energy_final_fraction0 to 14.89088e-05lockedinside the range
    quality_factor0.25 ± 2.5e-100.25lockedunder 0.01 % of the tolerance used
8 of 8 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
length_mm1.0Pivot to the centre of the bob (point mass on a massless rigid rod).
gravity_m_per_s2m/s^29.80665Local gravity. Default is standard gravity (exact by definition).
amplitude_degdeg30.0Release angle from the hanging position; released from rest.
damping_ratio10.0Fraction of critical damping zeta in theta'' + 2 zeta w0 theta' + w0^2 sin(theta) = 0. 0 is no damping.
periods110Length of the time history, in exact undamped periods at this amplitude.
steps_per_period12000RK4 steps in one exact period.
small_angle_tolerance_pct%1.0Period error accepted from T0 = 2 pi sqrt(L/g); sets the verdict and small_angle_limit_deg.

Readings

NameUnitMeaning
small_angle_period_ssT0 = 2 pi sqrt(L/g).
exact_period_ssUndamped period at this amplitude, T0 / AGM(1, cos(a/2)).
period_ratio1T / T0 = 2 K(sin(a/2)) / pi.
small_angle_error_pct%(T0 - T) / T: negative, the small-angle formula reads short.
small_angle_oktrue when the error is within small_angle_tolerance_pct.
small_angle_limit_degdegLargest amplitude at which T0 stays within the tolerance.
natural_frequency_rad_per_srad/sw0 = sqrt(g/L).
rk4_period_ssMean period of the time history, from its zero crossings; null when it never swings through.
rk4_period_rel_error1|RK4 period - exact| / exact, no damping only.
energy_initial_J_per_kgJ/kgg L (1 - cos a).
energy_drift_rel1Largest |E - E0| / E0 over the history, no damping only.
energy_final_fraction1E at the end over E at release.
bottom_speed_m_per_sm/ssqrt(2 g L (1 - cos a)): no damping, closed form.
rk4_bottom_speed_m_per_sm/sBob speed at the first pass through the bottom, from the time history (with damping).
bottom_tension_over_weight1Rod tension over the bob's weight at the first pass through the bottom, 1 + v^2 / (g L).
decay_rate_per_s1/sMeasured: ln(first amplitude / last turning point) / time between them. Null without damping.
decay_rate_theory_per_s1/szeta w0, the small-angle envelope rate.
damping_ratio_measured1decay_rate_per_s / w0.
amplitude_ratio_per_cycle1Amplitude after one cycle over the amplitude before, from the measured rate and period.
half_amplitude_time_ssln 2 / measured decay rate.
damped_period_small_angle_ssT0 / sqrt(1 - zeta^2).
quality_factor11 / (2 zeta).
amplitude_final_degdegSize of the last turning point in the history.
turning_points1
steps1
step_ss
duration_ss
warningsPlain-word cautions.
trace_fileout/trace.csv: t_s, theta_deg, omega_rad_per_s, energy_J_per_kg (at most about 4000 rows).
peaks_fileout/peaks.csv: t_s, theta_deg, amplitude_deg at every turning point.

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call