Time-Resolved Analysis of Photovoltaic–Building Energy Matching Using Dynamic Time Warping
Abstract
1. Introduction
- Energy-aggregated indicators, such as self-consumption and self-sufficiency ratios, which quantify overall energy balance but ignore temporal ordering.
- Time-of-use and coincidence metrics, which partially incorporate timing by measuring overlap within predefined windows but do not preserve profile structure.
- State-based and clustering methods, which identify typical operating regimes from instantaneous power relationships while neglecting sequential dynamics.
- Conventional time-series similarity measures (e.g., Euclidean distance, correlation), which require strict temporal alignment and are sensitive to time shifts.
- Feature-based and transform-domain methods, which compare global shape characteristics but often lose direct time-domain interpretability.
- Elastic alignment techniques such as Dynamic Time Warping, which allow nonlinear temporal alignment of daily profiles but are commonly reduced to scalar distance measures.
2. Materials and Methods
3. Results
3.1. DTW Cost Matrix and Optimal Warping Paths
3.2. Daily Analysis
3.3. Monthly Analysis
4. Discussion
4.1. Interpretation of Temporal Structures in PV–Building Matching
4.2. DTW Versus State-Based and Aggregated Approaches
4.3. Role of Warping Paths and Cost Accumulation
4.4. Implications for Energy Management and System Design
4.5. Methodological Considerations and Limitations
4.6. Relation to Existing Literature and Novelty
4.7. Outlook: From Monthly to Annual Temporal Structures
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Appendix A
| Algorithm A1. DTW-based analysis of PV generation and building demand profiles |
| Input: |
| P(t)—photovoltaic power time series sampled at Δt = 15 min |
| L(t)—building load power time series sampled at Δt = 15 min |
| D—set of days in the analyzed period |
| Output: |
| M—DTW distance matrix between daily PV and load profiles |
| C—clusters of days representing distinct operating regimes |
| Step 1: |
| Step 1: Data preprocessing |
| For each day d ∈ D: |
| Extract daily PV profile P_d = {P(t)} for t ∈ d |
| Extract daily load profile L_d = {L(t)} for t ∈ d |
| Step 2: Construction of daily mismatch signature |
| S_d(t) = P_d(t) − L_d(t) |
| Normalization of S_d |
| Compute DTW(S_d_i, S_d_j) for all pairs of days |
| Step 3: Distance matrix construction |
| Construct DTW distance matrix M containing distances DTW(S_d_i, S_d_j) for all pairs of days in D |
| Step 4: Clustering |
| Apply hierarchical clustering to matrix M |
| Determine a meaningful number of clusters based on expert-driven interpretability |
| Assign each day d ∈ D to a cluster C_k |
| Step 5: Interpretation |
| Analyze cluster-specific temporal patterns |
| Identify characteristic PV–load matching regimes and temporal mismatch structures |
| Return: |
| Distance matrix M and cluster assignments C |
References
- Tao, L.; Yang, M.; Shan, S.; Wang, X.; Wang, Y.; Zhang, H.; Sun, D. A High-Dimensional Spatio-Temporal Feature Extraction Method of Distributed PV and Load. In Proceedings of the 2024 IEEE/IAS Industrial and Commercial Power System Asia (I&CPS Asia), Pattaya, Thailand, 9 July 2024; pp. 391–396. [Google Scholar]
- Hou, Q.; Yang, L.; Hu, H. Comprehensive Evaluation Method for Source-Load Matching Based on Scenario Probability. Appl. Math. Nonlinear Sci. 2024, 9, 1–16. [Google Scholar] [CrossRef]
- Jing, S.; Xi, X.; Su, D.; Han, Z.; Wang, D. Spatio-Temporal Photovoltaic Power Prediction with Fourier Graph Neural Network. Electronics 2024, 13, 4988. [Google Scholar] [CrossRef]
- Gao, Q.; Yang, L.; Shu, Z.; He, J.; Huang, Y.; Gu, D.; Cai, Y. Numerical and Experimental Study on the Performance of Photovoltaic—Trombe Wall in Hot Summer and Warm Winter Regions: Energy Efficiency Matching and Application Potential. Buildings 2024, 14, 2919. [Google Scholar] [CrossRef]
- Afzalan, M.; Jazizadeh, F.; Eldardiry, H. Two-Stage Clustering of Household Electricity Load Shapes for Improved Temporal Pattern Representation. IEEE Access 2021, 9, 151667–151680. [Google Scholar] [CrossRef]
- Rana, S.; Jamil, U.; Asgari, N.; Hayibo, K.S.; Groza, J.; Pearce, J.M. Residential Sizing of Solar Photovoltaic Systems and Heat Pumps for Net Zero Sustainable Thermal Building Energy. Computation 2024, 12, 126. [Google Scholar] [CrossRef]
- Quiles, E.; Roldán-Blay, C.; Escrivá-Escrivá, G.; Roldán-Porta, C. Accurate Sizing of Residential Stand-Alone Photovoltaic Systems Considering System Reliability. Sustainability 2020, 12, 1274. [Google Scholar] [CrossRef]
- Peng, K.; Ma, M.; Zhao, W.; Zhang, R. Multi-Criteria Optimal Operation Strategy for Photovoltaic Systems in Large-Scale Logistics Parks Concerning Climate Impact. Buildings 2025, 15, 377. [Google Scholar] [CrossRef]
- Ali, S.; Bogarra, S.; Riaz, M.N.; Phyo, P.P.; Flynn, D.; Taha, A. From Time-Series to Hybrid Models: Advancements in Short-Term Load Forecasting Embracing Smart Grid Paradigm. Appl. Sci. 2024, 14, 4442. [Google Scholar] [CrossRef]
- Simeunović, J.; Schubnel, B.; Alet, P.-J.; Carrillo, R.E.; Frossard, P. Interpretable temporal-spatial graph attention network for multi-site PV power forecasting. Appl. Energy 2022, 327, 120127. [Google Scholar] [CrossRef]
- Rubasinghe, O.; Zhang, T.; Zhang, X.; Choi, S.S.; Chau, T.K.; Chow, Y.; Fernando, T.; Ho-Ching Iu, H. Highly accurate peak and valley prediction short-term net load forecasting approach based on decomposition for power systems with high PV penetration. Appl. Energy 2023, 333, 120641. [Google Scholar] [CrossRef]
- Robbert Claeys, R.; Cleenwerck, R.; Knockaert, J.; Desmet, J. Stochastic generation of residential load profiles with realistic variability based on wavelet-decomposed smart meter data. Appl. Energy 2023, 350, 121750. [Google Scholar] [CrossRef]
- Yerbury, L.W.; Campello, R.J.G.B.; Livingston, G.C., Jr.; Goldsworthy, M.; O’Neil, L. Comparing clustering approaches for smart meter time series: Investigating the influence of dataset properties on performance. Appl. Energy 2025, 391, 125811. [Google Scholar] [CrossRef]
- Catania, M.; Muliere, G.; Fattori, F.; Colbertaldo, P. The impact of temporal clustering on long-term energy system models. Appl. Energy 2025, 399, 126354. [Google Scholar] [CrossRef]
- Xu, J.; Ding, S.; Li, G.; Wang, Q. Arc Fault Detection for Photovoltaic Systems Using Independent Component Analysis Technique and Dynamic Time-Warping Algorithm. Sensors 2025, 25, 6094. [Google Scholar] [CrossRef]
- Shahbazkia, H.R.; Khosravani, H.R.; Pulatov, A.; Hajimani, E.; Kiazadeh, M. A Comprehensive Comparative Study of Quick Invariant Signature (QIS), Dynamic Time Warping (DTW), and Hybrid QIS + DTW for Time Series Analysis. Mathematics 2025, 13, 999. [Google Scholar] [CrossRef]
- Kim, M.; Firoozjaei, M.D.; Kim, H.; El-Hajj, M. Power Profiling of Smart Grid Users Using Dynamic Time Warping. Electronics 2025, 14, 2015. [Google Scholar] [CrossRef]
- Małek, A.; Piotrowska, K.; Gryniewicz-Jaworska, M.; Marciniak, A. Temporal Complementarity Analysis of Photovoltaic and Wind Power Generation Using Dynamic Time Warping. Appl. Sci. 2025, 15, 12119. [Google Scholar] [CrossRef]
- Fernandes, P.J.; Nagai, M. Mapping Rice Cropping Systems in Data-Scarce Regions Using NDVI Time-Series and Dynamic Time Warping Clustering: A Case Study of Maliana, Timor-Leste. Appl. Sci. 2025, 15, 12544. [Google Scholar] [CrossRef]
- Wang, T.; Li, L.; Wen, S.; Lv, Y.; Yu, Z.; He, C. Robust Phase Association and Simultaneous Arrival Picking for Downhole Microseismic Data Using Constrained Dynamic Time Warping. Sensors 2026, 26, 114. [Google Scholar] [CrossRef]
- Liu, Z.; Yu, P. A Novel Time-Frame Regional Collision Risk Model Based on Dynamic Time Warping. J. Mar. Sci. Eng. 2025, 13, 263. [Google Scholar] [CrossRef]
- Małek, A.; Caban, J.; Gryniewicz-Jaworska, M.; Marciniak, A.; Bednarczyk, T. A Method for Assessing the Selection of a Photovoltaic System for a Building’s Energy Needs Based on Unsupervised Clustering. Appl. Sci. 2025, 15, 9062. [Google Scholar] [CrossRef]
- Araújo, N.M.F.T.S.; Medeiros, S.E.L.; Abrahão, R. Variability and Sensitivity of Models Used to Estimate Photovoltaic Production. Energies 2024, 17, 4177. [Google Scholar] [CrossRef]
- Becerra-González, F.J.; Vera-Dimas, J.G.; Cisneros-Villalobos, L.; Martínez-Oropeza, A. Solar Energy in Buildings: Feasibility Analysis of Integrated and Conventional Photovoltaic Panels. Energies 2024, 17, 6367. [Google Scholar] [CrossRef]
- Zi, X.; Liu, F.; Liu, M.; Wang, Y. A Deep Learning Method for Photovoltaic Power Generation Forecasting Based on a Time-Series Dense Encoder. Energies 2025, 18, 2434. [Google Scholar] [CrossRef]
- Van der Does, F.; van Eeden, W.; Bringmann, L.F.; Lamers, F.; Penninx, B.W.J.H.; Riese, H.; Vermetten, E.; van der Wee, N.; Giltay, E. Dynamic time warp versus vector autoregression models for network analyses of psychological processes. Sci. Rep. 2025, 15, 11720. [Google Scholar] [CrossRef] [PubMed]
- Liu, Y.; Zhang, Y.A.; Zeng, M.; Zhao, J. A novel distance measure based on dynamic time warping to improve time series classification. Inf. Sci. 2024, 656, 119921. [Google Scholar] [CrossRef]
- Springer. Dynamic Time Warping. In Information Retrieval for Music and Motion; Springer: Berlin/Heidelberg, Germany, 2007. [Google Scholar] [CrossRef]
- Kopland, M.C.G.; Giltay, E.J. Dynamic Time Warp (DTW) as a scalable, data-efficient, and clinically relevant analysis of dynamic processes in patients with psychiatric disorders: A tutorial. J. Eat. Disord. 2025, 13, 230. [Google Scholar] [CrossRef] [PubMed] [PubMed Central]
- Burstyn, Y.; Gazit, A.; Dvir, O. Hierarchical Dynamic Time Warping methodology for aggregating multiple geological time series. Comput. Geosci. 2021, 150, 104704. [Google Scholar] [CrossRef]
- Herrmann, M.; Tan, C.W.; Webb, G.I. Parameterizing the cost function of dynamic time warping with application to time series classification. Data Min. Knowl. Disc. 2023, 37, 2024–2045. [Google Scholar] [CrossRef]
- Ma, R.; Ahmadzadeh, A.; Boubrahimi, S.F.; Angryk, R.A. Segmentation of Time Series in Improving Dynamic Time Warping. In Proceedings of the 2018 IEEE International Conference on Big Data (Big Data), Seattle, WA, USA, 10–13 December 2018; pp. 3756–3761. [Google Scholar] [CrossRef]
- Li, H.; Liu, J.; Yang, Z.; Liu, R.W.; Wu, K.; Wan, Y. Adaptively constrained dynamic time warping for time series classification and clustering. Inf. Sci. 2020, 534, 97–116. [Google Scholar] [CrossRef]
- Choi, W.; Cho, J.; Lee, S.; Jung, Y. Fast Constrained Dynamic Time Warping for Similarity Measure of Time Series Data. IEEE Access 2020, 8, 222841–222858. [Google Scholar] [CrossRef]
- Denkowska, A.; Wanat, S. Dynamic Time Warping Algorithm in Modeling Systemic Risk in the European Insurance Sector. Entropy 2021, 23, 1022. [Google Scholar] [CrossRef]
- An Illustrative Explanation to Dynamic Time Warping. Available online: https://towardsdatascience.com/an-illustrative-introduction-to-dynamic-time-warping-36aa98513b98/ (accessed on 1 January 2026).
- Bringmann, K.; Fischer, N.; van der Hoog, I.; Kipouridis, E.; Kociumaka, T.; Rotenberg, E. Dynamic Dynamic Time Warping. In Proceedings of the 2024 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA); Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 2024; pp. 208–242. [Google Scholar] [CrossRef]
- Giannoula, A.; De Paepe, A.E.; Sanz, F.; Furlong, L.I.; Camara, E. Identifying time patterns in Huntington’s disease trajectories using dynamic time warping-based clustering on multi-modal data. Sci. Rep. 2025, 15, 3081. [Google Scholar] [CrossRef] [PubMed]
- Contreras, J.M.; Molina Portillo, E.; Fernández Luna, J.M. Evaluation of Hierarchical Clustering Methodologies for Identifying Patterns in Timeout Requests in EuroLeague Basketball. Mathematics 2025, 13, 2414. [Google Scholar] [CrossRef]
- Shor, O.; Benninger, F.; Khrennikov, A. Dendrographic Hologram Theory: Predictability of Relational Dynamics of the Event Universe and the Emergence of Time Arrow. Symmetry 2022, 14, 1089. [Google Scholar] [CrossRef]








Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Małek, A.; Piotrowska, K.; Gryniewicz-Jaworska, M.; Marciniak, A. Time-Resolved Analysis of Photovoltaic–Building Energy Matching Using Dynamic Time Warping. Energies 2026, 19, 1107. https://doi.org/10.3390/en19041107
Małek A, Piotrowska K, Gryniewicz-Jaworska M, Marciniak A. Time-Resolved Analysis of Photovoltaic–Building Energy Matching Using Dynamic Time Warping. Energies. 2026; 19(4):1107. https://doi.org/10.3390/en19041107
Chicago/Turabian StyleMałek, Arkadiusz, Katarzyna Piotrowska, Michalina Gryniewicz-Jaworska, and Andrzej Marciniak. 2026. "Time-Resolved Analysis of Photovoltaic–Building Energy Matching Using Dynamic Time Warping" Energies 19, no. 4: 1107. https://doi.org/10.3390/en19041107
APA StyleMałek, A., Piotrowska, K., Gryniewicz-Jaworska, M., & Marciniak, A. (2026). Time-Resolved Analysis of Photovoltaic–Building Energy Matching Using Dynamic Time Warping. Energies, 19(4), 1107. https://doi.org/10.3390/en19041107

