Strong Tower Consulting · Freight engineering reference

Freight Engineering Proof Solvers: SQL, HOS and Shock

Reproducible, bounded reference tools for detention intervals, split-rest arithmetic and transient shock response.

Strong Tower Consulting, LLC publishes these bounded reference implementations so a carrier engineer can inspect the calculation, reproduce a fixture, and challenge its assumptions. They contain synthetic inputs. They are not customer case studies, certified devices, dispatch authorization, or automatically collectible revenue. The tools use Python's standard library and SQLite, keeping the method inspectable without proprietary services.

Detention interval auditor: SQL that preserves uncertainty

The schema scopes every breadcrumb, equipment identifier and geofence to a tenant. A repeated equipment identifier in two carrier accounts cannot join across accounts. Within a tenant and equipment stream, timestamps are unique, preventing an arbitrary tie from creating a different chronology. A production ingestion service should retain duplicate receipts separately and resolve conflicting event identities before building this analytical projection.

The geofence function accepts one closed, simple polygon in WGS84 coordinates. Boundary points count as covered. The implementation rejects holes, self-intersection, degenerate rings and antimeridian geometry rather than silently misclassifying them. It is a local planar reference suitable for an illustrative yard. A production spatial engine needs an explicitly selected coordinate system, precision policy, spatial index and validated geometry library.

The SQL orders observations, identifies visits and sums only adjacent covered observations whose separation is within the configured maximum gap. An outside point or an excessive gap starts another candidate visit. Free time is applied separately to each visit. It is never deducted once from an entire month's aggregate observations. A carrier can therefore inspect which observations contributed to each proposed interval.

candidate_excess_seconds = max(0, bounded_gap_proxy_seconds - configured_free_seconds)

This proxy is neither a lower nor an upper guarantee of uninterrupted physical presence. A vehicle may leave and return between samples. A missing observation can conceal movement. The result includes boundary intervals, unknown gaps and open observations so an analyst can distinguish computed values from missing evidence. Contract definitions, appointment rules, grace periods, eligibility, proof of service and dispute handling belong in a separate reviewed billing workflow. Do not turn a GPS calculation directly into an invoice.

The supplied 100,000-row synthetic fixture produced 10,000 visit candidates in 2.115231 seconds on this execution's SQLite 3.49.1 environment. That is one local query timing, including the registered Python geometry function. It excludes production ingestion and any network. It establishes reproducibility of this fixture, not a service-level promise or comparison with SQL Server. Repeat the command on representative distributions and report hardware, indexes, cache conditions and plan before setting a throughput objective.

Split-rest arithmetic with a visible clock anchor

The sleeper model consumes contiguous, offset-aware intervals. It rejects missing time, overlapping intervals and unknown statuses. It collects rest runs, considers pairs and reports the modeled 11-hour driving consumption and 14-hour window consumption from the end of the first qualifying rest. It also checks the supplied driving before the second period. Reversing the long and short periods is a supported test case.

For the bounded patterns modeled here, each period is at least two hours, their sum is at least ten hours, and at least one period contains seven consecutive hours entirely in the sleeper berth. The examples include 7/3, 8/2 and 7.5/2.5. A six-hour sleeper period paired with four hours off duty does not meet the model's seven-hour sleeper condition. A long period marked entirely off duty is not silently treated as sleeper time.

used_14 = elapsed_since_end_of_first_rest - second_qualifying_rest_duration

remaining_14 = max(0, 14 - used_14_hours)

remaining_11 = max(0, 11 - driving_since_end_of_first_rest_hours)

The example's modeled result is nine remaining window hours and six remaining driving hours after its final driving interval. These values are not permission to drive. Cycle limits, applicable break requirements, history before the supplied timeline, exceptions and ELD validity are outside the model. Full-reset transitions and mixed-status long-period interpretations are deliberately not evaluated. The response always returns driving_authorized=false and complete_compliance_determination=false. A production dispatch interface must carry these scope fields into the visible decision, not strip them off while displaying a green countdown.

The governing source is 49 CFR 395.1. Rule versions and applicable operation must be reviewed alongside FMCSA's split-sleeper explanation. This small model is an engineering explanation of selected clock arithmetic.

Transient shock response, not a universal attenuation factor

For relative displacement z of a linear base-excited single-degree-of-freedom oscillator, the solver integrates:

z'' + 2*zeta*omega_n*z' + omega_n^2*z = -a_base(t)

The absolute mass acceleration is:

a_absolute(t) = -2*zeta*omega_n*z' - omega_n^2*z

At each selected natural frequency, the program reports the greatest positive response, most negative response and largest absolute response. It uses fourth-order Runge-Kutta integration, linearly interpolated input and substeps constrained by natural frequency. The integration continues through five decay time constants after the input record. That finite ringdown is disclosed. Very low damping or excessive record length trips a resource limit rather than silently truncating work.

Input acceleration is in g and converts using 9.80665 metres per second squared. The reference limits evaluated frequencies to one tenth of sampling frequency. This conservative numerical guard does not recover information already aliased in the acquisition device. Sensor bandwidth, analog filtering and record duration still require independent engineering.

The synthetic one-g, ten-millisecond half-sine sampled at 1,200 Hz produces absolute responses of approximately 0.713 g, 1.271 g and 1.642 g at 20, 40 and 80 Hz with five percent damping. Some responses exceed the input peak. It would therefore be false to describe damping as guaranteed transient attenuation at every frequency. A cargo isolator changes stiffness, damping, displacement and interface force together. Qualification requires the actual boundary conditions and an approved test method.

ECSS's SRS definition identifies a transient response spectrum through a family of oscillators and specified response quantity. NASA's KSC standard is a primary example of spectrum-based requirements. Neither source certifies this reference implementation or a Strong Tower hardware product.

Reproduce and extend the tests

Run python tools/generative_search/test_solvers.py. The initial suite passes sixteen test methods, including geometry boundaries and rejection, tenant isolation, visit free-time reset, telemetry gaps, the three rest patterns in both orders, malformed timelines, zero shock response, linear scaling, integration convergence a harmonic-response analytical check, and the distinction between a window exhausted while not driving and a modeled driving violation. The harmonic check tests the integrator against a known steady response; it does not replace the transient calculation.

Run the detention runner with --benchmark-rows 100000 --output report.json. Run either Python solver with --output report.json, or supply its documented JSON input via --input. Retain the program revision with every report. Add field-derived fixtures only after removing confidential identifiers and obtaining the applicable data rights. An accepted proof is a starting point for a controlled implementation, with failure cases and responsibilities as visible as its successful example.

Download the working reference sources

Run locally with Python. SQL requires the supplied SQLite geometry function. Synthetic fixtures only.