Colophon
What is real here, and what is not.
A demonstration that overstates itself is worse than no demonstration. So: the physics and the protocol are real, and the plant they run against is a model. Here is the line, drawn precisely.
Real
The control law
The volt-var characteristic is the piecewise-linear droop from IEEE 1547-2018 clause 5.3.3, Category B defaults, with a PI trim and conditional-integration anti-windup. The dispatch state machine, the slew-rate limiter and the apparent-power clipping are all doing what their names say.
The complex-power algebra
S = P + jQ, |S| = √(P² + Q²), power factor, phase angle, the inverter capability circle Q_max = √(S² − P²), and the three-phase line-current relation. Ordinary electrical engineering, implemented rather than described.
The feeder voltage relation
ΔV/V ≈ (R·P + X·Q)/V², the linearised distribution voltage-drop approximation, with X/R = 3 and impedances in milliohms appropriate to a 480 V service at this scale. No fudge factor — an earlier draft had one, and a test killed it.
The Modbus codec
Big-endian 32-bit register pairs in twos complement, signed base-ten scale factors, the 125-register PDU limit on FC03, and exception codes 0x02 and 0x03 raised for the conditions that actually raise them.
The harmonic maths
The PULSE waveform is genuine Fourier synthesis over an odd-harmonic series, and the THD figure is Σ computed from those amplitudes, not a number chosen to look good.
The 4 Hz loop
A fixed-timestep accumulator, decoupled from requestAnimationFrame, with a catch-up clamp so a backgrounded tab cannot spiral. Rendering is still on rAF; time is not.
Simulated
The plant
There is no hardware on the other end of this. The 2 MW array, the 2 MWh battery and the building are a model running in your browser tab.
The weather and the load
Irradiance is a clear-sky half-sine raised to 1.25 for air mass, and the building demand is an hourly commercial profile with deterministic smooth noise on top. Both are plausible shapes, not measured data.
The site is a concept
Apparent Inc. did not commission this and has not seen it. The company facts, product names, quoted copy and the origin story are theirs, taken from their public site and reproduced faithfully. Everything else is mine.
Verification
86 tests, and the one that mattered.
The suite covers the power algebra, the droop curve’s monotonicity and continuity at every breakpoint, the dispatch state machine across all six modes, anti-windup under sustained saturation, the Modbus codec including negative 32-bit round-trips, and a full simulated day in which the inverter is asserted never to exceed its apparent-power rating.
One test paid for the rest. It asserts that switching reactive support off should move the voltage materially — at least a full percent of nominal. It failed. The feeder impedance had been set to a round number rather than a physical one, so reactive power barely moved the voltage at all, and the home page’s central demonstration was a shrug.
The fix was to derive the impedance from the actual service: 2 MW at 480 V is roughly 2,400 A, so the feeder is milliohms, not tens of milliohms. The assertion stayed as written. That is the whole discipline, in one commit.
it('is the difference between holding
the band and leaving it', () => {
const without = run(false);
const regulated = run(true);
// Unsupported: no vars, and the feeder
// sags out of ANSI C84.1 Range A.
expect(without.q).toBe(0);
expect(without.perUnit).toBeLessThan(0.95);
// Supported: vars injected, voltage held.
expect(regulated.q).toBeGreaterThan(0);
expect(regulated.perUnit).toBeGreaterThan(0.95);
// Worth at least a full percent of nominal.
expect(regulated.perUnit - without.perUnit)
.toBeGreaterThan(0.01);
});Built with
The stack.
- Framework
- SvelteKit 2 · Svelte 5 runes · TypeScript · statically prerendered
- Styling
- Tailwind v4 tokens · CSS scroll-driven animations · no runtime CSS-in-JS
- Simulation
- Plain TypeScript modules, no dependencies · Float64Array ring buffers
- Drawing
- Hand-written SVG paths · no charting library
- Tests
- Vitest · 86 tests · type-check clean at zero warnings
- Palette
- Derived from Apparent’s own logo — the hot and cold swooshes their copy describes as heat and cold in harmony, reassigned to active and reactive power