# Cost Analysis and Optimization of Modern Power System Operations
## 2 Mathematical Formulation  
Fuel costs, start-up costs, and shut-down costs constitute the three key operating cost components in any unit commitment problem. In the following section, a mathematical model for unit commitment cost calculation is developed, which forms the basis for the model implementation presented in the study. We start by minimizing the total cost of operation including fuel cost, shut-down cost, and start-up cost,  
\[\mathbf{minOf}=\sum_{i,t}\mathbf{FC_{i,t}}+\mathbf{STC_{i,t}}+\mathbf{SDC_{i,t}} \tag{1}\]  
where fuel cost (\(\mathbf{FC}\)) is given as follows,  
\[\mathbf{FCi}(\mathbf{Pi}(\mathbf{t}))=\mathbf{Ai}+\mathbf{BiPi}(\mathbf{t})+\mathbf{CiPi}^{2}(\mathbf{t}) \tag{2}\]  
To ensure safe and efficient operation of any power system network, the supply provided should be greater than or equal to load demand at all available times, and is given by the following equation,  
\[\sum_{i}\mathbf{P}\;\mathbf{i,t}\geq\mathbf{L}\;\mathbf{t} \tag{3}\]  
The above equations represent a basic form of unit commitment problem. However, in practical applications, additional physical, technical, and environmental limitations must be taken into account. The constraints typically considered in a unit commitment problem include minimum up/down time, ramp up/down time, minimum and maximum generating capacity, start-up/shut-down cost, running cost, fuel usage constraints, etc. To reduce the computational complexity of the optimization problem, the non-linear cost function is linearized using the following set of equations,  
\[0\leq\mathbf{p}_{i,k}^{k}\leq\;\Delta\mathbf{P}_{i}^{k}\;\mathbf{u}_{i,t}\;,\forall\;k=1: \mathbf{n} \tag{4}\]  
\[\Delta\mathbf{P}_{i}^{k}=\;\frac{\mathbf{P}_{i}^{max}-\mathbf{P}_{i}^{min}}{n} \tag{5}\]  
\[\mathbf{P}_{i,init}^{k}=(k-1)\Delta\mathbf{P}_{i}^{k}+\mathbf{P}_{i}^{min} \tag{6}\]  
\[\mathbf{P}_{i,fin}^{k}=\Delta\mathbf{P}_{i}^{k}+\mathbf{P}_{i,init} \tag{7}\]  
\[\mathbf{P}_{i,t}=\mathbf{P}_{i}\;\mathbf{u}_{i,t}+\;\sum_{k}\mathbf{P}_{i,t}^{k} \tag{8}\]  
\[\mathbf{s}_{i}^{k}=\;\frac{\mathbf{C}_{i,fin}^{k}-\mathbf{C}_{i,ini}^{k}}{\Delta\mathbf{P}_{i }^{k}} \tag{9}\]  
\[\mathbf{FCi,t}=\mathbf{a}_{i}\Big{(}\mathbf{P}^{min}\Big{)}^{2}+\mathbf{b}_{i}\;\mathbf{P}^{min}+ \mathbf{c}_{i}\;\mathbf{u}_{i,t}\;+\;\sum_{k}\mathbf{s}_{i}^{k}\;\mathbf{P}_{i,t}^{k} \tag{10}\]  
Constraints in power systems represent a range of technical and environmental restrictions that must be satisfied to ensure reliable and safe operation; failure to comply can result in significant operational issues. For this study, the following constraints are considered:  
* Ramp Rate Constraint: The increment and decrement in power output of generator per hour in spinning mode is called ramp rate. It is given by % per hour or MW per hour. For the \(i\)th unit at time \(t\), the ramp rate constraints are given as follows, \[\mathbf{FCi}(\mathbf{Pi}(\mathbf{t}))=\mathbf{Ai}+\mathbf{BiPi}(\mathbf{t})+\mathbf{CiPi}^{2}(\mathbf{t}) \tag{2}\]0 (11) \[\mathbf{FCi}(\mathbf{Pi}(\mathbf{t}))=\mathbf{Ai}+\mathbf{BiPi}(\mathbf{t})+\mathbf{CiPi}^{2}(\mathbf{t}) \tag{2}\]1 (12)\[\mathbf{FCi}(\mathbf{Pi}(\mathbf{t}))=\mathbf{Ai}+\mathbf{BiPi}(\mathbf{t})+\mathbf{CiPi}^{2}(\mathbf{t}) \tag{2}\]2 \[\mathbf{FCi}(\mathbf{Pi}(\mathbf{t}))=\mathbf{Ai}+\mathbf{BiPi}(\mathbf{t})+\mathbf{CiPi}^{2}(\mathbf{t}) \tag{2}\]3 (14) \[\mathbf{FCi}(\mathbf{Pi}(\mathbf{t}))=\mathbf{Ai}+\mathbf{BiPi}(\mathbf{t})+\mathbf{CiPi}^{2}(\mathbf{t}) \tag{2}\]4
* Minimum Up/Down time constraint: Due to physical and technical restrictions, a generator cannot be shut down or restarted instantaneously. Minimum Up/Down time represents the smallest time interval required that the generating unit must remain online or offline once started up or shut down, respectively. To model these constraints, three integer decision variables are introduced for each generating unit at each time period: \(u_{i,t}\) (operational status: ON/OFF), \(y_{i,t}\) (startup status), and \(z_{i,t}\) (shut-down status).