# Demand-Response Control in Smart Grids
## 3 Generic Formal Model for Demand Response
### Consumer Agent Model  
The Consumer Agent (CAi) is responsible for monitoring energy usage, responding to price signals, and making decisions about when to purchase or reduce energy consumption. The consumer agent can also be used to provide feedback on the performance of the smart grid system. Each consumer agent has some constraints, such as its minimum and maximum requested power, its present running state, and the available production. The consumer agent cannot work well in any circumstance involving a power amount out of its required bounds, \(\pi_{i}^{\min}\) and \(\pi_{i}^{\max}\). Here, \(\pi_{i}^{\min}\) and \(\pi_{i}^{\max}\) indicate the minimum and maximum power that is required by the consumer agent.  
Therefore, the required consumed power \(\pi_{i,t}\) for the consumer agent CAi at the time slot \(t\) has to satisfy  
\[\pi_{i,t}^{\min}\leq\pi_{i,t}\leq\pi_{i,t}^{\max} \tag{1}\]  
where \(\pi_{i,t}^{\min}\) and \(\pi_{i,t}^{\max}\) represent the power limits for the consumer agent CAi at time slot \(t\), under the following constraint:  
\[\begin{array}{l}\pi_{i,t}^{\min}=\max\Big{\{}\pi_{i}^{\min},\pi_{i,t}-s_{i} ^{d}\Big{\}}\\ \pi_{i,t+1}^{\max}=\min\big{\{}\pi_{i}^{\max},\pi_{i,t}+s_{i}^{u}\big{\}}\end{array} \tag{2}\]  
where \(s_{i}^{u}\) and \(s_{i}^{d}\) represent the ascent and descent limitations of the ramp, respectively, by the consumer agent constraints. Therefore, it is possible to represent these limits on a consumer agent's power usage \(\pi_{i,t}\) in the following way:  
\[\pi_{i}^{\min}\leq\pi_{i,t}^{\min}\leq\pi_{i,t}\leq\pi_{i,t}^{\max}\leq\pi_{i }^{\max} \tag{3}\]  
Figure 1: Auction classification according to bidding sides, sold resources, bid composition, and the role of the participants.  
The overall minimum and maximum required power limits of all consumer agents at time slot \(t\) can be calculated as follows:  
\[\begin{split}\pi_{t}^{\text{min}}&=\sum\limits_{i=1}^{N }\pi_{i,t}^{\text{min}}\\ \pi_{t}^{\text{max}}&=\sum\limits_{i=1}^{N}\pi_{i,t}^ {\text{max}}\end{split} \tag{4}\]  
where \(N\) represents the number of consumer agents.  
Consequently, the total required power inside the smart grid is expressed as follows:  
\[\begin{split}\pi_{t}&=\sum\limits_{i=1}^{N}\pi_{i,t }\\ subject&\text{to}\ \pi_{t}^{\text{min}}\leq\pi_{t}\leq\pi_{t}^ {\text{max}}\end{split} \tag{5}\]  
The utility function \(U(\pi_{i},\omega)\) for the Consumer Agent (CAi) is defined such that, where \(\pi_{i}\) is the consumer agent's power consumption level and \(\omega\) is a parameter that may vary throughout agents and at different times of the day. In more formal terms, the utility function for each consumer agent defines the consumer agent's level of satisfaction as a function of its power consumption. In most cases, a quadratic utility function is used to represent the profit obtained by Consumer Agent (CAi) when he consumes the power.  
A consumer agent \(i\) must pay a price \(P\times\pi_{i}\) of dollars per hour for consuming \(\pi_{i}\) kW electricity for a particular number of hours at \(P\) dollars per kWh. As a result, each consumer agent \(i\)'s welfare \(W(\pi_{i},\omega)\) can be estimated as follows:  
\[W(\pi_{i},\omega)=U(\pi_{i},\omega)\ -\ P\times\pi_{i} \tag{6}\]  
Each consumer agent \(i\) tries to regulate its power consumption \(\pi_{i}\) to maximize its private comfort for each announced price value \(P\).