The transition toward decarbonized heating and cooling depends on heat pumps that can operate efficiently while responding to real-time grid signals. Traditional engineering practice fragments this challenge: sizing is done at static design points, transient behavior is simulated separately, and control strategies are developed independently. This separation creates inefficiencies and prevents true co-optimization of hardware and controls.
A new framework addresses this by building a completely differentiable model of vapor-compression cycles using automatic differentiation in JAX. The approach eliminates computationally expensive root-finding during simulation by pre-calculating thermodynamic properties on pressure-enthalpy manifolds derived from fundamental equations of state. This enables fast, continuous gradient calculations needed for optimization.
The framework automates machine sizing by inverting compressor displacement, expansion valve dimensions, and heat-exchanger tube counts simultaneously using four-point cycle synthesis. Critically, the same physics kernel serves both the transient simulator and the model predictive controller, eliminating the mismatch between assumed and actual equipment behavior—a common source of control suboptimality.
Validation against experimental data from mini-split units and utility-scale hardware-in-the-loop tests shows cooling capacity predictions within 7.37% mean absolute percentage error and on-period cooling errors under 1.6%. The framework's ability to generate gradients through the entire system enables hardware-control co-design, where equipment specifications and control strategies are optimized jointly rather than sequentially.
By providing an open-source foundation for automated thermal equipment synthesis and gradient-based optimization, this work removes barriers to deploying responsive heat pumps in grid-supporting roles. As electrification accelerates, such tools will be essential for matching equipment performance to dynamic grid requirements.



