$$\rightleftharpoonup{xx}$$
$$\longleftharp{xx}$$,
$$\longrightharp{xx}$$,
Protocol overview
This study follows a three-step protocol to perform life-cycle capacity planning under intraday uncertainty. (i) Formulate and implement the integrated planning and operational model in MATLAB. An integrated capacity planning and operational model is formulated for a wind–PV–storage–transmission base. The objective function and constraints are implemented in MATLAB R2023a using YALMIP, decision variables are defined with sdpvar, and CPLEX 12.10 is configured as the mixed-integer solver. The model formulation includes the overall structure, objective function, and constraints. (ii) Generate uncertainty scenarios for intraday operation. The historical time-series data of wind power, photovoltaic output, load demand, and electricity market prices are extracted from public datasets20. The probability distributions are fitted for each uncertain variable, and representative daily scenarios are generated using Latin hypercube sampling combined with importance sampling. (iii) Solve the planning problem using nested generalized Benders decomposition21 and finalize results. The resulting large-scale mixed-integer planning problem is solved using a nested generalized Benders decomposition framework. Operational subproblems and the planning master problem are iterated until convergence. Finalize results by recording the optimal capacities, operational schedules, and associated costs, and output them for further analysis and validation.
Formulate the optimization model
The capacity-planning model for integrated wind-solar-storage-transmission bases in arid regions minimizes the system life-cycle cost, including construction/maintenance and production/operational components. Construction cost is a deterministic function of planned capacities of wind, PV, storage, and transmission, while operational cost is obtained from a sequential production simulation that captures practical operating performance under uncertainty. The sequential simulation comprises a day-ahead scheduling stage (scenario-wise unit commitment using forecasted wind/PV/load to set generator on/off states and dispatch) and an intraday real-time adjustment stage (thermal dispatch, tie-line regulation, storage operation, renewable curtailment, and, if necessary, load shedding) that mitigates deviations and yields the cost impact of forecast errors. Uncertainty is modeled at two levels: (i) day-ahead forecast uncertainty, represented by multiple sampled wind–PV–load scenarios from historical data with independent UC solutions; and (ii) intraday deviations, represented by representative quantiles of forecast-error distributions to estimate adjustment costs and ensure sufficient operational flexibility.
Formulating the objective function
The overall objective of the planning model is to minimized the overall cost, including the construction cost Ccons and the operation cost Copt of the wind–solar–thermal–storage energy base22
(1)
The construction cost for each facility type i ∈ {W, P, S, T} is formulated as:
(2)
where Si is installed capacity, and βcons,i, γcons,i are linear and quadratic cost coefficients. I
= W denotes wind power, P photovoltaic, S storage, and T transmission.
The quadratic coefficient γcons,i reflects the nonlinear scaling of construction cost with installed capacity, capturing economies (or diseconomies) of scale based on typical engineering practice.
The sequential production simulation employs a multi-objective cost formulation21, in which the total operational cost Copt is expressed as the sum of thermal generation cost CH, load-shedding penalty Crel, carbon emission cost CCO2, electricity trading cost CT, and intraday regulation cost Creg:
(3)
The thermal generation cost is formulated as:
(4)
where uH,t,g denotes the on/off state of thermal unit g at time t (binary), PH,t,g is its output, and αg, βg, and γg are the fixed, linear, and quadratic cost coefficients, respectively.
The load-shedding penalty is formulated as:
(5)
where uloss,t is the load-shedding indicator (binary) at time t, Ploss,t is the curtailed load, and τL and ρloss,0 are penalty coefficients reflecting supply reliability requirements.
The carbon emission cost is formulated as:
(6)
where χCO2 is the carbon penalty factor, PT,t is tie-line power (positive for imports), and ξgrid and ξH,g are the emission coefficients of grid imports and thermal unit g, respectively.
The electricity purchase/sales cost is formulated as:
(7)
where πT,b,t and πT,s,t are the purchase and sales prices of electricity at time t, respectively.
The intraday adjustment cost is formulated as:
(8)
where cT, cL, and cWP are the unit costs for tie-line adjustments, demand-side management, and renewable curtailment, respectively. ΔPTL,t and ΔPTU,t are tie-line adjustments for net load lower and higher than forecast, respectively; ΔPL,t denotes demand-side adjustments under net-load surplus; and ΔPWP,t is the curtailed renewable output under net-load deficit.
The intraday adjustment cost quantifies the expense incurred due to real-time deviations from day-ahead forecasts. When net load exceeds forecasts, upward adjustments in thermal generation, tie-line imports, or demand-side interventions are required. Conversely, when net load falls below forecasts, downward thermal dispatch, tie-line exports, or renewable curtailment is employed to maintain system balance.
Formulating the constraints
The constraints are formulated as follows:
Thermal unit output constraints
(9)
where SH,g denotes the capacity of thermal unit g, and
and
represent the maximum and minimum output factors of unit g, respectively.
Wind and PV output constraints
(10)
where SW and SP are the installed capacities of wind and PV, respectively, and
and PP,t represent their outputs at time t. The coefficients
and
denote the maximum output factors of wind and PV at time t.
Battery output constraints
(11)
where PS, t is the battery power (positive for discharge), while PS, ch, t and PS, dis, t represent charging and discharging power at time t, respectively.
Battery charging/discharging exclusivity
(12)
where uS, ch, t is a binary variable indicating battery charging status (1 for charging via the grid, 0 for discharging), and SS, P denotes the rated power capacity of the battery.
Battery energy balance
(13)
where ES,t is the stored energy at time t, and ηch and ηdis denote charging and discharging efficiencies, respectively.
Transmission power constraints
(14)
where PT,b,t and PT,s,t represent purchased and sold power through the transmission line at time t.
Transmission purchase/sales exclusivity
(15)
where uT,b,t is a binary variable indicating power purchase (1 for importing from the grid, 0 for exporting to the grid).
Energy balance constraint
(16)
where PL,t is the local load demand, and Ploss,t is the curtailed load at time t.
Minimum online capacity constraint
(17)
where Smin,sys denotes the minimum required online capacity of local thermal units.
Minimum up/down time constraints
(18)
where vg,t and wg,t are binary variables indicating startup and shutdown of unit g at time t, and TU and TD denote the minimum up and down times of thermal units.
Determining production costs solely via day-ahead unit commitment is insufficient to capture flexibility challenges induced by forecast errors. It also fails to properly reflect the economic value of flexibility resources in ensuring secure and reliable operation.
Due to the inherent variability of wind and PV, net load experiences dynamic fluctuations during intraday operation. To address this, intraday regulation cost modeling is introduced to quantify the economic impacts of flexibility resources and their adequacy in mitigating deviations under uncertainty.
Figure 1 illustrates the concept of intraday adjustment and the associated adjustment costs. The horizontal axis represents the power. The light purple marker denotes the day-ahead forecast of net load, corresponding to the scheduled power generation and interchange. The actual intraday net load may deviate from this forecast, which is characterized by the cyan probability density curve. To accommodate these deviations, thermal units and tie-lines can be adjusted relative to the day-ahead schedule, indicated by the navy arrow and the pink arrow, respectively. The hatched shaded area highlights the portion of net load deviations that cannot be covered by the available adjustment capacity. Such uncovered deviations may lead to renewable energy curtailment or load shedding, which in turn affects energy balance and supply security while introducing additional risks and costs.

Figure 1: Illustration of day-ahead scheduling and intraday adjustment. Please click here to view a larger version of this figure.
At time t, upward spinning reserve RU,t and downward spinning reserve RD,t are defined as:
(19)
Forecast errors exist for wind, PV, and load. In general, load forecasts are generally more accurate, while PV forecasts exhibit greater error. When the load is overestimated and renewable output is underestimated, the system faces surplus power, requiring significant downward regulation. Conversely, underestimated load and overestimated renewable output result in supply shortages, necessitating substantial upward regulation.
To fully evaluate flexibility needs, two extreme scenarios are constructed: one dominated by upward regulation requirements and the other by downward regulation requirements. At time t, upward and downward flexibility demands LU,t and LD,t are expressed as:
(20)
where σL, σW, and σP are constants determined by the forecast accuracies of load, wind, and PV, respectively.
Upward flexibility is sequentially supplied by thermal generation, tie-line imports, and demand-side management, while downward flexibility is provided by thermal generation, tie-line exports, and renewable curtailment:
(21)
Generating the samples
Obtain historical data: PV output, wind power output, load demand, and electricity price time series are downloaded from the open power system data repository20. The timestamps and preprocess missing values are aligned using linear interpolation (interp1 function in MATLAB). Each parameter is divided into 15-min intervals, resulting in 96 data points per day for each variable.
Fit probability distributions: Beta distributions are fitted for PV output, Weibull distributions for wind output, normal distributions for load demand with embedded daily/seasonal cycles, and log-normal distributions for purchase and selling prices.
Generate scenarios using Latin hypercube sampling and importance sampling. The cumulative distribution of each parameter is divided into 20 equally probable intervals, and one value is sampled from each interval to form representative daily scenarios23. LHS samples (50–100) are generated per parameter for robust coverage. IS is applied to oversample the top 10% and bottom 10% quantiles of forecast-error distributions to capture rare but critical events24.
In this study, five sources of uncertainty are considered: PV output, wind power output, load demand, purchase price, and selling price. To appropriately represent the temporal variability and statistical characteristics of these uncertain parameters within the optimization model, probability distribution models are selected based on the historical observations and the physical attributes of each parameter. Sampling and scenario construction are subsequently performed according to these models.
Within this framework, a "scenario" is defined as a set of five time-series profiles—PV output, wind output, load, purchase price, and selling price—spanning an entire day and discretized at intervals of 15 min. By sampling each uncertain parameter and combining them, multiple representative daily operating conditions are generated. These scenarios are then used to simulate system operation under various stochastic perturbations, thereby enhancing the robustness and adaptability of the resulting planning decisions.
Regarding the choice of probability distribution models, PV output is typically modeled using Beta or Weibull distributions, capturing its skewness and saturation effects caused by variations in solar irradiance and cloud cover. Wind power output is generally represented by a Weibull distribution due to its strong dependence on stochastic wind speed fluctuations. Load demand is commonly assumed to follow a normal distribution, often with embedded periodic components to reflect daily and seasonal cycles. Meanwhile, purchase and selling prices, owing to their log-normal characteristics and occasional price jumps, are typically modeled using log-normal distributions.
Because a larger number of samples significantly increases the computational scale of the model and reduces solution efficiency, it is necessary to compress the sample set while retaining representativeness. To achieve this, two complementary sampling techniques are employed. First, Latin Hypercube Sampling is used to ensure more uniform coverage of the input space. Second, Importance Sampling is applied to oversample probability regions with higher operational significance, thereby improving the representation of rare but critical events.
Solving the model using nested generalized benders decomposition
MATLAB R2023a is opened, and the CPLEX 12.10 solver is configured. The sdpvar function in YALMIP is used to define all decision variables. The samples are generated in MATLAB according to the previous section. Each scenario is stored as a 5 × 96 matrix. The objective and constraints are formulated as YALMIP expressions, following the optimization model described in previous sections. For each scenario, the sequential production simulation subproblem is solved by calling the optimize function in YALMIP with CPLEX as the solver. Optimal solutions are extracted and dual variables are obtained calling the dual function to construct upper-level feasibility cuts21. The master problem is formulated and solved in YALMIP using the optimize function with CPLEX as the solver. Inner and outer loops are iterated. Alternatively, operational (y) and planning (z) decisions are updated by repeating the solving first level decomposition step, and it is repeated until the gap between upper and lower bounds21 is below a prescribed convergence tolerance 10-6. The upper and lower bounds at each iteration are recorded for convergence monitoring.
Detailed calculation formulas and further explanations of these steps are provided in the remainder of this section. Let the continuous variables in the scheduling problem be denoted by x, the integer variables by y, and the continuous variables in the planning problem by z. The scenario set is {ξd}d∈D. Under each scenario, the original model can thus be expressed in the following compact form:
(22)
where P represents the construction cost, while Q denotes the cost components related to unit commitment and dispatch.
The stochastic planning model is solved by a nested GBD21. GBD has been extensively applied to power system planning25 and scheduling26. Compared to heuristic algorithm27, the nested GBD framework offers scalability and guaranteed convergence properties. Nested GBD extends the conventional GBD approach by introducing a multi-level subproblem structure.
In the first-level decomposition, a subproblem is constructed for each scenario. For a given scenario ξd and a given decision variable z = zl, the sequential production simulation problem is formulated as:
(23)
After solving the subproblems across all scenarios, an upper-level feasibility cut is generated as:
(24)
where θu is an auxiliary variable introduced to represent the cost of the subproblem.
The master problem, representing the upper-level planning problem, remains:
(25)
For each scenario ξd, the sequential operation simulation problem is further decomposed. The lower-level subproblem under a given y = yk is a nonlinear programming (NLP) problem:
(26)
From its solution, a mid-level feasibility cut is derived as:
(27)
where θm is an auxiliary variable introduced to represent the cost of the lower-level subproblem.
The mid-level master problem, corresponding to the integer programming layer, is then expressed as:
(28)
At the outer level, for a fixed planning decision z = zl a per-scenario subproblem is solved to obtain optimal
and duals; these produce upper-level feasibility cuts, where θu aggregates subproblem cost contributions. The outer master problem then updates z by minimizing P(z)+θu subject to the accumulated cuts.
For each scenario, the sequential operation simulation is itself decomposed by an inner GBD. Holding integer operational decisions y = yk, the lower-level NLP is solved to yield primal/dual solutions and mid-level cuts, while the mid-level master updates integer y. The solution procedure alternates inner and outer loops: initialize l= 0, k = 0 with z0,y0, solve inner subproblems to generate mid/upper cuts, update masters to obtain yk and zl, and iterate. The optimal objective of the resolved subproblems provides an upper bound, and the master problems furnish a lower bound; convergence is declared when their gap is closed or below a prescribed tolerance. This nested GBD framework thus handles hierarchical decision layers and scenario coupling while retaining scalability and theoretical convergence guarantees. The overview of the protocol is shown in Figure 2.

Figure 2: Overview of the proposed protocol. Please click here to view a larger version of this figure.