# Perfect competition as example

In the last step we took a dive into the underlying mathematics of our models. To get a better understanding of what this means for your model design, we now use our simple energy system logic to design an optimization model and an equilibrium model that will result in the same outcomes.

The setup is the same for both. We assume a perfectly competitive market in which producers aim to maximize their short run profit given their cost function. Consumers aim to maximize their benefit derived from consuming electricity.

In an optimization setting, you know that you need to combine the individual objectives (firm’s profits and consumer benefit) into a single objective, . As we assume perfect competition, this is easily doable by maximizing the welfare in our system (as discussed in an earlier step). Consequently, the objective function for the social planner looks like this:

(1)

represents the benefit function of consumers (how much utility they derive from their demand ) and the profits from the firm. represents the generation costs of firm .

As side constraints you will again need to ensure that total supply is sufficient to cover demand. Clearly, demand cannot be less than 0:

(2)

If you would derive the Karush–Kuhn–Tucker (KKT) conditions of the Lagrangian formulation of these two equations you would obtain the optimality conditions defining which level of supply and demand maximizes welfare. Let’s just focus on the two decision variables: . Again, you will need to derive the first order condition of the model with respect to the two variables and set them equal to zero:

(3)

(4)

The is again the Lagrangian multipliers on the side constraint.

Equations (4) and (5) together with the side constraint (2) tell you the optimality criteria for your model.

Ok, let’s shortly switch to the equilibrium world and design the same problem in an equilibrium setting. Here we have firms maximizing profits, consumers maximizing their benefit, and a market that brings the two sides together.

You know that firms will only produce if the marginal costs are covered. Using this zero-profit logic you can write their equilibrium conditions as follows:

(5)

This formulation is the mathematical equivalent of our equilibrium logic. Either the firm has a positive output () in which case the left hand side of equation (5) needs to hold with equality (); or the firm does not produce () in which case the left hand side is in inequality (). The perpendicular sign allows us to write this combination a bit more compactly.

The same logic holds for the consumer side:

(6)

Consumers will only consume energy if the marginal benefit they can derive () is at least as large as the price they have to pay for it.

Now all you need is the market clearing condition to finalize your equilibrium model:

(7)

Similar to the zero-profit equations this formulation is the mathematical way of describing the market clearing logic: if we have a positive market price () it means the supply and demand side are in balance (). If we have oversupply () the market price is zero ().

Now if you compare equation (5) to (7) of the equilibrium model with equation (2) to (4) of the optimization model you may see some similarities:

Equation (3) tells us that in the optimum, the marginal benefit of consumers is equal to . The same holds for the marginal costs of each firm in the optimum (equation (4)). And this is linked to the constraint that in the equilibrium total supply and demand have to be balanced.

Now this is basically the same story you designed with the equilibrium model. If supply and demand are equal, equation (7) tells us that the resulting market price, , will be positive. And if you neglect the non-trivial equilibrium of having zero and and production (which are balanced by definition) this also means positive production and demand levels. Equation (5) and (6) tell you that in this case the marginal costs of the firms have to be equal to the market price and the marginal benefit of consumers also has to be equal to the market price.

If you now replace the symbol for the market price, , with some Greek letter, say , you see that those are basically the same results. The only difference is that the equilibrium model is formulated in a more general sense (those are conditions that need to hold for the market to be in equilibrium) whereas the optimization equations show the conditions that need to hold for the market to be in the equilibrium that optimizes welfare.

This relation between the two model approaches means two things with respect to analyzing your problem:

First, you are often free to choose one or the other type of model. As long as you can derive a single objective for an optimization you can also formulate an equivalent equilibrium version of your model.

Second, the equilibrium logic of who is doing what (activity) when (zero-profit) and how market prices are related to supply and demand (market clearing) also holds when analyzing your optimization model results. The underlying economic logic is the driving force of the two models. So, a solid understanding of incentives and market dynamics will help you to design, solve, and interpret your models, regardless of what specific model setup you have chosen.

© University of Basel