Physics-residual reinforcement learning for accurate multi-step temperature prediction of alkaline electrolyzers under renewable power
Organizations: Department of Computer Engineering, Jeju National University, Jeju, 63243, South Korea · Green Hydrogen Global Leading Research Center, Jeju National University, Jeju, 63243, South Korea · Department of Mechanical System Engineering, Jeju National University, Jeju, 63243, South Korea · Department of Computer Engineering, Major of Electronic Engineering, Food Tech Center (FTC), Jeju National University, Jeju, 63243, South Korea
Abstract
Alkaline water electrolysis is a key technology for low-emission hydrogen production from renewable electricity, and its variable-power operation requires accurate multi-step electrolyte outlet temperature prediction. Because each predicted value feeds into the next step, a predictor must minimize forecast error and limit the propagation of initial temperature-history differences. We propose physics-residual reinforcement learning (PR-RL), which adds a small reinforcement-learning residual to the state transition of a lumped alkaline electrolysis thermal balance. The residual is trained on the model's own predicted states, so each correction is evaluated by its effect on subsequent steps. A restricted feedback condition preserves the contraction of the physical transition, so initial temperature-history differences decay along the horizon. Evaluated on measured records from two alkaline electrolysis devices against five matched models, PR-RL achieves practical superiority or equivalence in short-term accuracy (mean root-mean-square error at 15 and 30 min horizons) while reducing the 120 min residual gain of an initial temperature-history difference by approximately 23-fold to over -fold relative to reinforcement-learning predictors without the physical transition. These results show that forecast correction and controlled propagation of initial temperature-history differences can be achieved together in one compact model, supporting dynamic operation of renewable-powered alkaline electrolyzers.
Figures & tables
| Dataset | Comparison model | Metric | PR-RL | Comparison | Difference | Simultaneous CI | Judgment |
|---|---|---|---|---|---|---|---|
| Brauns | Matched RL-only model | Maximum propagation gain | Superior | ||||
| Brauns | Matched RL-only model | residual gain | Superior | ||||
| Brauns | TD3-only model | Maximum propagation gain | Inferior | ||||
| Brauns | TD3-only model | residual gain | Superior | ||||
| PEACE | Matched RL-only model | Maximum propagation gain | Superior | ||||
| PEACE | Matched RL-only model | residual gain | Superior |
| Dataset | Comparison model | Seeds | PR-RL | Comparison | Difference | Simultaneous CI | Practical | Statistical |
| (a) Short-term error score ( ) | ||||||||
| Brauns | Physics-based model | 20 | 0.1746 | 0.2976 | Superior | Superior | ||
| Brauns | Physics + supervised residual MLP | 20 | 0.1746 | 0.2980 | Superior | Superior | ||
| Brauns | Physics + Random Forest residual | 20 | 0.1746 | 0.2999 | Superior | Superior | ||
| Brauns | Matched RL-only model | 20 | 0.1746 | 0.1174 | Equivalent | Inferior | ||
| Brauns | TD3-only model | 20 | 0.1746 | 0.2835 | Superior | Superior | ||
| Brauns | PEACE | |
|---|---|---|
| Device | Pressurized single-cell alkaline electrolysis system | Pressurized three-cell short stack |
| Electrolyte | 32 wt% KOH | 30 wt% KOH |
| Data source | Brauns and Turek, Zenodo [ 21 ] | PEACE project, Zenodo [ 22 ] |
| Records used | Four operating records from 2021 (sessions 1–4: June 19, June 22, June 29, July 5) | Three experiments (1–3) |
| Total duration | About | About |
| Native logging interval | About , with occasional gaps (resampled to ) a |
| Model | Physical transition , equation ( 2 ) | Learned component | Learning target or signal; gradient path | Damping projection a | Comparison with PR-RL isolates |
|---|---|---|---|---|---|
| PR-RL (proposed) | Shared identified parameters | Reinforcement-learning residual policy (13–64–64–1) | Reward from subsequent prediction errors on self-predicted states (up to ); numerical action-value gradient, policy-network backpropagation only, physics not differentiated | Applied | — |
| Physics-based model | Shared identified parameters | None | — | Not applicable | Effect of the residual correction (contribution of the learned residual) |
| Physics + supervised residual MLP | Shared identified parameters | Supervised residual MLP (identical 13–64–64–1) | Direct regression of the measured one-step residual b ; backpropagation of the one-step loss, physics not differentiated | Applied (identical) | Effect of the learning scheme (sequential reward versus one-step regression) |
| Physics + Random Forest residual | Shared identified parameters | Random Forest (300 trees, minimum leaf size 3) | Direct regression of the measured one-step residual; tree ensemble, no gradients | Not applicable to trees | Non-neural reference |
| Matched RL-only model | None (no physical transition) | Policy network predicting the full temperature change (13–64–64–1) | Same reward signal as PR-RL, applied to the full temperature change; gradient path same as PR-RL | Not applicable (no physical transition) | Contribution of the physics-based structure (physical transition with bounded, projected residual) |
| TD3-only model | None (no physical transition) | Policy network predicting the full temperature change (identical 13–64–64–1); two critics used only during training | Same reward signal, optimized with TD3 (two critics, delayed policy updates, target-policy smoothing) instead of the numerical action-value gradient | Not applicable (no physical transition) | Comparison with a representative actor–critic learning algorithm |
| Item | Value |
|---|---|
| Network architecture | |
| Residual policy network | fully connected, 13–64–64–1 (5,121 parameters) |
| Residual output bound | , with clipped to 0.05\text{,}\mathrm{\SIUnitSymbolCelsius}2.00\text{,}\mathrm{\SIUnitSymbolCelsius} , where is the 99th percentile of the absolute measured one-step residuals over all consecutive training pairs |
| Output range of the predictors without the physical transition | by the same rule, applied to the measured one-step temperature changes of the training records; shared by the matched RL-only and TD3-only models |
| Input normalization | present values standardized by the training mean and standard deviation of each variable; the nine change inputs divided by the standard deviation of the underlying variable, without centering; standard deviations floored at ( , ), ( ), and ( ) |
| Training of the residual policy | |
| Held-out session | , PR-RL | , supervised MLP | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Brauns, session 1 | 25.75 | 162.0 | 50.0 | 0.342 | 0.343 | 0.93421 | 0.8 | 0.98684 | 0.98684 | 0.93421 | |
| Brauns, session 2 | 602.9 | 4958 | 50.0 | 0.352 | 0.353 | 0.96719 | 0.5 | 0.98359 | 0.98359 | 0.96719–0.98359 | |
| Brauns, session 3 | 23.64 | 172.1 | 50.0 | 0.379 | 0.373 | 0.91395 | 0.8 | 0.98279 | 0.98279 | 0.91395–0.98279 | |
| Brauns, session 4 | 23.64 | 172.1 | 50.0 | 0.379 | 0.373 | 0.91395 | 0.8 | 0.98279 | 0.98279 | 0.91395–0.98279 | |
| PEACE, experiment 1 | 0.0352 | 88.24 | 1.088 | 2.000 | 0.82189 | 0.8 | 0.96438 | 0.96438 | 0.82189–0.96438 | ||
| PEACE, experiment 2 | 30.40 | 68.86 | 19.8 | 2.000 | 2.000 | 0.77525 | 0.8 | 0.95505 | 0.95505 | 0.77525–0.95505 |
| Methodological aspect | Related approach | PR-RL design and rationale | Contribution and supporting evidence in this study |
|---|---|---|---|
| Role of the learned residual action | Residual RL adjusts the current commands of an economic MPC for PEM electrolyzer fleets [ 18 ] , following the residual RL concept of robot control [ 19 ] : the learned action changes the plant input. | The residual action corrects the next predicted temperature of the AEL thermal balance; it changes the predicted temperature history that enters the subsequent policy inputs, not any input of the physical plant (the ‘PR-RL: reinforcement-learning residual policy’ section of Methods). | Establishes the prediction-oriented role of residual learning in this study: forecast correction instead of operating-command adjustment (the ‘Prediction task and datasets’ and ‘PR-RL: reinforcement-learning residual policy’ sections of Methods). |
| Measurements within the prediction horizon | RL-based state estimation updates a model-based state estimate from incoming sensor measurements [ 20 ] . | After initialization from the measured temperature history, PR-RL predicts recursively without further temperature measurements within the horizon; future measured temperatures serve only as training rewards and evaluation references. | Matches the forecasting setting of this study, in which no temperature measurements arrive during the prediction horizon (the ‘Prediction task and datasets’ and ‘Evaluation metrics’ sections of Methods). |
| Learning signal and visited states | Supervised residual regression fits measured residuals at measured states [ 13 , 14 , 15 ] ; models trained on one-step targets can behave differently when their own predictions are fed back [ 6 ] . | The residual policy is trained on the model’s own predicted states with a reward formed from the subsequent prediction errors (equation ( 4 )), so each correction is evaluated together with its effects on the later predictions. | Contribution of the reinforcement-learned residual: with identical physics, inputs, architecture, and damping projection, PR-RL is practically superior to the supervised residual MLP on Brauns and practically equivalent on PEACE in and P95 (Table 2 ). |
| Policy training procedure | Actor–critic algorithms such as TD3 fit critic networks to guide the policy update [ 25 ] . | The scalar residual action is evaluated directly from perturbed rollouts against the same measured temperatures, and finite differences estimate the action-value gradient (equations ( 4 )–( 6 )); no critic is fitted, and the physical transition is not differentiated. | The matched RL-only model shares this procedure and isolates the physics-based structure; the TD3-only model extends the comparison to a representative actor–critic algorithm (the ‘Comparison models’ section of Methods). |
| Damping of initial temperature-history differences | Contraction conditions constrain learned recurrent models [ 16 ] . | The identified thermal transition supplies the contraction factor , and the projection limits the sensitivity of the residual to the temperature history ( ), so that holds throughout training (the ‘Damping of initial temperature-history differences’ section of Methods). | Contribution of the physical transition: all 140 main-cohort PR-RL models and all 140 identically constrained supervised MLP models satisfy the condition (Supplementary Note 2 ), so the damping is a structural property of the design. |
| Joint accuracy and damping | A predictor without the physical transition learns the full temperature change and is not covered by the damping condition (the ‘Comparison models’ section of Methods). | One physical transition and one small residual policy provide forecast correction and damping together, and both properties are evaluated with the same trained weights in every condition and seed. | Contribution of the combination: non-inferior at the margin and a lower residual gain relative to both predictors without the physical transition on both datasets (Fig. 3 , Tables 1 and 2 ). |
| Judgment | Decision rule |
|---|---|
| Error metrics and P95, margin a | |
| Practical superiority | |
| Practical equivalence | and |
| Practical inferiority | |
| Undecided | none of the above |
| Non-inferiority (recorded separately) | |
| Metric | Cohort | Seeds | PR-RL | Supervised MLP | Difference | Simultaneous CI | Practical judgment |
|---|---|---|---|---|---|---|---|
| First | 20 | 3.7616 | 3.6813 | Undecided | |||
| Confirmation | 400 | 3.7572 | 3.7040 | Equivalent | |||
| P95 | First | 20 | 8.4861 | 8.4244 | Undecided | ||
| P95 | Confirmation | 400 | 8.4800 | 8.4460 | Equivalent |
| Dataset, comparison model | Metric | Difference | Unadjusted 95% | Bootstrap | Simultaneous |
|---|---|---|---|---|---|
| Brauns, physics-based model | |||||
| Brauns, physics + supervised MLP | |||||
| Brauns, physics + Random Forest | |||||
| Brauns, matched RL-only model | |||||
| Brauns, TD3-only model | |||||
| PEACE, physics-based model |
| Cohort | Runs | Supervised MLP | PR-RL |
|---|---|---|---|
| Brauns, main | 80 | 57 (71.25%) | 0 (0%) |
| PEACE, main | 60 | 26 (43.33%) | 18 (30.00%) |
| PEACE, confirmation | 1,200 | 475 (39.58%) | 379 (31.58%) |
| Analysis | Projection | Model | Runs | Start points per seed | P95 | |
|---|---|---|---|---|---|---|
| Low-to-high load, Brauns | Not applied | PR-RL | 12 | 384 | 0.3103 | 0.4830 |
| Physics-based model | 12 | 384 | 0.3115 | 0.4850 | ||
| Physics + supervised MLP | 12 | 384 | 0.5274 | 0.7115 | ||
| Physics + Random Forest | 12 | 384 | 0.2756 | 0.4627 | ||
| Matched RL-only model | 12 | 384 | 0.2501 | 0.4316 | ||
| Low-to-high load, Brauns | Applied | PR-RL | 12 | 384 | 0.3311 | 0.5063 |
| Training inputs | Physics identification | Dataset | Start points per seed | PR-RL | Physics | Supervised MLP | Random Forest | Matched RL-only |
|---|---|---|---|---|---|---|---|---|
| Held at start values | As in the main analysis | Brauns | 90 | 1.7154 | 1.6767 | 1.7104 | 1.4309 | 0.1458 |
| PEACE | 2 | 3.2269 | 3.3336 | 3.4048 | 3.4645 | 2.2997 | ||
| Measured future inputs | As in the main analysis | Brauns | 90 | 1.7189 | 1.6767 | 1.7104 | 1.4309 | 0.1683 |
| PEACE | 2 | 3.1971 | 3.3336 | 3.4048 | 3.4645 | 2.2997 | ||
| Equal mixture | As in the main analysis | Brauns | 90 | 1.7490 | 1.6767 | 1.7104 | 1.4309 | 0.1550 |
| PEACE | 2 | 3.1615 | 3.3336 | 3.4048 | 3.4645 | 2.2997 |
| Transfer direction | Model | P95 | |
|---|---|---|---|
| Brauns PEACE | PR-RL | 4.7002 | 9.1554 |
| Physics-based model | 3.5202 | 6.7272 | |
| Physics + supervised MLP | 4.2286 | 8.7646 | |
| Physics + Random Forest | 3.5208 | 6.7337 | |
| Matched RL-only model | 9.4041 | 17.1314 | |
| PEACE Brauns | PR-RL | 10.7305 | 11.2613 |
| Brauns PEACE | PEACE Brauns | |||||||
|---|---|---|---|---|---|---|---|---|
| Training inputs | Physics identification | Validation inputs | PR-RL | Physics | Matched RL-only | PR-RL | Physics | Matched RL-only |
| Held at start values | As in the main analysis | Held | 4.7002 | 3.5202 | 9.4041 | 10.7305 | 10.6563 | 1.2045 |
| Measured future inputs | As in the main analysis | Held | 4.2840 | 3.5202 | 5.7662 | 10.9707 | 10.6563 | 24.2222 |
| Measured future inputs | Multi-step fit on measured inputs | Measured | 6.8746 | 6.3878 | 7.2830 | 2.4602 | 6.3915 | 22.3208 |
| Measured future inputs | Multi-step fit on measured inputs | Hybrid | 6.8746 | 6.3878 | 8.8790 | 2.7350 | 6.3915 | 22.6533 |
| Held at start values | Fixed boundary, measured inputs | Held | 7.4733 | 7.1521 | 9.4041 | 1.3946 | 1.1151 | 1.2045 |
| Dataset | Horizon ( ) | PR-RL | Matched RL-only | Difference | Simultaneous CI | Practical | Statistical; NI |
|---|---|---|---|---|---|---|---|
| Brauns | 60 | 0.3711 | 0.3512 | Equivalent | Inferior; NI | ||
| Brauns | 90 | 0.3203 | 0.4165 | Undecided | Superior; NI | ||
| Brauns | 120 | 0.3631 | 0.5117 | Undecided | Superior; NI | ||
| PEACE | 60 | 5.7031 | 5.8505 | Undecided | Undecided; NI | ||
| PEACE | 90 | 5.9024 | 5.5757 | Undecided | Inferior; NI not confirmed | ||
| PEACE | 120 | 4.3784 | 4.1186 | Undecided | Inferior; NI not confirmed |
| Dataset | Horizon ( ) | PR-RL | Matched RL-only |
|---|---|---|---|
| Brauns | 60 | 0.3745 | 0.3323 |
| Brauns | 90 | 0.3179 | 0.4524 |
| Brauns | 120 | 0.3603 | 0.5845 |
| PEACE | 60 | 5.7514 | 5.9662 |
| PEACE | 90 | 5.9765 | 5.6263 |
| PEACE | 120 | 4.4464 | 4.3141 |