A more realistic cost model for an electric power plant (but one that we use less often because it can be hard to find enough data to use this model) is that the total cost of generation is quadratic in the amount of electricity produced.

$$\text{TC}\left(\text{Q}\right)\text{=a+b}\times \text{Q+c}\times {\text{Q}}^{\text{2}}$$

where TC is total cost ($), Q is total output (MWh), and a, b and c are constants, then the marginal cost of electricity production is found by taking the derivative of the total cost function:

$$\text{dTC}\left(\text{Q}\right)/\text{dQ}\text{=b+cQ}$$

which is linear in total output Q.

Because the marginal cost functions here are linear, we can use calculus to figure out the solution to the economic dispatch problem. In the solution we present here, we'll assume that there are only two generators. The solution to the economic dispatch problem we'll find, however, is also true for cases where there are more than two generators.

Before we get into it, we'll define a few variables.

- g1 and g2 are the electric energy (MWh) outputs of our two power plants.
- C
_{1}(g1) and C_{2}(g2) are the total cost functions for the two power plants individually. - TC(g1 + g2) is the total cost function for the electric system as a whole. We can also write this as TC(g1 + g2) = C
_{1}(g1) + C_{2}(g2). - D is total demand (in MWh).

Economic dispatch is a kind of optimization problem. The electric utility wants to choose levels of g1 and g2 in order to minimize the total cost of serving all electricity demand. The utility is constrained by the fact that it has to meet all electricity demand. It cannot simply choose to black out some houses or businesses because they are too expensive to serve.

Mathematically, we state this optimization problem as:

$$\begin{array}{l}\underset{g1,g2}{\text{min}}\text{TC}\left(\text{g1+g2}\right)\\ \text{s}\text{.t}\text{.g1+g2=D}\end{array}$$

In calculus, you may have seen that you can find the maximum or minimum of a function by taking its derivative and setting that equal to zero. We'll basically do the same thing here. First, notice that since g1 + g2 = D, we get g2 = D - g1. Also, each generator's cost function depends only on that generator's output. So we can simplify this into a much easier problem that only depends on g1:

$$\underset{g1}{\text{min}}\text{TC}\left(\text{g1}\right)\text{=}\left[{\text{C}}_{\text{1}}\left(\text{g1}\right){\text{+C}}_{\text{2}}\left(\text{D-g1}\right)\right]$$

We will now take the derivative of this function and set it equal to zero. This is called the "first order condition" of the optimization problem, or FOC.

$$\begin{array}{l}\underset{g1}{\text{min}}\text{TC}\left(\text{g1}\right)\text{=}\left[{\text{C}}_{\text{1}}\left(\text{g1}\right){\text{+C}}_{\text{2}}\left(\text{D-g1}\right)\right]\\ \text{FOC:}\frac{\text{dTC}}{\text{dg1}}\text{=}\frac{{\text{dC}}_{\text{1}}}{\text{dg1}}\text{-}\frac{{\text{dC}}_{\text{2}}}{\text{dg1}}\text{=0}\\ \Rightarrow \text{}\frac{{\text{dC}}_{\text{1}}}{\text{dg1}}\text{=}\frac{{\text{dC}}_{\text{2}}}{\text{dg1}}\end{array}$$

Notice that the solution to the economic dispatch problem is to set g1 and g2 such that their marginal costs are identical. We will call these optimal level of energy outputs g1* and g2*.

This result also holds if we have more than two power plants. In this case we can find the system lambda by calculating the marginal cost for either generator at the optimal level (g1* or g2*).

A kind of recipe for solving economic dispatch problems with quadratic total costs (linear marginal cost) is:

- Calculate marginal cost functions for each generator.
- Set g2 = D - g1, and substitute in the marginal cost function for g2.
- Set the marginal cost functions equal, solve for g1* (optimal value of g1).
- Find g2* = D - g1*

#### Example

In this example we'll let C_{1}(g1) = 50g1+1.5g1^{2} and C_{2}(g2) = 100g2 + g2^{2}. We'll also set D = 50 MWh. Note that, at least for now, we aren't setting any capacity limits on the two generators. We'll introduce those later in the course.

First we calculate marginal cost functions for each generator:

- MC(g1) = 50+3g
_{1}= 50+3(50-g_{2}). Note here that we have made the substitution g1 = D - g2. - MC(g2) = 100+2g
_{2}

Next, we set MC(g1) = MC(g2) and solve for g2.

- 50+3(50-g
_{2}) = 100+2g_{2} - When we solve this equation, we get g
_{2}* = 20MWh - Finally we solve for G1* as: g
_{1}* = 50-g_{2}* = 30MWh

Thus, our economic dispatch is g1* = 30 MWh and g2* = 20 MWh.

To calculate the system lambda, we take either g1* or g2* and plug it back into the respective marginal cost function. Note that we can do this with either marginal cost function, or we could do it with both as a kind of check.

$$\text{MC}\left(\text{g1}\right)\text{=MC}\left(\text{g2}\right){\text{=50+3g}}_{\text{1}}{\text{*=100+2g}}_{\text{2}}\text{*=}\text{\$140}/\text{MWh}{\text{=\lambda}}_{\text{sys}}$$

Finally, we return to the total cost functions for the two generators to get the total system cost of serving 50 MWh of electricity demand:

- TC(g1) = 50 × 30 + 1.5×302 = $2,850
- TC(g2) = 100 × 20 + 202 = $2,400
- Total Cost = $5,250

#### Here's another example that you can try yourself.

The total cost functions for the two generators are C_{1}(g1) = 5 + 4g1+ g1^{2} and C_{2}(g2) = 5 + 2g2 + 2g2^{2}. Total demand for electricity is 30 MWh. Solve the economic dispatch problem. You should get:

- g1* = 19 2/3, g2* = 10 1/3
- The system lambda is λ
_{sys}= $43.33/MWh. - The total cost of serving all electricity demand is $709.67.