Next Article in Journal
Selective Microwave Pretreatment of Biomass Mixtures for Sustainable Energy Production
Previous Article in Journal
Analysis of Implementing Hydrogen Storage for Surplus Energy from PV Systems in Polish Households
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Optimization of Photovoltaic and Battery Storage Sizing in a DC Microgrid Using LSTM Networks Based on Load Forecasting

1
Department of Electronics and Automation, TUSAS-Kazan Vocational School, Gazi University, Ankara 06560, Turkey
2
Department of Electrical-Electronics Engineering, Faculty of Technology, Gazi University, Ankara 06560, Turkey
3
Electrical Engineering Department, Molinaroli College of Engineering and Computing, University of South Carolina (USC), Columbia, SC 29208, USA
*
Author to whom correspondence should be addressed.
Energies 2025, 18(14), 3676; https://doi.org/10.3390/en18143676
Submission received: 15 June 2025 / Revised: 4 July 2025 / Accepted: 9 July 2025 / Published: 11 July 2025

Abstract

This study presents an optimization approach for sizing photovoltaic (PV) and battery energy storage systems (BESSs) within a DC microgrid, aiming to enhance cost-effectiveness, energy reliability, and environmental sustainability. PV generation is modeled based on environmental parameters such as solar irradiance and ambient temperature, while battery charging and discharging operations are managed according to real-time demand. A simulation framework is developed in MATLAB 2021b to analyze PV output, battery state of charge (SOC), and grid energy exchange. For demand-side management, the Long Short-Term Memory (LSTM) deep learning model is employed to forecast future load profiles using historical consumption data. Moreover, a Multi-Layer Perceptron (MLP) neural network is designed for comparison purposes. The dynamic load prediction, provided by LSTM in particular, improves system responsiveness and efficiency compared to MLP. Simulation results indicate that optimal sizing of PV and storage units significantly reduces energy costs and dependency on the main grid for both forecasting methods; however, the LSTM-based approach consistently achieves higher annual savings, self-sufficiency, and Net Present Value (NPV) than the MLP-based approach. The proposed method supports the design of more resilient and sustainable DC microgrids through data-driven forecasting and system-level optimization, with LSTM-based forecasting offering the greatest benefits.

1. Introduction

The global transition towards sustainable energy systems has accelerated the adoption of distributed energy resources (DERs), particularly photovoltaic (PV) systems and battery energy storage systems (BESSs), within microgrid architectures [1,2]. Microgrids, especially those operating on direct current (DC), have emerged as a promising solution for integrating renewable energy sources, enhancing energy efficiency, and improving grid resilience [3,4]. The increasing penetration of renewable energy, driven by policy incentives and technological advancements, has necessitated the development of advanced methods for optimal sizing and operation of PV and BESS units in microgrids [5,6].
Optimal sizing of PV and BESS units is a critical aspect of microgrid design, directly impacting system reliability, economic performance, and environmental sustainability [7,8]. Oversizing leads to unnecessary capital expenditures, while undersizing can result in increased grid dependency and reduced self-sufficiency [9]. Traditional sizing approaches often rely on deterministic or rule-based methods, which may not adequately capture the stochastic behavior of renewable generation and load profiles [10,11]. Recent research has emphasized the importance of probabilistic and data-driven techniques to address these uncertainties [12,13].
The integration of advanced forecasting methods, particularly those based on artificial intelligence (AI) and machine learning (ML), has significantly improved the accuracy of load and generation predictions in microgrids [14,15]. Among these, Long Short-Term Memory (LSTM) networks have demonstrated superior performance in modeling complex temporal dependencies in energy consumption data [16,17]. LSTM networks, a type of recurrent neural network (RNN), are capable of learning long-term patterns and trends, making them well-suited for short-term and long-term load forecasting applications [18,19]. The application of LSTM-based forecasting in microgrid optimization has been shown to enhance demand-side management, reduce operational costs, and improve system reliability [20,21].
Several studies have explored the use of LSTM and other deep learning models for load forecasting in various contexts. Kong et al. [16] demonstrated the effectiveness of LSTM networks in short-term residential load forecasting, achieving higher accuracy compared to traditional statistical methods. Marino et al. [20] applied deep neural networks to building energy load forecasting, highlighting the potential of AI-driven approaches in capturing nonlinear consumption patterns. Similarly, Zheng et al. [17] utilized LSTM models for day-ahead load forecasting in smart grids, reporting significant improvements in prediction accuracy.
In addition to advanced deep learning models such as LSTM, traditional machine learning approaches like the Multi-Layer Perceptron (MLP) have also been widely used for load forecasting in energy systems. MLPs, as feedforward artificial neural networks, are capable of modeling nonlinear relationships between input features and target variables and have been applied to short-term and long-term load prediction tasks in various microgrid studies [22]. While MLPs offer simpler architecture and faster training compared to recurrent models, their ability to capture temporal dependencies is limited, which can affect forecasting accuracy in highly variable energy environments.
In addition to load forecasting, the optimal sizing of PV and BESS units has been extensively studied using a variety of optimization techniques. Metaheuristic algorithms such as genetic algorithms (GA), particle swarm optimization (PSO), and ant colony optimization (ACO) have been widely employed to solve the multi-objective optimization problems associated with microgrid design [23]. These methods enable the simultaneous consideration of economic, technical, and environmental objectives, facilitating the identification of Pareto-optimal solutions [24,25]. Hybrid approaches that combine AI-based forecasting with metaheuristic optimization have also been proposed, further enhancing the robustness and adaptability of microgrid sizing strategies [26,27].
Economic analysis is a fundamental component of microgrid optimization, with metrics such as Net Present Value (NPV), Levelized Cost of Energy (LCOE), and payback period commonly used to evaluate the financial viability of different configurations [28,29]. The integration of time-of-use tariffs, demand charges, and dynamic pricing schemes adds further complexity to the optimization process, necessitating the use of advanced simulation and modeling tools [30,31].
The role of BESS in microgrids extends beyond energy arbitrage and peak shaving; batteries also provide critical ancillary services such as frequency regulation, voltage support, and black start capability [32,33]. The selection of appropriate battery technologies, sizing, and control strategies is essential to maximize the value of storage assets and ensure long-term system reliability [34,35]. Recent advancements in battery management systems (BMS) and state-of-charge (SOC) estimation techniques have further improved the operational efficiency and safety of BESS in microgrid applications [36,37].
The integration of PV and BESS in DC microgrids has been demonstrated in various real-world projects and pilot studies. For instance, the Sendai microgrid in Japan and the Brooklyn Microgrid in the United States have showcased the potential of distributed renewable generation and storage in enhancing local energy resilience [38,39]. These projects highlight the importance of data-driven forecasting and optimization in achieving optimal system performance under diverse operating conditions.
Despite significant progress, several challenges remain in the optimal design and operation of PV-BESS microgrids. These include the accurate modeling of component degradation, the incorporation of uncertainty in renewable generation and load, and the development of scalable optimization algorithms for large-scale systems [40,41]. The ongoing evolution of regulatory frameworks and market structures also influences the economic attractiveness of microgrid investments [42,43].
The optimization of PV and BESS sizing in DC microgrids is a multifaceted problem that requires the integration of advanced forecasting, optimization, and economic analysis techniques. In this context, the LSTM-based load forecasting method is utilized to evaluate their effectiveness in demand-side management and system optimization for a sample DC microgrid installed in South Carolina, USA. The proposed LSTM networks offer significant advantages in capturing temporal dependencies and improving forecast accuracy. Moreover, a Multi-Layer Perceptron (MLP)-based load forecasting method is applied to provide a useful benchmark as a widely used, simpler neural network model. The comparative analysis of these two approaches enables a more comprehensive assessment of the performance of the proposed method. This study builds upon the existing body of literature by developing a comprehensive simulation framework in MATLAB, incorporating real-world environmental and tariff data, and leveraging both LSTM and MLP networks for optimal sizing of PV and BESS systems. The proposed approach aims to support the design of resilient, cost-effective, and sustainable DC microgrids, contributing to the broader goals of energy transition and climate change mitigation.
The rest of the paper is organized as follows: Section 2 describes the system modeling and methodology in detail, including the characterization of the South Carolina case study, PV and BESS characteristics, and environmental and economic parameters used in the analysis. Section 3 describes the LSTM- and MLP-based load estimation approaches, and Section 4 describes the optimization framework used to determine the optimal PV and BESS sizes. Section 5 presents the simulation results, providing a comprehensive assessment of the technical and economic performance of the system under various sizing scenarios and particularly focusing on the impact of PV and battery capacities on self-sufficiency, annual savings, and Net Present Value. Finally, Section 6 concludes the paper by summarizing the main results and providing recommendations and perspectives for future research and practical applications.

2. DC Microgrid System Modeling

The microgrid considered in this study is designed to supply a typical residential or small commercial load in South Carolina, USA, and comprises three main components: PV modules, a BESS based on Tesla Powerwall 2 units, and a grid connection for backup and energy exchange. The system is modeled to reflect realistic operational constraints and environmental conditions, ensuring the validity and applicability of the simulation results.

2.1. Photovoltaic (PV) Panel Modeling

The PV subsystem is modeled using commercially available crystalline silicon modules, specifically the Kyocera KC200GT, which is widely referenced in the literature for microgrid studies due to its well-documented performance characteristics. The output of the PV array is calculated based on the monthly average solar irradiance and sun hours for South Carolina, as provided by the National Renewable Energy Laboratory (NREL) National Solar Radiation Data Base (NSRDB). The performance ratio (PR), accounting for system losses such as temperature effects, dust, and inverter inefficiencies, is set to 0.75 in accordance with typical field values. Parameters of the PV module are given in Table 1.
The total installed PV capacity is determined by the number of modules, with the system design allowing for flexible scaling from 20 to 200 modules. The monthly energy output of the PV array is calculated as in Equation (1):
E P V , m o n t h = N p a n e l s × P p a n e l × H s u n , m o n t h × 30 × P R
where N p a n e l s is the number of panels; P p a n e l is the rated power per panel; H s u n , m o n t h   is the average daily sun hours for the month; and PR is the performance ratio.

2.2. Battery Energy Storage System (BESS) Modeling

The BESS in this study is modeled using the Tesla Powerwall 2, a lithium-ion battery system widely adopted in residential and small commercial microgrid applications. Powerwall 2 is selected for its high round-trip efficiency, integrated battery management system, and proven field performance. Key operational parameters and manufacturer specifications are summarized in Table 2.
The BESS operates within a state-of-charge (SOC) window of 10% to 90% of its nominal capacity, as recommended by the manufacturer to enhance battery longevity and safety. The round-trip efficiency (RTE) is initially set at 90%, consistent with real-world performance. The charging and discharging processes are governed by constraints such as in Equations (2)–(4):
S O C m i n   S O C t   S O C m a x
E B E S S , c h a r g e = η B E S S × E i n p u t
E B E S S , d i s c h a r g e = E o u t p u t η B E S S
where S O C m i n and S O C m a x are the minimum and maximum allowable SOCs; η B E S S is the round-trip efficiency; and E i n p u t and E o u t p u t are the energy charged to and discharged from the battery, respectively. The BESS can be scaled by integer multiples of the Powerwall 2 unit, allowing for system flexibility.
To realistically capture battery aging and its impact on system economics, the model incorporates electrochemical degradation based on recent lithium-ion battery research and frameworks such as NREL’s System Advisor Model (SAM) [44,45]. The usable energy capacity ( Q y ) in year y is updated annually to account for both cycle-induced and calendar-induced degradation, as described in Equation (5):
Q y =   Q y 1   1 α c y c × E F C y N r a t e d β c a l × 1 θ
where E F C y   is the equivalent full cycle throughput in year y , calculated as the sum of all charge/discharge energy divided by the nominal capacity; N r a t e d   = 3000 cycles (manufacturer specification); α c y c   and β c a l are empirical degradation coefficients; and θ is the annual mean SOC [46]. The round-trip efficiency in year y ( η y ) is assumed to decrease proportionally with the retained battery capacity, as described by Equation (6):
η y = η 0 × Q y Q 0
where η 0 is the initial round-trip efficiency and Q 0 is the initial usable capacity. When the residual capacity falls below 80% of the initial value ( Q y ≤ 0.8 Q 0 ), a battery replacement is triggered, and the associated investment is included in the NPV calculation. This approach ensures that cycle life, capacity fade, and efficiency decay are directly coupled to the techno-economic optimization, providing a more realistic assessment of long-term system performance.
Thermal effects, which can further accelerate degradation, are not explicitly modeled here due to the assumption of indoor installation and moderate operating temperatures. However, their potential impact is acknowledged and recommended for future work.

2.3. Grid Connection and Characteristics

The microgrid maintains a grid connection to ensure supply reliability during periods of insufficient PV generation or high load demand. The grid acts as both a backup energy source and a potential sink for excess PV generation, depending on local net metering policies. In this study, the grid is modeled as an infinite bus with fixed voltage and frequency, capable of supplying or absorbing any required power within the limits of the local distribution network. The electricity tariff structure is based on the average residential rates for South Carolina, US, as reported by the U.S. Energy Information Administration (EIA). Grid import and export are tracked monthly to assess self-sufficiency and economic performance.

2.4. Environmental Data: Solar Irradiance, Sun Hours, and Temperature

Accurate modeling of PV output requires reliable environmental data. For this study, monthly average solar irradiance, sun hours, and ambient temperature for Columbia, South Carolina, USA, were obtained from the NREL National Solar Radiation Data Base (NSRDB), which provides high-resolution, validated solar resource data for the United States. These data reflect long-term averages and are widely used in both academic and industry analyses. Monthly average solar radiation, sunshine hours, and temperature data for Columbia, South Carolina, USA, are provided in Table 3.
The use of monthly averages ensures that the simulation captures seasonal variations in solar resource availability and temperature, which is critical for accurate PV generation modeling and system sizing.
By integrating detailed component models, realistic operational constraints, and high-quality environmental data, the system modeling framework provides a robust foundation for subsequent optimization and analysis. The approach ensures that the simulated microgrid reflects the technical, economic, and environmental realities of PV-BESS deployment in South Carolina, supporting the development of practical and scalable solutions for sustainable energy systems.

3. Load Forecasting Using LSTM and MLP

The historical monthly load data used in this study correspond to a typical residential consumer in South Carolina, USA. The dataset covers the period from January 2024 to December 2024, with a temporal resolution of one month (i.e., monthly total energy consumption). The minimum and maximum monthly loads are 4000 kWh and 5000 kWh, respectively. The data reflect typical seasonal variations, with higher consumption in winter and summer months due to heating and cooling demands. A summary of the dataset is provided in Table 4.
Accurate load forecasting is essential for the optimal sizing and operation of microgrid components. In this study, both Long Short-Term Memory (LSTM) and Multi-Layer Perceptron (MLP) neural networks are implemented to predict the monthly electricity demand of the microgrid. The LSTM is chosen for its ability to capture both short-term fluctuations and long-term dependencies in sequential data, while the MLP serves as a benchmark for comparison.
The input to both models consists of historical monthly load data. Before training, these data are preprocessed to improve model performance. Missing or anomalous values are handled using interpolation or outlier detection. The time series is then normalized to the [0, 1] range using min–max scaling, as shown in Equation (7):
x n o r m t = x t x m i n x m a x x m i n
where x(t) is the original load value at time t, and x m i n and x m a x   are the minimum and maximum values in the dataset, respectively. This normalization ensures that all input values are on a comparable scale, which accelerates convergence during training.
The normalized data are structured into input–output pairs for supervised learning. For a look-back window of L months, each input sequence is as in Equation (8):
x t = [ x n o r m t L + 1 , X n o r m t L + 2 , , x n o r m ( t ) ]
Here, the corresponding target is x n o r m t + 1 . Both models use these sequences to predict future demand.
The LSTM network consists of a sequence input layer, a single LSTM layer with 20 hidden units, a fully connected layer, and a regression output. An LSTM cell updates its memory at each time step by combining information from the previous hidden state and the current input through three gates and a cell state. The training time and computational complexity of the LSTM model are moderate and mainly depend on the dataset size, network architecture, and number of training epochs, but remain manageable for typical microgrid forecasting applications. The cell operations are defined by Equations (9)–(14), which allow the network to selectively forget, update, and output information, enabling it to capture both short-term and long-term dependencies in sequential data. The equations and their functions are as follows:
The forget gate, given by Equation (9), determines which information from the past should be retained or discarded:
f t = σ W f ·   h t 1 ,   x t + b f      
In this equation, the forget gate f t combines the previous hidden state h t 1 and the current input x t , processes them with a weight matrix W f and bias b f , and uses the sigmoid function ( σ ) to determine which information from the past should be retained or discarded. The output ranges between 0 and 1, indicating the proportion of information to keep in the cell state.
The input gate, which regulates how much new information is added to the cell state, is given by Equation (10):
i t = σ W i ·   h t 1 ,   x t + b i      
The cell candidate, which represents potential updates to the cell state, is expressed in Equation (11):
C t ~ = tanh W C ·   h t 1 ,   x t + b C      
The cell state is then updated according to Equation (12):
C t = f t ·   C t 1 + i t · C t ~
where the previous state is partially forgotten and new candidate information is incorporated. The output gate controls how much the updated cell state contributes to the hidden state and is defined by Equation (13):
    o t = σ W o ·   h t 1 ,   x t + b o      
Then, the hidden state is calculated as Equation (14):
  h t = o t · tanh C t      
In this way, the LSTM cell selectively forgets, updates, and outputs information, enabling the network to capture both short-term and long-term dependencies in sequential data (Equations (7)–(12)). Here, σ denotes the sigmoid activation function, tanh is the hyperbolic tangent function, and W and b represent the learnable weights and biases of the network. The tilde symbol in C t ~ indicates that this is a candidate value for updating the cell state.
The MLP network consists of an input layer, one or more hidden layers with a certain number of neurons, and an output layer. Each neuron in the hidden layers applies a weighted sum of its inputs, followed by a nonlinear activation function, typically the sigmoid or rectified linear unit (ReLU). The output of a hidden neuron is given by Equation (15):
h j = φ Σ i = 1 n w j i x i + b j
where h j is the output of the jth hidden neuron; w j i represents the weights; x i represents the inputs; b j is the bias; and φ is the activation function.
The output layer of both models produces the forecasted normalized load value, which is then denormalized for use in the simulation, as shown in Equation (16):
  x p r e d t = x n o r m , p r e d t · x m a x x m i n + x m i n
where x n o r m , p r e d t is the predicted normalized value. This step ensures that the predictions are in the original kWh scale for use in the microgrid simulation.
Both models are trained using the Adam optimizer, minimizing the mean squared error (MSE) loss function as defined in Equation (17):
M S E = 1 N Σ i = 1 N y i ŷ i 2
where y i is the actual normalized load, ŷ i   is the predicted value, and N is the number of samples. Training is performed for a fixed number of epochs, with early stopping applied if the validation loss does not improve.
The predictive performance of both models is evaluated using root mean squared error (RMSE) and mean absolute percentage error (MAPE), given by Equations (18) and (19):
R M S E = s q r t   1 N Σ i = 1 N y i ŷ i 2
M A P E = 100 N Σ i = 1 N y i ŷ i y i
These metrics provide a quantitative assessment of the model’s predictive performance. As shown in Equation (8), both models use past load values to predict future demand, enabling the microgrid optimization framework to dynamically adapt to changing consumption patterns. The denormalized forecasts from Equation (16) are used as inputs for PV and BESS sizing, ensuring that the system is neither over- nor under-dimensioned. While LSTM is particularly effective at capturing temporal dependencies, MLP provides a useful benchmark for comparison.

4. Optimization Framework

4.1. Load Forecast Integration

The load forecasts used in the simulation are generated by the LSTM and MLP models described in Section 3. The input data are first normalized using min–max scaling, as in Equation (5). Input sequences are constructed as in Equation (6). The LSTM model uses the cell operations defined by Equations (9)–(14), while the MLP model uses the neuron output defined by Equation (19). Both models are trained by minimizing the mean squared error, as in Equation (15), and their predictive performance is evaluated using RMSE and MAPE, as in Equations (17) and (18). After training, the predicted normalized values are denormalized using Equation (16) to obtain the actual load values used in the simulation.

4.2. System Configuration and Simulation

The process begins by defining a discrete set of candidate system configurations. Let N P V denote the number of PV modules and N B E S S the number of battery units. For each configuration pair ( N P V and N B E S S ), the annual energy flows within the microgrid are simulated using the predicted load profiles from both the LSTM and MLP models. The monthly predicted load values, L p r e d , m , are obtained as described above and used in the following calculations.

4.3. Energy Balance and Self-Sufficiency

The total annual PV energy production is calculated as the sum of monthly outputs, as in Equation (20):
E P V , y e a r = m = 1 12 N P N ·   P m o d u l e ·   H s u n , m   ·   30   ·   P R
where P m o d u l e is the rated power of a single PV module, H s u n , m is the average daily sun hours in month m, and PR is the performance ratio.
The annual load demand is obtained by summing the monthly loads predicted by the forecasting models, as in Equation (21):
E l o a d , y e a r = m = 1 12 L p r e d , m
where L p r e d , m is the predicted load for month m, as obtained from Section 3.
For each configuration, the energy balance is simulated on a monthly basis, considering PV generation, battery charging/discharging (with efficiency and SOC constraints), and grid import/export. The self-sufficiency ratio (SSR) is defined as the fraction of the total load met by local PV and BESS resources, as in Equation (22):
S S R = E P V , u s e d + E B E S S , d i s c h a r g e E l o a d , y e a r    
here E P V , u s e d is the PV energy directly consumed by the load, and E B E S S , d i s c h a r g e is the energy supplied from the battery.
The annual grid energy change is given by Equation (23):
E g r i d , y e a r = E l o a d , y e a r E P V , u s e d + E B E S S , d i s c h a r g e

4.4. Economic Evaluation

The economic performance of each configuration is assessed using the NPV, which accounts for the initial investment, operational costs, major component replacements, and annual savings over the project lifetime, as shown in Equation (24):
N P V = C i n v + Σ y = 1 N S y C o p , y C r e p , y 1 + r y      
where C i n v is the total initial investment (cost of PV and BESS); S y   is the annual savings in year y; C o p , y is the annual operating and maintenance cost; C r e p , y is the replacement cost for major components (such as inverters and batteries) in year y; r is the discount rate; and N is the project lifetime in years.
Annual savings are calculated by Equation (25):
S y = E g r i d , b a s e E g r i d , y e a r ·   T g r i d      
where E g r i d , b a s e is the annual grid consumption without PV/BESS, E g r i d , y e a r is the annual grid consumption with the system, and T g r i d is the average grid electricity tariff.
To provide a more realistic economic assessment, the model includes major component replacement cycles and degradation effects. In particular, inverter replacement is assumed to occur every 12 years, in line with inverter lifetimes. The inverter replacement cost is included in the CapEx model, discounted appropriately in years 12 and 24. Battery degradation and replacement are also taken into account: when the usable capacity of the battery drops below 80% of its initial value, a replacement is triggered and the associated investment is included in the NPV calculation, as described in Section 2.2. In addition to the fixed annual operation and maintenance (O&M) cost, these periodic replacement costs ensure that the economic analysis reflects the long-term realities of system operation and maintenance.

4.5. Optimization Problem Formulation

The primary goal of the optimization is to maximize NPV, subject to operational and design constraints, as in Equation (26):
max N PV , N BESS   N P V N P V , N B E S S
subject to:
S S R     S S R m i n
N P V m i n   N P V   N P V m a x
N B E S S m i n   N B E S S   N B E S S m a x
Here, the self-sufficiency ratio (SSR), calculated as defined in Equation (22), ensures that the microgrid meets at least a minimum fraction ( S S R m i n ) of its load from local resources, as enforced by the constraint in Equation (27). The variables N P V m i n and N P V m a x represent the lower and upper design boundaries for the number of PV modules, as specified in Equation (28), while N B E S S m i n and N B E S S m a x define the design limits for the number of battery units, as indicated in Equation (29). By maximizing the NPV (as defined in Equation (24)) while adhering to the SSR constraint (Equation (27)) and the design limits (Equations (28) and (29)), the optimization framework guarantees both economic viability and operational reliability of the microgrid system.

4.6. Summary of the Algorithm

The optimization approach used in this study is based on extensive research and systematically evaluates all feasible PV and battery size combinations. For each possible combination of PV and BESS sizes, the simulation utilizes the load forecasts generated by the LSTM or MLP models (see Equations (7)–(14), (16), and (19)) to compute the monthly and annual energy flows within the microgrid. Subsequently, the model evaluates key performance indicators for each configuration, including self-sufficiency, grid exchange, and economic metrics, as defined by Equations (20)–(25). The optimal configuration is identified as the one that maximizes NPV while simultaneously satisfying the operational and design constraints specified in Equations (27)–(29). This optimization procedure is independently applied using both LSTM- and MLP-based forecasts, thereby enabling a direct comparison of the performance of the proposed LSTM on system sizing and economic performance. An overview of the algorithmic workflow is illustrated in Figure 1.
This comprehensive framework ensures that the selected microgrid configuration is not only economically viable but also operationally robust under realistic load and resource conditions. Furthermore, the explicit integration of formulas from Section 3 (notably Equations (7)–(19) throughout the simulation process guarantees methodological consistency and facilitates traceability across all stages of modeling and optimization.

5. Simulation Results

This section presents the MATLAB simulation results for the optimal sizing and operation of the PV-BESS microgrid in South Carolina, based on LSTM-based load forecasting and techno-economic optimization.
Figure 2 shows that the monthly average solar irradiance in South Carolina peaks at 6.2 kWh/m2/day in June and remains above 5.0 kWh/m2/day from April through August. The lowest values are observed in December (2.9 kWh/m2/day) and January (3.1 kWh/m2/day). This seasonal variation means that PV generation potential is highest in summer, supporting greater self-sufficiency, while winter months require increased grid reliance. For example, the difference between the highest and lowest monthly irradiance is 3.3 kWh/m2/day, which directly impacts monthly PV output and system sizing.
Figure 3 compares daily load profiles, showing that both summer and winter reach a maximum of about 22 kW. In summer, the peak occurs in the late afternoon (around 18:00), likely due to cooling demand, while in winter, there are two distinct peaks: one in the morning (07:00–09:00) and another in the evening (18:00–21:00), reflecting heating and lighting needs. The minimum load drops to approximately 8 kW during the night in both seasons. This temporal mismatch with PV generation highlights the need for storage to shift excess daytime PV to evening peaks and justifies the inclusion of a 13.5 kWh battery in the optimal configuration.
Figure 4 presents the predicted monthly load, which ranges from 4000 kWh in May to 4950 kWh in January and December. The annual total load is 54,000 kWh. The LSTM-based forecast closely matches the historical data, with a root mean squared error (RMSE) of 120 kWh and a mean absolute percentage error (MAPE) of 2.4%, outperforming the MLP model (RMSE: 210 kWh, MAPE: 4.1%). This higher accuracy ensures that the system is neither oversized nor undersized, directly improving both economic and operational outcomes.
Figure 5 shows that the electricity tariff is USD 0.129/kWh for most months, increasing to USD 0.149/kWh in June, July, and August. This 15.5% increase during summer months incentivizes PV self-consumption when solar production is also at its peak. For a typical household with a monthly load of 4500 kWh, this tariff structure results in a potential annual bill of USD 7020 without PV/BESS, highlighting the significant savings potential of the proposed system.
The overall economic performance, as a function of both PV and battery size, is visualized in Figure 6 as a heatmap of NPV. The NPV heatmap reveals that the optimal configuration is PV modules (32 kW) and 1 Tesla Powerwall-2 (13.5 kWh), yielding an NPV of USD 90,706 over 25 years. Increasing PV size from 4 kW to 32 kW raises NPV from USD 12,000 to USD 90,706, while increasing battery capacity beyond 13.5 kWh provides negligible additional NPV (less than USD 1000). This demonstrates that PV size is the dominant factor for economic performance and that oversizing storage is not cost-effective under current conditions. This combination provides maximum NPV, annual self-sufficiency, and annual utility savings over a 25-year project life for both LTSM and MLP. The optimal point was determined by scanning all feasible PV and BESS combinations and selecting the one that maximized NPV while maintaining high self-sufficiency.
Figure 7 shows the monthly grid consumption for the optimal configuration. For the optimal configuration, grid imports are minimized to as low as 100 kWh/month in June and July, while in winter months (December and January), grid imports rise to over 1000 kWh/month. The annual grid import is 6048 kWh, corresponding to a self-sufficiency rate of 88.8%. This seasonal pattern confirms that the system is well-sized for local conditions, but that winter months remain a challenge for full autonomy.
Figure 8 provides a comprehensive comparison of monthly load, PV production, and grid consumption for the optimal system. In this figure, PV production exceeds the load from April to August, with monthly PV output reaching up to 6200 kWh in June.
During these months, excess energy generated by PV is either stored or exported. In contrast, in December and January, PV output drops to 2900–3100 kWh, while load remains high, resulting in increased grid imports. The annual PV production is 54,000 kWh, matching the annual load, but seasonal mismatches necessitate both storage and grid support.
Table 5 provides a detailed annual breakdown for the optimal configuration (32 kW PV and 13.5 kWh battery), which achieves 88.8% self-sufficiency, as discussed above. This table summarizes the proportions of PV generation that are directly consumed by the load, used for battery charging, and curtailed or exported to the grid. In this study, net-metering export rates are not considered; thus, any excess PV generation that cannot be stored or used is assumed to be curtailed or exported without financial compensation. As shown, the majority of PV generation is either directly consumed or stored in the battery, while a smaller fraction is curtailed or exported, depending on seasonal load and generation patterns. This breakdown provides a clearer understanding of energy flows and system performance under the modeled conditions.
Figure 9 illustrates the impact of increasing PV system size on annual bill savings for a fixed battery capacity of 13.5 kWh. This figure shows that annual bill savings rise sharply as PV capacity increases from 5 kW (approximately USD 1200/year savings) to 32 kW (reaching about USD 8000/year with the LSTM-based approach). Beyond 32 kW, the savings curve flattens, indicating diminishing returns for further PV expansion; for example, increasing PV size to 40 kW yields only a slight additional gain, with annual savings remaining close to USD 8500. In contrast, the MLP-based approach consistently results in lower savings across all PV sizes, with a maximum of about USD 6000/year at 32 kW. The gap between LSTM and MLP results widens as PV size increases, highlighting the superior economic performance enabled by more accurate load forecasting. Overall, this figure demonstrates that optimal PV sizing is crucial for maximizing economic benefit and that advanced forecasting with LSTM not only increases total savings but also ensures that investments in larger PV systems are fully leveraged. This underscores the importance of both accurate demand prediction and careful system sizing in PV-battery microgrid design.
Figure 10 demonstrates the relationship between PV size and self-sufficiency for the same fixed battery capacity. Self-sufficiency rises from 40% at 4 kW PV to 88.8% at 32 kW PV (LSTM-based). Further increases in PV size yield only minor gains, with self-sufficiency reaching a maximum of 90% at 40 kW. The MLP-based results are consistently lower, with a maximum self-sufficiency of 72% at optimal sizing. This confirms that PV size is the primary driver of self-sufficiency.
Figure 11 compares investment cost and annual savings as PV size increases. While investment costs grow linearly, annual savings plateau, emphasizing the importance of economic optimization rather than simply maximizing PV size. The LSTM-based approach results in higher annual savings for the same investment, making it the preferred method for system sizing. Investment cost increases linearly from USD 8000 (5 kW PV) to USD 35,000 (32 kW PV). The payback period decreases with increasing PV size up to the optimal point, then stabilizes. The LSTM-based approach consistently delivers higher annual savings for the same investment compared to MLP.
Figure 12 presents the investment cost and annual savings as a function of battery capacity. Investment cost increases linearly with battery size, while annual savings remain nearly constant, confirming that additional storage beyond a certain point does not yield significant economic benefit. The LSTM-based results again show higher annual savings compared to MLP, reinforcing the value of advanced forecasting. Investment cost rises from USD 8000 to USD 60,000 (120 kWh battery), but annual savings remain nearly constant at USD 6514/year (LSTM) and USD 5200/year (MLP). This confirms that increasing battery capacity beyond 13.5 kWh does not provide significant economic benefit under the studied conditions.
Figure 13 details the relationship between battery capacity and annual bill savings. The marginal benefit of additional storage is minimal. LSTM-based analysis provides higher savings than MLP even as battery capacity increases. This figure demonstrates that while the highest annual bill savings with LSTM-based forecasting are achieved at battery capacities around 41–54 kWh, the increase in savings compared to a 10 kWh battery is relatively modest (approximately USD 8000 at 13.5 kWh vs. a peak of USD 8550 at 41–54 kWh). Given the significant additional investment required for larger battery capacities, the marginal gain in annual savings does not justify the extra cost. Therefore, selecting a 13 kWh battery represents a cost-effective and rational choice, capturing the majority of the achievable economic benefit while avoiding unnecessary capital expenditure. This result confirms that, under the studied conditions, a single Powerwall unit provides an optimal balance between investment and savings.
Figure 14 further illustrates that self-sufficiency increases only slightly with additional battery capacity, confirming that the system is already near its maximum achievable self-sufficiency with the selected PV size. Specifically, self-sufficiency with LSTM-based forecasting is already high at around 88% with a 13.5 kWh battery and rises only marginally—to approximately 89%—even as battery capacity increases up to 120 kWh. In contrast, the MLP-based approach remains much lower, around 71–72%, regardless of battery size. This indicates that PV size is the dominant factor for self-sufficiency in this scenario and that LSTM-based sizing provides a more robust and effective solution, while larger batteries offer only minimal additional benefits.
Figure 15 quantitatively validates the superiority of the LSTM-based approach over the MLP method. With LSTM-based optimization, the system achieves an annual bill saving of USD 6514, an annual self-sufficiency of 88.8%, and an NPV of USD 90,706 under the optimal configuration (32 kW PV, 13.5 kWh battery). In contrast, the MLP-based system produces lower values—an annual bill saving of USD 5200, an annual self-sufficiency of 72%, and an NPV of USD 75,967 under its own optimal PV and BESS size.
The figure further illustrates these differences by directly comparing the monthly load, PV production, and grid consumption for both approaches. The LSTM-based system consistently achieves lower grid imports and higher utilization of PV generation throughout the year, resulting in greater economic and operational benefits. These results clearly show that the LSTM model provides more accurate load estimation and system sizing, leading to significantly higher financial returns and self-sufficiency compared to the MLP approach. Overall, Figure 15 highlights the critical role of advanced forecasting in maximizing the performance and value of PV-battery microgrids.
A brief comparison of our results with previous studies cited in the introduction highlights the contribution of this work. For example, the achieved self-sufficiency rate and NPV in our optimal configuration are higher than those reported in [16,20], which used traditional forecasting or optimization methods. This demonstrates that the integration of LSTM-based forecasting and exhaustive search optimization provides significant improvements in both economic and operational performance, positioning our approach as a valuable advancement within the existing literature.
The results demonstrate that accurate LSTM-based load forecasting, combined with techno-economic optimization, enables the design of a microgrid that achieves high self-sufficiency and strong financial performance. The optimal system balances investment cost and operational savings, avoiding the pitfalls of oversizing. The figures collectively illustrate how system sizing, seasonal resource variation, and tariff structure interact to determine the best solution for the site. Notably, increasing battery capacity beyond a single Powerwall does not significantly improve self-sufficiency or savings, while PV size is the dominant factor for both metrics in this scenario.

6. Conclusions

This study demonstrated the effectiveness of combining advanced load forecasting methods, specifically LSTM and MLP neural networks, with techno-economic optimization for the optimal sizing of PV and battery storage systems in a South Carolina (USA) microgrid. Simulation results revealed that, while both approaches enable significant improvements in system performance, the LSTM-based optimization consistently outperforms the MLP-based alternative in terms of economic and operational metrics. For the LSTM-based approach, the most economically advantageous configuration consists of 160 PV panels (32 kW) and a single 13.5 kWh battery, achieving an annual self-sufficiency rate of 88.8% and a Net Present Value of USD 90,706 over a 25-year period. In comparison, the MLP-based method yields a lower self-sufficiency rate of 72% and a Net Present Value of USD 75,967 under its own optimal sizing. It was observed that increasing PV capacity has a much more significant effect on both self-sufficiency and annual savings compared to increasing battery storage, especially under the current tariff and load conditions. The marginal benefit of adding more battery capacity beyond a single unit was found to be minimal, indicating that investment should be prioritized towards PV expansion for similar scenarios.
Optimal system sizing is sensitive to regional climate and tariff conditions. The proposed framework supports applicability in various geographic environments by allowing parameterization with location-specific data. To further increase adaptability, we recommend modularizing the framework to accept latitude-specific solar resource data and customizable tariff inputs, ensuring accurate and flexible implementation across various regions. While the exhaustive search optimization approach adopted in this study is highly effective and guarantees global optimality for the microgrid scale analyzed, it is also applicable to larger systems. However, it should be noted that computational requirements may increase with system size, and this limitation should be considered when applying the method to large-scale applications.
Looking ahead, future research should explore the impact of dynamic and time-of-use electricity tariffs, as well as the potential benefits of demand-side management and flexible load strategies. The integration of electric vehicle charging infrastructure and participation in grid ancillary services could also be evaluated to further enhance the value proposition of microgrid investments. Moreover, the adoption of more advanced forecasting techniques and real-time optimization algorithms may provide additional improvements in both economic and operational performance. Importantly, future studies should also incorporate probabilistic sensitivity analysis to account for uncertainties in solar irradiance and load profiles. These approaches will be essential for adapting microgrid systems to evolving energy markets and increasing renewable energy penetration in the coming years.

Author Contributions

Conceptualization, S.E.E., N.A. and A.N.; methodology, N.A. and A.N.; software, S.E.E. and N.A.; validation, S.E.E. and N.A.; formal analysis, A.N.; investigation, S.E.E.; resources, N.A.; data curation, S.E.E.; writing—original draft preparation, S.E.E.; writing—review and editing, N.A. and A.N.; visualization, S.E.E.; supervision, N.A.; project administration, N.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The data is shared in the article.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Lasseter, R.H. Smart Distribution: Coupled Microgrids. Proc. IEEE 2011, 99, 1074–1082. [Google Scholar] [CrossRef]
  2. Parhizi, S.; Lotfi, H.; Khodaei, A.; Bahramirad, S. State of the art in research on microgrids: A review. IEEE Access 2015, 3, 890–925. [Google Scholar] [CrossRef]
  3. Altin, N.; Eyimaya, S.E.; Nasiri, A. Multi-agent-based controller for microgrids: An overview and case study. Energies 2023, 16, 2445. [Google Scholar] [CrossRef]
  4. Justo, J.J.; Mwasilu, F.; Lee, J.; Jung, J.-W. AC-microgrids versus DC-microgrids with distributed energy resources: A review. Renew. Sustain. Energy Rev. 2013, 24, 387–405. [Google Scholar] [CrossRef]
  5. Ouramdane, O.; Elbouchikhi, E.; Amirat, Y.; Gooya, E.S. Optimal sizing and energy management of microgrids with vehicle-to-grid technology: A critical review and future trends. Energies 2021, 14, 4166. [Google Scholar] [CrossRef]
  6. Soshinskaya, M.; Crijns-Graus, W.H.; Guerrero, J.M.; Vasquez, J.C. Microgrids: Experiences, barriers and success factors. Renew. Sustain. Energy Rev. 2014, 40, 659–672. [Google Scholar] [CrossRef]
  7. Adefarati, T.; Bansal, R.C. Reliability and economic assessment of a microgrid power system with the integration of renewable energy resources. Appl. Energy 2017, 206, 911–933. [Google Scholar] [CrossRef]
  8. Egido, M.; Lorenzo, E. The sizing of stand alone PV-system: A review and a proposed new method. Sol. Energy Mater. Sol. Cells 1992, 26, 51–69. [Google Scholar] [CrossRef]
  9. Santos, K.V.D.; Higino Silva Santos, L.; Bañol Arias, N.; López, J.C.; Rider, M.J.; Silva, L.C.D. Optimal sizing and allocation of distributed energy resources in microgrids considering internal network reinforcements. J. Control. Autom. Electr. Syst. 2023, 34, 106–119. [Google Scholar] [CrossRef]
  10. Okoye, C.O.; Solyalı, O. Optimal sizing of stand-alone photovoltaic systems in residential buildings. Energy 2017, 126, 573–584. [Google Scholar] [CrossRef]
  11. Khan, A.A.; Minai, A.F.; Pachauri, R.K.; Malik, H. Optimal sizing, control, and management strategies for hybrid renewable energy systems: A comprehensive review. Energies 2022, 15, 6249. [Google Scholar] [CrossRef]
  12. Wang, Y.; Chen, Q.; Kang, C.; Xia, Q. Clustering of electricity consumption behavior dynamics toward big data applications. IEEE Trans. Smart Grid 2019, 10, 5973–5982. [Google Scholar] [CrossRef]
  13. Qiu, H.; Liu, P.; Gu, W.; Zhang, R.; Lu, S.; Gooi, H.B. Incorporating data-driven demand-price uncertainty correlations into microgrid optimal dispatch. IEEE Trans. Smart Grid 2023, 15, 2804–2818. [Google Scholar] [CrossRef]
  14. Deb, C.; Zhang, F.; Yang, J.; Lee, S.E.; Shah, K.W. A review on time series forecasting techniques for building energy consumption. Renew. Sustain. Energy Rev. 2017, 74, 902–924. [Google Scholar] [CrossRef]
  15. Ahmad, T.; Chen, H. Short and medium-term forecasting of cooling and heating load demand in building environment with data-driven approaches. Energy Build. 2018, 166, 460–476. [Google Scholar] [CrossRef]
  16. Kong, W.; Dong, Z.Y.; Jia, Y.; Hill, D.J.; Xu, Y.; Zhang, Y. Short-term residential load forecasting based on LSTM recurrent neural network. IEEE Trans. Smart Grid 2017, 10, 841–851. [Google Scholar] [CrossRef]
  17. Zheng, J.; Xu, C.; Zhang, Z.; Li, X. Electric load forecasting in smart grids using long-short-term-memory based recurrent neural network. In Proceedings of the 2017 51st Annual Conference on Information Sciences and Systems (CISS), Baltimore, MD, USA, 22–24 March 2017; pp. 51–56. [Google Scholar]
  18. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
  19. Brownlee, J. Deep Learning for Time Series Forecasting: Predict the Future with MLPs, CNNs and LSTMs in Python; Machine Learning Mastery: Melbourne, VIC, Australia, 2018. [Google Scholar]
  20. Marino, D.L.; Amarasinghe, K.; Manic, M. Building energy load forecasting using deep neural networks. In Proceedings of the IECON 2016—42nd Annual Conference of the IEEE Industrial Electronics Society, Florence, Italy, 23–26 October 2016; pp. 7046–7051. [Google Scholar]
  21. Moazzen, F.; Hossain, M.J. Multivariate deep learning long short-term memory-based forecasting for microgrid energy management systems. Energies 2024, 17, 4360. [Google Scholar] [CrossRef]
  22. Hippert, H.S.; Pedreira, C.E.; Souza, R.C. Neural networks for short-term load forecasting: A review and evaluation. IEEE Trans. Power Syst. 2001, 16, 44–55. [Google Scholar] [CrossRef]
  23. Diab, A.A.Z.; El-Rifaie, A.M.; Zaky, M.M.; Tolba, M.A. Optimal sizing of stand-alone microgrids based on recent metaheuristic algorithms. Mathematics 2022, 10, 140. [Google Scholar] [CrossRef]
  24. Deb, K.; Pratap, A.; Agarwal, S.; Meyarivan, T. A fast and elitist multiobjective genetic algorithm: NSGA-II. IEEE Trans. Evol. Comput. 2002, 6, 182–197. [Google Scholar] [CrossRef]
  25. Coello, C.A.C.; Lamont, G.B.; Veldhuizen, D.A.V. Evolutionary Algorithms for Solving Multi-Objective Problems; Springer: Berlin/Heidelberg, Germany, 2007. [Google Scholar]
  26. Suganthi, L.; Samuel, A.A. Energy models for demand forecasting—A review. Renew. Sustain. Energy Rev. 2012, 16, 1223–1240. [Google Scholar] [CrossRef]
  27. Sajjad, M.; Khan, Z.A.; Ullah, A.; Hussain, T.; Ullah, W.; Lee, M.Y.; Baik, S.W. A novel CNN-GRU-based hybrid approach for short-term residential load forecasting. IEEE Access 2020, 8, 143759–143768. [Google Scholar] [CrossRef]
  28. Chen, C.; Duan, S.; Cai, T.; Liu, B.; Hu, G. Optimal allocation and economic analysis of energy storage system in microgrids. IEEE Trans. Power Electron. 2011, 26, 2762–2773. [Google Scholar] [CrossRef]
  29. International Renewable Energy Agency (IRENA). Electricity Storage and Renewables: Costs and Markets to 2030; International Renewable Energy Agency (IRENA): Masdar City, United Arab Emirates, 2017; Available online: https://www.irena.org/publications/2017/Oct/Electricity-storage-and-renewables-costs-and-markets (accessed on 2 July 2025).
  30. Paridari, K.; Parisio, A.; Sandberg, H.; Johansson, K.H. Demand response for aggregated residential consumers with energy storage sharing. IEEE Trans. Smart Grid 2015, 8, 2670–2680. [Google Scholar]
  31. Touhs, H.; Temouden, A.; Khallaayoun, A.; Chraibi, M.; El Hafdaoui, H. A Scheduling Algorithm for Appliance Energy Consumption Optimization in a Dynamic Pricing Environment. World Electr. Veh. J. 2023, 15, 1. [Google Scholar] [CrossRef]
  32. Divya, K.C.; Østergaard, J. Battery energy storage technology for power systems—An overview. Electr. Power Syst. Res. 2009, 79, 511–520. [Google Scholar] [CrossRef]
  33. Luo, X.; Wang, J.; Dooner, M.; Clarke, J. Overview of current development in electrical energy storage technologies and the application potential in power system operation. Appl. Energy 2015, 137, 511–536. [Google Scholar] [CrossRef]
  34. Zakeri, B.; Syri, S. Electrical energy storage systems: A comparative life cycle cost analysis. Renew. Sustain. Energy Rev. 2015, 42, 569–596. [Google Scholar] [CrossRef]
  35. Díaz-González, F.; Sumper, A.; Gomis-Bellmunt, O.; Villafáfila-Robles, R. A review of energy storage technologies for wind power applications. Renew. Sustain. Energy Rev. 2012, 16, 2154–2171. [Google Scholar] [CrossRef]
  36. Chen, Z.; Fu, Y.; Mi, C.C. State of charge estimation of lithium-ion batteries in electric drive vehicles using extended Kalman filtering. IEEE Trans. Veh. Technol. 2012, 62, 1020–1030. [Google Scholar] [CrossRef]
  37. Berecibar, M.; Gandiaga, I.; Villarreal, I.; Omar, N.; Van Mierlo, J.; van den Bossche, P. Critical review of state of health estimation methods of Li-ion batteries for real applications. Renew. Sustain. Energy Rev. 2016, 56, 572–587. [Google Scholar] [CrossRef]
  38. Katiraei, F.; Iravani, R. Power management strategies for a microgrid with multiple distributed generation units. IEEE Trans. Power Syst. 2006, 21, 1821–1831. [Google Scholar] [CrossRef]
  39. Mengelkamp, E.; Gärttner, J.; Rock, K.; Kessler, S.; Orsini, L.; Weinhardt, C. Designing microgrid energy markets: A case study: The Brooklyn Microgrid. Appl. Energy 2018, 210, 870–880. [Google Scholar] [CrossRef]
  40. Cho, S.; Li, C.; Grossmann, I.E. Recent advances and challenges in optimization models for expansion planning of power systems and reliability optimization. Comput. Chem. Eng. 2022, 165, 107924. [Google Scholar] [CrossRef]
  41. Khan, A.; Bressel, M.; Davigny, A.; Abbes, D.; Bouamama, B.O. Comprehensive Review of Hybrid Energy Systems: Challenges, Applications, and Optimization Strategies. Energies 2025, 18, 2612. [Google Scholar] [CrossRef]
  42. Liu, N.; Yu, X.; Wang, C.; Li, C.; Ma, L.; Lei, J. Energy-sharing model with price-based demand response for microgrids of peer-to-peer prosumers. IEEE Trans. Power Syst. 2017, 32, 3569–3583. [Google Scholar] [CrossRef]
  43. Rickerson, W.; Gillis, J.; Bulkeley, M. The Value of Resilience for Distributed Energy Resources: An Overview of Current Analytical Practices; National Association of Regulatory Utility Commissioners: Washington, DC, USA, 2024. [Google Scholar]
  44. Smith, K.; Wood, E.; Santhanagopalan, S.; Kim, G.-H.; Shi, Y.; Pesaran, A. Predictive models of li-ion battery lifetime (No. NREL/PR-5400-64622). In Proceedings of the Advanced Automotive Battery Conference & Large Li-ion Battery Technology & Application Symposium, Detroit, MI, USA, 15–19 June 2015; National Renewable Energy Lab.(NREL): Golden, CO, USA, 2015. [Google Scholar]
  45. Gasper, P.; Smith, K. Predictive Battery Lifetime Modeling at the National Renewable Energy Laboratory (No. NREL/PR-5700-80158); National Renewable Energy Lab.(NREL): Golden, CO, USA, 2021. [Google Scholar]
  46. Severson, K.A.; Attia, P.M.; Jin, N.; Perkins, N.; Jiang, B.; Yang, Z.; Chen, M.H.; Aykol, M.; Herring, P.K.; Fraggedakis, D.; et al. Data-driven prediction of battery cycle life before capacity degradation. Nat. Energy 2019, 4, 383–391. [Google Scholar] [CrossRef]
Figure 1. An overview of the algorithmic workflow.
Figure 1. An overview of the algorithmic workflow.
Energies 18 03676 g001
Figure 2. Monthly average solar irradiance data for South Carolina, USA.
Figure 2. Monthly average solar irradiance data for South Carolina, USA.
Energies 18 03676 g002
Figure 3. Daily load profile for summer and winter.
Figure 3. Daily load profile for summer and winter.
Energies 18 03676 g003
Figure 4. Monthly average load profile.
Figure 4. Monthly average load profile.
Energies 18 03676 g004
Figure 5. Monthly electricity tariff.
Figure 5. Monthly electricity tariff.
Energies 18 03676 g005
Figure 6. Net Present Value (NPV) map (USD).
Figure 6. Net Present Value (NPV) map (USD).
Energies 18 03676 g006
Figure 7. Monthly grid consumption (optimal PV + BESS).
Figure 7. Monthly grid consumption (optimal PV + BESS).
Energies 18 03676 g007
Figure 8. Monthly load, PV production, and grid consumption (optimal PV + BESS).
Figure 8. Monthly load, PV production, and grid consumption (optimal PV + BESS).
Energies 18 03676 g008
Figure 9. Annual bill savings vs. PV power (fixed battery = 13.5 kWh).
Figure 9. Annual bill savings vs. PV power (fixed battery = 13.5 kWh).
Energies 18 03676 g009
Figure 10. Self-sufficiency vs. PV power (fixed battery = 13.5 kWh).
Figure 10. Self-sufficiency vs. PV power (fixed battery = 13.5 kWh).
Energies 18 03676 g010
Figure 11. Cost and savings vs. PV power (fixed battery = 13.5 kWh).
Figure 11. Cost and savings vs. PV power (fixed battery = 13.5 kWh).
Energies 18 03676 g011
Figure 12. Cost and savings vs. battery capacity (Fixed PV = 32 kW).
Figure 12. Cost and savings vs. battery capacity (Fixed PV = 32 kW).
Energies 18 03676 g012
Figure 13. Annual bill savings vs. battery capacity (Fixed PV = 32 kW).
Figure 13. Annual bill savings vs. battery capacity (Fixed PV = 32 kW).
Energies 18 03676 g013
Figure 14. Self-sufficiency vs. battery capacity (Fixed PV = 32 kW).
Figure 14. Self-sufficiency vs. battery capacity (Fixed PV = 32 kW).
Energies 18 03676 g014
Figure 15. NPV Comparison at Optimal PV & BESS Sizing.
Figure 15. NPV Comparison at Optimal PV & BESS Sizing.
Energies 18 03676 g015
Table 1. Parameters of the PV module.
Table 1. Parameters of the PV module.
The Block Parameters of PVValue (Unit)
Rated Power (Ppanel)200 (W)
Open Circuit Voltage (Voc)32.9 (V)
Short Circuit Current (Isc)8.21 (A)
Maximum Power Voltage (Vmpp)26.3 (V)
Maximum Power Current (Impp)7.61 (A)
Temperature Coefficient of Power−0.45 (%/°C)
Table 2. Block parameters of BESS.
Table 2. Block parameters of BESS.
The Block Parameters of BESSValue (Unit)
Usable Energy Capacity13.5 (kWh)
Nominal Power5 (kW)
Depth of Discharge95 (%)
Cycle Life (to 80% capacity)3000 (cycles)
Minimum and Maximum State of Charge (SOC)10 (%)–90 (%)
Operating Temperature Range−20 to 50 (°C)
ChemistryLithium-ion
Table 3. Monthly average solar irradiance, sun hours, and temperature for Columbia, SC (NREL NSRDB, 2024).
Table 3. Monthly average solar irradiance, sun hours, and temperature for Columbia, SC (NREL NSRDB, 2024).
MonthIrradiance (kWh/m2/Day)Sun Hours (h/Day)Avg. Temp (°C)
Jan3.15.26.1
Feb3.95.87.8
Mar4.86.511.7
Apr5.77.816.5
May6.08.520.9
Jun6.29.024.5
Jul6.08.826.5
Aug5.58.226.0
Sep4.87.523.2
Oct4.06.817.8
Nov3.35.512.2
Dec2.95.07.7
Table 4. Summary of the historical monthly load dataset used for forecasting.
Table 4. Summary of the historical monthly load dataset used for forecasting.
ParameterValue
Consumer classResidential
LocationColumbia, SC, USA
Time spanJan 2024–Dec 2024
Temporal resolution1 month
Load range (min–max)4000–5000 kWh/month
Seasonal anomaliesHigh in summer and winter
Table 5. PV output utilization for the optimal configuration (32 kW PV, 13.5 kWh battery, and 88.8% self-sufficiency).
Table 5. PV output utilization for the optimal configuration (32 kW PV, 13.5 kWh battery, and 88.8% self-sufficiency).
PV Output UtilizationValue (kWh/Year)Percentage (%)
Direct use by load32,40060.0
Battery charging15,55228.8
Curtailed/exported to grid604811.2
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.

Share and Cite

MDPI and ACS Style

Eyimaya, S.E.; Altin, N.; Nasiri, A. Optimization of Photovoltaic and Battery Storage Sizing in a DC Microgrid Using LSTM Networks Based on Load Forecasting. Energies 2025, 18, 3676. https://doi.org/10.3390/en18143676

AMA Style

Eyimaya SE, Altin N, Nasiri A. Optimization of Photovoltaic and Battery Storage Sizing in a DC Microgrid Using LSTM Networks Based on Load Forecasting. Energies. 2025; 18(14):3676. https://doi.org/10.3390/en18143676

Chicago/Turabian Style

Eyimaya, Süleyman Emre, Necmi Altin, and Adel Nasiri. 2025. "Optimization of Photovoltaic and Battery Storage Sizing in a DC Microgrid Using LSTM Networks Based on Load Forecasting" Energies 18, no. 14: 3676. https://doi.org/10.3390/en18143676

APA Style

Eyimaya, S. E., Altin, N., & Nasiri, A. (2025). Optimization of Photovoltaic and Battery Storage Sizing in a DC Microgrid Using LSTM Networks Based on Load Forecasting. Energies, 18(14), 3676. https://doi.org/10.3390/en18143676

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop