Accelerating the electrification of thermal energy requires vapor-compression heat pumps capable of dynamic, grid-responsive operation. However, equipment engineering remains fragmented across static rating-point selection, stiff multi-phase transient simulation, and gradient-based optimal control. Here, we present an end-to-end differentiable, finite-volume vapor-compression framework implemented natively in JAX that automates machine sizing directly from stated thermal duties and unifies dynamic simulation with predictive control under a single compiled residual y˙=f(t,y,u). Thermodynamic evaluations bypass runtime root-finding via bilinear (p,h)
Nearby in the stack
manifolds pre-flashed from Helmholtz equations of state, enabling analytical forward-mode automatic differentiation. Mass conservation across multi-phase coils is strictly preserved by incorporating both
(∂ρ/∂p)h
and
(∂ρ/∂h)p
partial derivatives into the dynamic pressure differential equation. The sizer directly inverts compressor displacement, electronic expansion valve area, and heat-exchanger tube counts via four-point cycle synthesis and
ε
-NTU matching using the identical polytropic compressor map. Crucially, the compiled physics kernel is shared symmetrically between
L
-stable TR-BDF2 stiff integration and implicit-Euler Model Predictive Control (MPC), eliminating plant-controller surrogate mismatch. Validated against open-access experimental benchmarks without parameter fitting, the framework predicts cooling capacity with
7.37%
MAPE across 16 mini-split operational runs and bounds on-period cooling error within
1.19%
--
1.62%
on utility-scale Hardware-in-the-Loop traces. This work provides an open-source, differentiable foundation for automated machine synthesis, dynamic grid orchestration, and gradient-based hardware-control co-design.