2.1 Application of stochastic dynamic programming
Simulation-based approaches and stochastic programming are some of the most utilized methods in energy-system optimization and investment as they allow for a straightforward way to analyze decisions under uncertainty [
3,
5,
12]. In the context of this paper, a simulation-based approach, i.e., SDP, will be chosen to analyze and compare scenarios that differ in relation to various key parameters. Several simulations will be run where the capacity of installed DER will be fixed at various levels where the sample paths of prices and loads will be the same across the problem instances. These are then simulated for different realizations of the uncertain parameters, and the final operational decisions will be made by means of decision analysis. With an understanding of the cause-and-effect dynamics of a system, SDP can process dynamic and also non-linear outcomes related to the underlying uncertainty of the stochastic variables. Although SDP does not handle risk ex ante as rigorously as say mixed-integer linear programming (MILP) based on stochastic programming, it allows ex-post assessment of the level of risk via varying the level of DER investment. As the minimization of the objective function belongs to the class of sequential scheduling problems, SDP is a suitable solution framework [
12]. The flexibility and adaptability of SDP in the context of microgrid simulation has been demonstrated by a multitude of different studies. It can also be adjusted to different forms of objective functions (cost, energy consumption, emission reduction, etc.), along with adoption of different DER types and constraints [
13‐
15]. Additionally, this form also allows us to integrate financial risk measures like the conditional value-at-risk (CVaR) [
16].
Nevertheless, possible limitations for applications of a simulation-based SDP approach to microgrid modeling should also be addressed. From a methodological point of view, issues can occur when simulation is applied to American-style options. When DER units have start-up costs or ramping constraints, the future distribution of cash flows given the current state is not going to be independent of the past. Longstaff and Schwartz have developed a least-squares Monte Carlo simulation approach to solve this issue [
17]. Additionally, computational effort, increasing dimensionality, and the need for deep causal understanding mean that most applications will be strongly simplified to fit in the model, which can leave out important attributes that should be considered. In the context of this paper, simplifications could leave out the lifetime of a DER generator or the maximum fraction of electricity demand to be met by demand response.
As the research question aims to answer how much expected cost can be saved and risk mitigated via the integration of DER at a semiconductor plant, the objective is to minimize the expected discounted cost of the energy used over a test year. To achieve this, the DER equipment has to be fixed first. There are several ways to approach this objective, e.g., [
18] used a deterministic approach by solving a mixed-integer linear program that includes amortized capital costs, whereas [
19] applied a real options approach to value the investment in DER. [
20] used a MILP model to design a microgrid model that also allows for the integration of energy subsidies. This paper follows [
13] by fixing the capacity of DER at several levels and running a simulation to minimize the expected discounted cost of meeting the energy demand. A key difference between [
13] and the current work is that the former is based on California data, viz., prices are from 2006–2007 and demand data are from a nursing home with quite a different correlation coefficient between electricity and heating loads (−0.91). By contrast, the current work applies the model in a completely different context and with more recent prices. As future energy prices are stochastic, an SDP approach has to be used with simulated prices. [
21], for example, used Monte Carlo simulation to simulate future volatile energy prices. [
22] used a non-linear Markov regime-switching model to forecast energy prices, which may be superior when it comes to long-term forecasting. [
23] argue that mean-reverting price processes are a better tool for forecasting commodities, at least oil prices. Here, the approach is to solve the optimal DER scheduling problem under uncertainty for various levels of installed capacity. It is also assumed that the microgrid is under a real-time pricing tariff, which means that the per-MWh charge varies daily based on the utility’s real-time production costs.
The objective function of the SDP is the weighted average of the annualized costs and CO
2 emissions based on the parameter
\(0\leq \alpha \leq 1\). Since the SDP includes both stochastic electricity and natural gas prices, the minimized value function,
Vt(
Ψt), consisting of the weighted expected discounted operating cost as well as CO
2 emissions, starts at the beginning of day
t given current electricity and natural gas prices.
\(\Psi _{t}\equiv \left\{EP_{t}{,}FP_{t}\right\}\) is the set of the stochastic state variables (electricity price and natural gas price) at time
t. The DER technologies’ capacities are taken as fixed and dispatched optimally. The cost of the amortized DER investment is taken as given and added to the minimized operating cost at
\(t=1\). For sake of simplicity,
Costt(
Ξt;
Ψt) is the period‑
t weighted operating cost and
Emissionst(
Ξt;
Ψt) the corresponding CO
2 emissions.
$$\Xi _{t}\equiv \left\{\begin{array}{c} \mathrm{Gen}_{i{,}t}{,}\text{DGHeat}_{t}{,}\text{NGHeat}_{t}{,}\text{EPurchase}_{t}{,}\\ \text{EDResponse}_{t}{,}\text{HDResponse}_{t} \end{array}\right\}$$
is the set of all decision variables at time
t. A nomenclature of the symbols used with the units of measurement can be found in Appendix A.
Therefore, the SDP (1)-(10) is based on [
13] and has to be solved from any day
t specified as follows:
$$V_{t}\left(\Psi _{t}\right)=\min _{\Xi _{t}}\frac{\alpha }{\textit{DNCost}}\mathrm{Cost}_{t}\left(\Xi _{t};\Psi _{t}\right)+\frac{\left(1-\alpha \right)e^{\mathrm{r}\Updelta \mathrm{t}}}{\textit{DNEmissions}}E\text{missions}_{t}\left(\Xi _{t};\Psi _{t}\right)+e^{-\mathrm{r}\Updelta \mathrm{t}}E_{{\Psi _{t}}}\left[V_{t+1}\left(\Psi _{t+1}\right)\right]$$
(1)
where
$$\mathrm{Cost}_{t}\left(\Xi _{t};\Psi _{t}\right)\equiv {\sum }_{i=1}^{I}\mathrm{Gen}_{i{,}t}\text{OMVar}_{i}+{\sum }_{i=1}^{I}\mathrm{Gen}_{i{,}t}\frac{\left(FP_{t}+\text{FTDCharge}_{t}\right)}{\mathrm{EEff}_{i}}+\text{EPurchase}_{t}\left(EP_{t}+\text{ETDCharge}_{t}\right)+\text{NGHeat}_{t}\frac{\left(FP_{t}+\text{FTDCharge}_{t}\right)}{HEff}+\textit{EDRCost}\,\text{EDResponse}_{t}+\textit{HDRCost}\,\text{HDResponse}_{t}$$
(2)
and
$$\text{Emissions}_{t}\left(\Xi _{t};\Psi _{t}\right)\equiv {\sum }_{i=1}^{I}\mathrm{Gen}_{i{,}t}\frac{\textit{NGCRate}}{\mathrm{EEff}_{i}}+\text{NGHeat}_{t}\frac{\textit{NGCRate}}{HEff}+\text{EPurchase}_{t}\textit{UCRate}$$
(3)
Note that the day-t cost in (2) consists of variable DER operating and maintenance (O&M) cost, DER fuel cost, the cost of electricity purchased from the utility, the cost of natural gas purchased from the utility to meet heat loads, and costs associated with demand response. In a similar vein, (3) comprises day-t CO2 emissions from DER operations, natural gas used to meet heat loads, and electricity purchased from the utility.
The objective function in (1) is subject to the following constraints and terminal conditions:
$$V_{T}\left(\Psi _{T}\right)=\min _{\Xi _{T}}\frac{\alpha }{\textit{DNCost}}\mathrm{Cost}_{T}\left(\Xi _{t};\Psi _{t}\right)+\frac{\left(1-\alpha \right)e^{\mathrm{r}\Updelta \mathrm{t}}}{\textit{DNEmissions}}\text{Emissions}_{T}\left(\Xi _{T};\Psi _{t}\right)$$
(4)
(4) states the minimized terminal value function.
$$\mathrm{Gen}_{i{,}t}\leq \text{DGInv}_{i}\mathrm{MaxP}_{i}\overline{h}\forall i{,}t$$
(5)
(5) states that the operating level of DER generation
i during day
t is less than or equal to the installed available capacity of generator
i every day.
$$\text{EDResponse}_{t}+{\sum }_{i=1}^{I}Gen_{i{,}t}+\text{EPurchase}_{t}=\text{EDemand}_{t}\forall t$$
(6)
(6) states that electricity demand response during day
t in addition to the operating level of DER generators during day
t in addition to the electricity purchased from the central utility during day
t must equal the overall demand for electricity during day
t to balance the electricity system.
$$\text{DGHeat}_{t}\leq {\sum }_{i=1}^{I}HR_{i}\mathrm{Gen}_{i{,}t}\forall t$$
(7)
(7) states that the heat load met from DER generation during day
t must be less than or equal to the amount of useful heat produced by DER generators during day
t. Selling excessive heat to cities or the macrogrid is a possible, useful feature of a microgrid, and our model can be easily modified to incorporate such decisions.
$$\text{HDResponse}_{t}+\text{DGHeat}_{t}+\text{NGHeat}_{t}=\text{HDemand}_{t}\forall t$$
(8)
(8) states that the heat demand response during day
t in addition to the heat load met from DER generation during day
t in addition to the heat load met from natural gas purchases during day
t must be equal to the heat demand during day
t to balance the heat system.
$$\text{EDResponse}_{t}\leq \textit{MaxEDR}\,\text{EDemand}_{t}\forall t$$
(9)
(9) states that the electricity demand response during day
t must be less than or equal to the maximum electricity demand to be met by demand response during any day.
$$\text{HDResponse}_{t}\leq \textit{MaxHDR}\,\text{HDemand}_{t}\forall t$$
(10)
(10) states that the heat demand response during the day t must be less than or equal to the maximum heat demand to be met by demand response during any day.
2.3 Selection and simulation of stochastic processes
The choice of stochastic price processes depends on the underlying modeling case they are applied to. In this paper, where CHP plays an important role as its employment directly influences the objective function, it is important to capture daily uncertainties as CHP technologies are able to respond to such uncertainties. One way to do this is by assuming that the logarithms of the deseasonalized electricity and natural gas prices,
Xt and
Yt, follow correlated mean-reverting Ornstein-Uhlenbeck (OU) processes, i.e.,
$$dX_{t}=\kappa _{X}\left(\theta _{X}-X_{t}\right)dt+\sigma _{X}dS_{t}$$
(11)
$$dY_{t}=\kappa _{Y}\left(\theta _{Y}-Y_{t}\right)dt+\rho \sigma _{Y}dS_{t}+\sqrt{1-\rho ^{2}}\sigma _{Y}dW_{t}$$
(12)
For processes above,
k can refer to
X or
Y, θk is the long-term average of the electricity/natural gas prices,
κk is the rate of mean reversion,
σk is the annualized price volatility, and
\(\rho =\rho _{xy}\frac{1}{2}\frac{\left(\kappa _{x}+\kappa _{y}\right)}{\sqrt{\kappa _{x}\kappa _{y}}}\), where
ρxy is the instantaneous correlation coefficient between
\(\left\{S_{t}{,}t\geq 0\right\}\) and
\(\left\{W_{t}{,}t\geq 0\right\}\), which are independent standard Brownian motion processes. Therefore, the natural logarithms of the electricity and natural gas prices are:
$$\ln EP_{t}=X_{t}+{f}_{t}^{X}$$
(13)
$$\ln FP_{t}=Y_{t}+{f}_{t}^{Y}$$
(14)
\({f}_{t}^{k}={\sum }_{l=1}^{[s/2]}({\gamma }_{1l}^{k}\cos \lambda _{l}t+{\gamma }_{1l}^{*k}\sin \lambda _{l}t)+{\sum }_{l=1}^{[s'/2]}({\gamma }_{2l}^{k}\cos {\lambda }_{l}^{'}t+{\gamma }_{2l}^{*k}\sin {\lambda }_{l}^{'}t)\) is the seasonality function that detects weekly and annual trends for
k =
X,
Y,
t = 1, …,
T,
s = 7, s’ = 365, and
$$\left[a/2\right]=\begin{cases} \ \frac{a}{2}\quad \text{if } a \text{ is even}\\ \frac{a-1}{2}\quad \text{otherwise} \end{cases}$$
(15)
Following the procedure in [
24], the parameters in the OU processes and the seasonality function are estimated.
The OU processes stated above can be simulated using two independent standard normal random variables
εX and
εY, distributed with a standard deviation of one each,
\(\varepsilon _{X}\)~
N(0.1) and
εY ~
N(0.1).
$$X_{t+1}=X_{t}k_{x}\left(\theta _{x}-X_{t}\right)\Delta t+\sigma _{X}\varepsilon _{X}\sqrt{\Delta t}$$
(16)
$$Y_{t+1}=Y_{t}+\kappa _{Y}\left(\theta _{Y}-Y_{t}\right)\Delta t+\sigma _{Y}\varepsilon _{Y}\sqrt{\Delta t}+\sqrt{1-\rho ^{2}}\sigma _{Y}\varepsilon _{Y}\sqrt{\Delta t}$$
(17)