\documentclass[11pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{epsfig}
%\usepackage{myfancyheadings}

\setlength{\parindent}{0.0in} \setlength{\parskip}{0.08in}

\setlength{\textheight}{8.5in}
\setlength{\textwidth}{5.9in} %.7
\setlength{\topmargin}{-.48in}
\setlength{\oddsidemargin}{.1in} %.29

\frenchspacing
\parskip=1ex plus .25ex minus .25ex

%\pagestyle{fancy} \rhead{\rm\thepage} \cfoot{}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{algorithm}[theorem]{Algorithm}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{example}[theorem]{Example}
\newcommand{\boexample}{\noindent {\bf Example. }}
\newcommand{\boremark}{\noindent {\bf Remark. }}
\newcommand{\boproof}{\noindent {\bf Proof. }}
\newcommand{\eoproof}{\hspace*{\fill} $\square$ \vspace{5pt}}

\title{Electric Grid Operation Formulation}

\author{DLW}

\date{}

\begin{document}
%\setcounter{page}{0}

\maketitle

%\begin{abstract}
%For discussion.
%\end{abstract}
%\vspace{1.0in}
{\bf Keywords:} Energy
%\newpage
%\setcounter{page}{1}


\section{Introduction}

The single stage, fixed capacity, deterministic operation model.

\subsection{Data}

\subsubsection{Time}

This formulation will be deterministic and for one time period (where this one time period will be on the order of years). However, there will be demand profile ``times'' such as summer weekday 11pm to 6am, summer weekday 6-10,  winter weekend day, winter weekend night, etc. I would think there might be dozens or even scores of these but probably not hundreds. These will be a set $\mathcal{H}$, indexed by $h$ each of which has a number of hours in the ``time period'' given by $F_h$. Depending on how long the ``single time period'' is, $F_h$ will be on the order of thousands of hours. (When I write the words ``time period,'' I am refering to the outer time periods that will be added when we go to the multi-stage model; i.e., $F_h$ will be $F_{ht}$ in
the multi-stage model.)

\subsubsection{Network, Supply, and Demand}

The network has nodes, $\mathcal{N}$, that can have non-negative demand given by $D_{ih}$ for $i \in \mathcal{N}$ and $h \in \mathcal{H}$ and zero or more supply types, $\mathcal{M}(i)$, each with capacity $P_{m},\; m \in \mathcal{M}(i), \; i \in \mathcal{N}$ given in kilowatts and cost per kilowatt hour produced of $C_{m},\; m \in \mathcal{M}(i), \; i \in \mathcal{N}$. Arcs are given by the set $\mathcal{A}$ and have capacity $K_{a}, \; a \in \mathcal{A}$ and loss fraction $L_{a}, \; a \in \mathcal{A}$, which would be given as 0.05 for a line with a 5\% loss. The set of arcs out of node are given by $\mathcal{O}(i) \subset \mathcal{A}$ and
the set of arcs into node $i$ given by $\mathcal{I}(i) \subset \mathcal{A}$. Note that multiple arcs are possible between any two nodes and it is also
possible to have an arc from a node to itself but this will generally be obviated by an impicit ability for a node to supply itself due to the way the flow balance constraint is written.

\subsubsection{Summary of Data}

The data that must be fed to the optimization model are summarized in Table~\ref{tab:OpDataNeeds}.

\begin{table}[!htbp] \caption{Summary of Data for Network Operating Model.\label{tab:OpDataNeeds}}
\centering 
\begin{tabular}{||c|l|l||}
\hline \hline
Symbol & Meaning & Units \\
\hline
$\mathcal{H}$ & Set of demand profile time slots & \\
$F_h$ & Total time in profile slot $h$ & hours \\
$\mathcal{N}$ & Set of nodes & \\
$\mathcal{A}$ & Set of arcs & \\
$\mathcal{O}(i)$ & Set of arcs out of node $i$ & \\
$\mathcal{I}(i)$ & Set of arcs into node $i$ & \\
$D_{ih}$ & Demand at node $i$ during demand slot $h$ & kW \\
$\mathcal{M}(i)$ & Set of production modes at node $i$ & \\
$P_m$ & Capacity of production mode $m$ & kW \\
$C_m$ & Production cost for production mode $m$ & \$/kWh \\
$K_a$ & Capacity of arc $a$ & kW \\
$L_a$ & Loss fraction for arc $a$ & \\
\hline \hline
\end{tabular}
\end{table}

\subsection{Decision variables}

The number of kilowatts to produce at node $i$ using supply type $m$ during demand profile time $h$ will be given by $x_{imh}$ and the flow put on arc $a$ during profile time $h$ will be $y_{ah}$. Note that in this simple model, production is modeled as constant over the demand profile time slot (as is demand), hence it is given in kilowatts.

\subsection{A Model}

This is a min-cost operating model.

$$
\min_{x,y} \sum_{h \in \mathcal{H}}\sum_{i \in \mathcal{N}}\sum_{m \in \mathcal{M}(i)}F_{h}C_{m}x_{imh}
$$
subject to

\begin{eqnarray}
\label{constraint:flowbalance}
\sum_{m \in \mathcal{M}(i)}x_{imh} + \sum_{a \in \mathcal{I}(i)}(1-L_{a})y_{ah} & = & \sum_{a \in \mathcal{O}(i)}y_{ah} + D_{ih}, \;\; i \in \mathcal{N},\; h \in \mathcal{H}  \\
\label{constraint:nodecap}
x_{imh} & \leq & P_{m}, \;\; i \in \mathcal{N},\; m \in \mathcal{M}(i), \; h \in \mathcal{H}  \\
\label{constraint:arccap}
y_{ah} & \leq & K_{a}, \;\; a \in \mathcal{A},\; h \in \mathcal{H}  \\
x,y & \geq & 0
\end{eqnarray}


Constraints (\ref{constraint:flowbalance}) specify that flow must be balanced. 
The left hand side gives the quanity generated by the node plus the flow into the node while the right
hand side gives the flow out of the node plus the demand at the node. Note these flow balance constraints imply 
that production at a node can be used to satisfy demand at that node without using an arc 
(if that is not true, then there are really two nodes and the data should be specified in that way). 
Constraints (\ref{constraint:nodecap}) assure that
production modes are not used in excess of their capacity. Constraints (\ref{constraint:nodecap}) specify that arcs are not 
used in excess of their capacity. Line loss is accounted for in the flow balance constraints.

\subsection{Instance Sizes}

For California, I'm thinking on the order of less than 1000 nodes, less than 100 demand profile periods, an average of way less than 10 production modes per node (since many will have zero) and maybe only 10,000 interesting arcs or maybe way less. So I'm thinking way less than one million x variables and way less than one million non-zero y values. So far, everything is continuous. There would be less than one hundred thousand flow balance constraints, but that is still a lot. I will, of course, start with a very small, low resolution instance.

\subsection{Stuff to add to this model}

Water use and capacity (not so easy to do because this resource is shared across production types and even across nodes based on policies), 
emission limits(?), storage(?), spin-up (which adds integers).

\section{Multi-stage}

I envision maybe as many as six time stages with the first few being a year or two long and the later stages being more than five years. We would want to add at least the following features:
\begin{enumerate}
\item Fixed costs for production (i.e. costs for each $m \in \mathcal{M}(i)$) that are stage dependent
\item Variables (and associated costs) to conduct a project to add a production type, decommission a production type, increase capacity or decrease production cost (which should imply the ability to mothball projects started in earlier stages and revive mothballed projects). The number of stages that a project would need to be active in order to bring the capacity online would, of course, depend on the type of capacity and the length of the stage. 
\end{enumerate}

If there are going to be six stages, the average branching factor in the scenario tree would have to be down around four or five (definitely way less than 10), although there could be rich branching in some parts of the tree and not-so-rich in other parts. The heck of it is, though, that early branches create scenarios a lot faster than late branches, but we will typically want more resolution in the early stages of the scenario tree. There will have to be tradeoffs between the number of stages and the richness of the branching. A branching factor of 4 or 5 seems too low for this kind of modeling, so we might have to get creative.

\end{document}
