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):
where
is the number of panels;
is the rated power per panel;
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):
where
and
are the minimum and maximum allowable SOCs;
is the round-trip efficiency; and
and
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 (
) in year
is updated annually to account for both cycle-induced and calendar-induced degradation, as described in Equation (5):
where
is the equivalent full cycle throughput in year
, calculated as the sum of all charge/discharge energy divided by the nominal capacity;
= 3000 cycles (manufacturer specification);
and
are empirical degradation coefficients; and θ is the annual mean SOC [
46]. The round-trip efficiency in year
(
) is assumed to decrease proportionally with the retained battery capacity, as described by Equation (6):
where
is the initial round-trip efficiency and
is the initial usable capacity. When the residual capacity falls below 80% of the initial value (
≤ 0.8
), 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):
where
x(
t) is the original load value at time
t, and
and
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):
Here, the corresponding target is . 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:
In this equation, the forget gate combines the previous hidden state and the current input , processes them with a weight matrix and bias , 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):
The cell candidate, which represents potential updates to the cell state, is expressed in Equation (11):
The cell state is then updated according to Equation (12):
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):
Then, the hidden state is calculated as Equation (14):
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 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):
where
is the output of the
jth hidden neuron;
represents the weights;
represents the inputs;
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):
where
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):
where
is the actual normalized load,
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):
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.
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/m
2/day in June and remains above 5.0 kWh/m
2/day from April through August. The lowest values are observed in December (2.9 kWh/m
2/day) and January (3.1 kWh/m
2/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/m
2/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.