The increasing global demand for electricity, coupled with growing concerns about environmental pollution and resource scarcity, has propelled renewable energy sources (RES) like wind and photovoltaic (PV) power into the spotlight of power system research. Their renewable and environmentally friendly nature makes them highly attractive. However, the inherent intermittency and stochasticity of RES generation introduce significant uncertainty into their power output. This unpredictability poses considerable challenges to power grid stability, power quality, and reliable operation. To maintain system security, some regions are forced to curtail wind and solar power, leading to a substantial reduction in the utilization of these clean resources. Microgrids, which enable the integrated operation of distributed generation, energy storage, and loads within a localized network, present an effective technological solution for enhancing renewable energy consumption. Within this framework, the optimal coordination of Battery Energy Storage Systems (BESS) and Demand Response (DR) programs is crucial for achieving economic and reliable microgrid operation.
The integration of an energy storage battery system into a microgrid serves multiple critical functions. Primarily, it mitigates the impact of renewable generation uncertainty by storing excess energy during periods of high RES output and discharging during deficits. Furthermore, BESS can provide rapid frequency regulation, voltage support, and enhance overall system resilience. From an economic dispatch perspective, the energy storage battery allows for energy arbitrage—charging when electricity prices (or generation costs) are low and discharging when they are high—thereby optimizing operational costs. However, a key factor often overlooked in scheduling models is the aging of the energy storage battery. Each charge and discharge cycle contributes to battery degradation, incurring a long-term cost that must be internalized into the operational optimization to avoid sub-optimal, degradation-intensive scheduling.

Demand Response (DR) offers a complementary approach to managing supply-demand imbalances. DR mechanisms incentivize end-users to adjust their consumption patterns in response to grid conditions. DR can be broadly categorized into Price-Based DR (PBDR) and Incentive-Based DR (IBDR). PBDR influences consumption through dynamic pricing signals (e.g., Time-of-Use, Real-Time Pricing), encouraging users to shift loads from peak to off-peak periods. IBDR involves direct contracts or payments to users for committing to load reductions or increases when requested by the system operator. Effective modeling of IBDR requires designing appropriate compensation mechanisms that reflect the value and certainty of the response provided.
This article addresses the multi-time scale optimal operation of a microgrid considering detailed models for energy storage battery aging and a structured DR framework. For the energy storage battery, we employ a cycle aging model that accurately accounts for degradation costs from irregular, non-ideal charge-discharge cycles typical in microgrid dispatch. For IBDR, we design a stepwise compensation mechanism that offers different payment rates based on the level of load adjustment committed. Integrating these models with PBDR and accounting for wind power uncertainty, we formulate a two-stage “day-ahead and intra-day” stochastic optimization model. The model aims to minimize total expected operational cost while ensuring system constraints are met. The effectiveness of the proposed approach is validated through numerical case studies.
Modeling of Battery Energy Storage and Demand Response
Energy Storage Battery Modeling
Aging Cost Model
The operational lifetime of an energy storage battery is primarily determined by its cycling degradation, which is strongly influenced by the Depth of Discharge (DOD) per cycle. A common representation is the cycle life versus DOD curve, which specifies the maximum number of complete charge-discharge cycles (from full charge to a specified DOD and back) the battery can endure before reaching its end-of-life (EOL) capacity threshold (often 80% of initial capacity). The aging per full equivalent cycle at a given DOD can be expressed as the reciprocal of the cycle life at that DOD. The State of Charge (SOC) is related to DOD by $SOC = 1 – DOD$. Therefore, we can derive a function $f(SOC)$ that maps the battery’s SOC to its cumulative “aging degree” based on the cycle life curve.
To estimate the degradation cost for arbitrary, non-ideal charge-discharge profiles typical in microgrid scheduling, we adopt a “rainflow”-inspired method. The incremental aging for a time step is approximated by half the difference in the aging degree function $f(SOC)$ evaluated at the beginning and end of the step. This method effectively captures the stress from partial cycles. The total aging degree $DOA_z$ over the scheduling horizon $T$ is:
$$DOA_z = \sum_{t=1}^{T} \frac{1}{2} | f(SOC_t) – f(SOC_{t-1}) |$$
Assuming the battery reaches its end-of-life when it has lost 90% of its economic value, the aging cost $F_{age}$ associated with a schedule is calculated based on the battery’s replacement cost $F_{rep}$:
$$F_{age} = (F_{rep} – 0.1 \times F_{rep}) \times DOA_z = 0.9 \times F_{rep} \times DOA_z$$
This cost is included in the operational objective function, ensuring the scheduler balances immediate economic benefits against long-term asset degradation.
Operational Constraints
The physical and operational limits of the energy storage battery are modeled with the following constraints:
Power and Charge/Discharge Logic:
$$0 \leq P^{B,c}_t \leq z^{B,c}_t P^{B,c}_{\text{max}}$$
$$0 \leq P^{B,d}_t \leq z^{B,d}_t P^{B,d}_{\text{max}}$$
$$z^{B,c}_t + z^{B,d}_t \leq 1$$
Here, $P^{B,c}_t$ and $P^{B,d}_t$ are the charge and discharge powers, $z^{B,c}_t$ and $z^{B,d}_t$ are binary variables preventing simultaneous charge and discharge, and $P^{B,c}_{\text{max}} = P^{B,d}_{\text{max}}$ is the rated power.
State of Charge (SOC) Limits:
$$SOC_{\text{min}} \leq SOC_t \leq SOC_{\text{max}}$$
Energy Dynamics:
$$E^B_t = (1 – \lambda) E^B_{t-1} + \eta^{B,c} P^{B,c}_t \Delta t – \frac{P^{B,d}_t}{\eta^{B,d}} \Delta t$$
where $E^B_t$ is the energy stored, $\lambda$ is the self-discharge rate, $\eta^{B,c}$ and $\eta^{B,d}$ are charge and discharge efficiencies, and $\Delta t$ is the time interval.
Demand Response Modeling
Incentive-Based DR (IBDR) with Stepwise Compensation
We categorize IBDR by notification time: Type A (day-ahead, 24h notice), Type B (intra-day, 15 min to 2h notice), and Type C (real-time, 5-15 min notice). A stepwise compensation mechanism is designed, analogous to tiered electricity pricing, to reflect the increasing marginal cost of securing deeper load adjustments. The compensation price per kWh increases as the level of committed load adjustment (as a percentage of the customer’s maximum adjustable load) increases.
For a given DR type (e.g., Type A), let $P^{IB,A}_{g,t}$ be the load adjustment (positive for reduction, negative for increase) called upon from participants in tier $g$ at time $t$. The total adjustment is $P^{IB,AZ}_t = \sum_{g=1}^{N_g} z^{IB,A}_{g,t} P^{IB,A}_{g,t}$, where $z^{IB,A}_{g,t}$ is a binary variable indicating if tier $g$ is activated. The tier limits and associated compensation cost $C^{IB,A}_t$ are:
$$\gamma_{g-1} P^{IB,A}_{\text{max}} \leq P^{IB,A}_{g,t} \leq \gamma_{g} P^{IB,A}_{\text{max}}$$
$$C^{IB,A}_t = \sum_{g=1}^{N_g} z^{IB,A}_{g,t} \cdot m^{IB,A}_g \cdot P^{IB,A}_{g,t}$$
where $\gamma_g$ are the tier boundary coefficients (e.g., 0%, 50%, 75%, 100%), $P^{IB,A}_{\text{max}}$ is the maximum aggregate adjustable load for Type A, and $m^{IB,A}_g$ is the compensation price for tier $g$. Similar models apply to Type B and C DR.
Price-Based DR (PBDR)
PBDR is modeled using the concept of demand elasticity. The elasticity matrix $U$ captures the relationship between relative changes in load demand and electricity prices. For a time horizon $T$, the load response is given by:
$$\begin{bmatrix} \frac{\Delta d_1}{d_1} \\ \frac{\Delta d_2}{d_2} \\ \vdots \\ \frac{\Delta d_T}{d_T} \end{bmatrix} = U \begin{bmatrix} \frac{\Delta m_1}{m_1} \\ \frac{\Delta m_2}{m_2} \\ \vdots \\ \frac{\Delta m_T}{m_T} \end{bmatrix}$$
where $d_t$ and $m_t$ are the original demand and price, and $\Delta d_t$, $\Delta m_t$ are their changes. The actual load adjustment $P^{PB}_t$ at time $t$ after implementing a new price signal is:
$$P^{PB}_t = \frac{\Delta d_t}{d_t} \times P^L_t$$
where $P^L_t$ is the forecasted baseline load.
Multi-Time Scale Microgrid Optimization Model
We propose a two-stage stochastic optimization framework to handle uncertainty, particularly from wind power. The first stage (day-ahead) makes commitment and baseline scheduling decisions, while the second stage (intra-day) performs adjustments based on updated forecasts and realization of uncertainty.
Day-Ahead Scheduling (First Stage)
Objective Function: Minimize the total expected cost over a 24-hour horizon with 1-hour intervals. Costs include:
- Controllable Micro-source (CM) costs: Start-up cost, quadratic fuel cost, O&M cost.
- Wind Power O&M cost.
- Energy storage battery O&M cost and aging cost $F_{age}$.
- IBDR compensation costs (for Type A and B).
- Wind curtailment penalty cost.
- Cost of power exchange with the main grid.
The stochastic formulation considers multiple wind power scenarios $s$ with probability $\rho_s$:
$$\min F^{1st} = \sum_{t=1}^{T_{1st}} \sum_{n=1}^{N_{CM}} z^{CM}_{n,t}(1-z^{CM}_{n,t-1}) S_n + \sum_{t=1}^{T_{1st}} \sum_{s=1}^{N_s} \rho_s \Bigg[ \sum_{n=1}^{N_{CM}} \big( a_n (P^{CM}_{n,t,s})^2 + b_n P^{CM}_{n,t,s} + c_n \big) + \sum_{n=1}^{N_{CM}} m^{CM}_n P^{CM}_{n,t,s} + m^W P^W_{t,s} + m^B (P^{B,c}_{t,s}+P^{B,d}_{t,s}) + F^{age}_s + \sum_{g=1}^{N_g} m^{IB,B}_g (P^{IB,B+}_{g,t,s}+P^{IB,B-}_{g,t,s}) + c^W (P^{W,act}_{t,s} – P^W_{t,s}) \Bigg] + \sum_{t=1}^{T_{1st}} \sum_{g=1}^{N_g} m^{IB,A}_g (P^{IB,A+}_{g,t}+P^{IB,A-}_{g,t}) + \sum_{t=1}^{T_{1st}} m^{ex}_t P^{ex}_t$$
Key Constraints:
- Power Balance: For each scenario $s$ and time $t$:
$$\sum_{n=1}^{N_{CM}} P^{CM}_{n,t,s} + P^W_{t,s} + P^{B,d}_{t,s} – P^{B,c}_{t,s} + P^{ex}_t = P^{L1}_t + P^{PB}_t + \sum_{g=1}^{N_g} (P^{IB,A+}_{g,t} – P^{IB,A-}_{g,t}) + \sum_{g=1}^{N_g} (P^{IB,B+}_{g,t,s} – P^{IB,B-}_{g,t,s})$$
Note that Type A DR decisions $P^{IB,A}_{g,t}$ and grid exchange $P^{ex}_t$ are “here-and-now” first-stage decisions, common across all scenarios. - CM unit constraints (min/max power, ramping, min up/down time).
- Wind power constraint: $0 \leq P^W_{t,s} \leq P^{W,act}_{t,s}$.
- Energy storage battery constraints as defined previously.
- IBDR tier constraints for Type A and B.
- Grid exchange power limits.
Intra-Day Scheduling (Second Stage)
Objective Function: Minimize the dispatch costs over a rolling 4-hour horizon with 15-minute intervals, based on updated forecasts. The cost includes CM fuel and O&M, wind O&M, energy storage battery O&M and aging, IBDR compensation (for Type B and C), wind curtailment penalty, and spinning reserve provision cost $C^R_t$:
$$\min F^{2nd} = \sum_{t=1}^{T_{2nd}} \Bigg[ \sum_{n=1}^{N_{CM}} \big( a_n (P^{CM}_{n,t})^2 + b_n P^{CM}_{n,t} + c_n \big) + \sum_{n=1}^{N_{CM}} m^{CM}_n P^{CM}_{n,t} + m^W P^W_{t} + m^B (P^{B,c}_{t}+P^{B,d}_{t}) + F^{age} + \sum_{g=1}^{N_g} m^{IB,B}_g (P^{IB,B+}_{g,t}+P^{IB,B-}_{g,t}) + \sum_{g=1}^{N_g} m^{IB,C}_g (P^{IB,C+}_{g,t}+P^{IB,C-}_{g,t}) + c^W (P^{W,act}_{t} – P^W_{t}) + C^R_t \Bigg]$$
where $C^R_t = \sum_{n=1}^{N_{CM}} m^R (R^{CM+}_{n,t} + R^{CM-}_{n,t})$ with $m^R$ as the reserve cost coefficient.
Key Constraints:
- Power Balance: Updated with intra-day load forecast $P^{L2}_t$ and all DR types:
$$\sum_{n=1}^{N_{CM}} P^{CM}_{n,t} + P^W_{t} + P^{B,d}_{t} – P^{B,c}_{t} + P^{ex}_t = P^{L2}_t + P^{PB}_t + \sum_{g=1}^{N_g} (P^{IB,A+}_{g,t} – P^{IB,A-}_{g,t}) + \sum_{g=1}^{N_g} (P^{IB,B+}_{g,t} – P^{IB,B-}_{g,t}) + \sum_{g=1}^{N_g} (P^{IB,C+}_{g,t} – P^{IB,C-}_{g,t})$$ - Chance-Constrained Spinning Reserve: To handle residual uncertainty in wind and load within the intra-day stage, spinning reserve requirements are formulated as chance constraints with a confidence level $\alpha$ (e.g., 0.95):
$$\text{Pr}\Bigg\{ \sum_{n=1}^{N_{CM}} P^{CM}_{n,t} + P^W_{t} + P^{B,d}_{t} – P^{B,c}_{t} + \sum_{n=1}^{N_{CM}} R^{CM+}_{n,t} \geq \tilde{P}^{L2}_t + \sum DR \Bigg\} \geq \alpha_1$$
$$\text{Pr}\Bigg\{ \sum_{n=1}^{N_{CM}} P^{CM}_{n,t} + P^W_{t} + P^{B,d}_{t} – P^{B,c}_{t} – \sum_{n=1}^{N_{CM}} R^{CM-}_{n,t} \leq \tilde{P}^{L2}_t + \sum DR \Bigg\} \geq \alpha_2$$
Here, $\tilde{P}^{L2}_t$ represents the uncertain intra-day load, and $\sum DR$ represents the net effect of all DR programs. These constraints ensure sufficient upward and downward reserve is scheduled to cover imbalances with a high probability. - All other constraints from the day-ahead model (for CM, BESS, DR) apply within the intra-day horizon, using updated parameters.
Solution Methodology
The formulated model contains non-linear terms from the quadratic fuel cost and the energy storage battery aging function $f(SOC)$. These are linearized using piecewise linear approximation techniques. The chance constraints for spinning reserve are converted into deterministic equivalents using uncertainty distribution information (e.g., assuming a normal distribution for forecast errors). The resulting large-scale Mixed-Integer Linear Programming (MILP) problem for each stage can be solved efficiently using commercial solvers like CPLEX or Gurobi, called via modeling environments such as YALMIP in MATLAB or Pyomo in Python.
Case Study and Analysis
A microgrid case study is constructed to validate the proposed model. The system includes three conventional diesel generators (CMs), a wind farm, and an energy storage battery system. Key parameters are summarized below.
| Parameter | CM1 | CM2 | CM3 |
|---|---|---|---|
| Max Output (kW) | 200 | 150 | 100 |
| Min Output (kW) | 20 | 15 | 10 |
| Fuel Cost Coeff. $a_n$ ($/(kW^2h)) | 0.0002777 | 0.0001389 | 0.0002083 |
| Fuel Cost Coeff. $b_n$ ($/(kWh)) | 0.02777 | 0.04166 | 0.04166 |
| Fuel Cost Coeff. $c_n$ ($/h) | 47.9636 | 34.1744 | 17.9829 |
| Start-up Cost ($) | 2.200 | 3.305 | 2.200 |
| Ramp Rate (kW/min) | 8 | 7 | 6 |
| Parameter | Value |
|---|---|
| Rated Power / Capacity | 80 kW / 320 kWh |
| SOC_min / SOC_max | 0.1 / 0.9 |
| Charge/Discharge Efficiency | 90% |
| Cycle Life at 80% DOD | 10,000 cycles |
| Replacement Cost, $F_{rep}$ | $2,422.67 per unit |
| DR Type | Tier (Load Adjustment Share) | Compensation Price ($/kWh) |
|---|---|---|
| Type A (Day-Ahead) | 0% – 50% | 0.091 |
| 50% – 75% | 0.105 | |
| 75% – 100% | 0.210 | |
| Type B (Intra-Day) | 0% – 50% | 0.108 |
| 50% – 75% | 0.125 | |
| 75% – 100% | 0.250 | |
| Type C (Real-Time) | 0% – 50% | 0.130 |
| 50% – 75% | 0.150 | |
| 75% – 100% | 0.280 |
Wind power uncertainty is represented by two typical daily profiles: a negative peak-shaving profile (high output at night, low during day) and a positive peak-shaving profile (output correlates with daytime load). Using Latin Hypercube Sampling and scenario reduction, a set of representative scenarios is generated for the day-ahead stochastic optimization.
Optimization Results Analysis
Scheduling results under the two wind profiles demonstrate the model’s effectiveness.
1. Resource Dispatch: Under the negative peak-shaving wind profile, the mismatch between high wind output at night and low load requires significant use of the energy storage battery for charging, and often results in selling power to the main grid if possible. During the daytime peak, the energy storage battery discharges, and all types of DR are called upon to reduce net load. In contrast, the positive peak-shaving profile shows better natural alignment, leading to less stress on the energy storage battery and lower DR activation.
2. Role of the Energy Storage Battery: The energy storage battery consistently performs energy arbitrage and peak shaving. It charges during low-cost periods (low load, high wind) and discharges during high-cost periods (peak load). The schedule respects its aging cost, avoiding excessive deep cycles when not economically justified. The dispatch power of the energy storage battery is more pronounced in the negative peak-shaving scenario to manage the larger supply-demand mismatch.
3. DR Activation: DR resources are primarily activated during peak hours for load reduction. The stepwise mechanism allows the optimizer to procure the most cost-effective blocks of flexibility first. As expected, total DR utilization is higher in the scenario with less favorable wind patterns (negative peak-shaving).
Comparative Analysis of DR Models
To highlight the advantage of the proposed stepwise IBDR model, we compare it with a conventional single-price Interruptible Load (IL) model in a scenario without BESS.
| Metric | Proposed Stepwise IBDR Model | Conventional Single-Price IL Model |
|---|---|---|
| Total DR Compensation Cost | $806.36 | $105.32 |
| Wind Curtailment Rate | 0.26% | 0.71% |
| Total System Operating Cost | $10,634.41 | $11,575.52 |
The results are telling. While the conventional model achieves an 86.9% lower DR payment, it leads to a 173% higher wind curtailment rate and an 8.85% increase in total system operating cost. The single-price IL model, offering only load interruption at a fixed price, provides less flexibility and leads to sub-optimal economic dispatch. Our stepwise IBDR model, by offering both load increase and decrease services at tiered prices, enables a more nuanced and cost-effective utilization of demand-side flexibility, ultimately minimizing the overall system cost despite higher direct DR payments.
Conclusion
This paper presents a comprehensive framework for the multi-time scale optimal operation of a microgrid, with a focus on the synergistic integration of a detailed energy storage battery model and a structured Demand Response program. The key contributions are threefold.
First, incorporating an accurate aging cost model for the energy storage battery is crucial for sustainable economic dispatch. By accounting for degradation from irregular cycling, the optimizer schedules the energy storage battery in a way that balances immediate economic benefits against long-term asset life, ensuring its use for both energy shifting and ancillary services is truly cost-optimal over its lifespan.
Second, the proposed multi-time scale (day-ahead and intra-day) stochastic optimization strategy effectively manages uncertainty from renewable sources. It allows for coordinated scheduling of resources with different response characteristics: day-ahead commitments for slow resources, intra-day adjustments for faster resources like the energy storage battery and certain DR types, and real-time reserves for residual uncertainty. The stepwise compensation mechanism for IBDR provides a realistic and economically efficient way to procure flexibility, outperforming traditional single-price interruptible load models by enabling more granular and cost-effective load adjustments.
Finally, the case studies demonstrate that the co-optimization of the energy storage battery and multi-type DR significantly enhances the microgrid’s ability to integrate variable renewable generation. The model successfully reduces operational costs, minimizes renewable curtailment, and leverages the fast response capabilities of the energy storage battery alongside the flexibility of demand-side resources. This integrated approach is essential for developing resilient, economical, and sustainable modern microgrids.
