Skip to 0 minutes and 10 secondsLet us now familiarise ourselves with the basic principles of optimisation problems. If we want to set up a model, we need only two ingredients. First, we need something that we actually can optimise, the objective of our model. Second, our model requires side constraints that we need to take into account while looking for the optimum. Let's use a little example first to get an idea how such an optimisation looks before we address the more general aspects. We have a simple energy market outlet and want to analyse which power plants ensure cost optimal supply of our demand. The objective naturally is the costs we want to minimise.

Skip to 1 minute and 1 secondThe costs are given by the generation costs of the different power plants, k, indicated by the ck, and the actual output of those plants indicated by the qk. Now, for the side constraints, you have to consider the different power plants won't be able to produce infinite energy. You will need a production constraint for the plants that ensures that the output of a plant cannot exceed its installed capacity, the q max. Finally, we need to ensure that our total output of all power plants is sufficient to cover consumer demand. And that's it. This is how a simple little optimisation model looks like. Not that complicated, is it?

Skip to 1 minute and 52 secondsIn a more general sense, the two elements, objective and constraints, follow some basic structures that allow you to easily design and combine different elements into sophisticated optimisation models. First and foremost, an optimisation model will need one and only one objective that it can either minimise or maximise. In economic models, this mainly boils down to minimising costs or negative impacts like emissions, environmental damage or health effects. Or to maximise profits, social benefits, welfare, happiness or some other value indicator. They do not necessarily need to be money. But in many economic models, we rely on monetary indicators. The side constraints ensure that our model captures the underlying system aspects and defines the solution space of our model.

Skip to 2 minutes and 52 secondsFor optimisation problems, these can either be inequality or equality constraints. The most common formulation of inequality constraints are lower equal formulations to define some upper limits. These normally represent capacity constraints like maximum production possibilities. Greater equal constraints capture lower limits. These can define minimum output restrictions or demand and input requirements. Mathematically, upper and lower bounds can be transferred into each other. But the distinction helps to link the real world setting with our model. Finally, there are equality constraints that capture definitions. In order to keep a model readable, it often helps to define specific variables where equalities are used in newly defined variable and other equations.

Skip to 3 minutes and 51 secondsAnother important form of equality constraints are balances that link different time periods with each other or input and output side. Summing up, the basic concepts of optimisation models are simple and straightforward. Nevertheless, they are powerful tools that can help you model even highly complex systems. Many large scale energy system models are based on optimisation formulations. The main challenge is to translate your problem into something with a single objective.

# Optimization models

Optimization models focus on identifying the best option out of all the possible ones by defining a single target that is either to be minimized or maximized while accounting for side constraints.

An optimization problem has the general form of:

(1)

(2) s.t.

(3)

Equation (1) represents the desired **objective** function, . Note that minimizations (or maximizations) can be transformed into maximizations (minimizations) by multiplying the objective function by -1 (ie, ).

Equation (2) represents **equality constraints** covering all constraints that have to hold with equality (eg, flow conservation constraints or temporal balances) and definitions.

Equation (3) represents **inequality constraints** covering upper and lower limits (eg, production capacities). Lower equal and greater equal formulations can be transferred into each other by multiplying the constraint by -1.

Note that you will not necessarily need all types of constraints for all models. Even if the detailed design depends on the underlying focus of your model, the overall model layout will always follow the above-described structure. For example, if you want to design a market model you will need constraints for the supply side, the demand side, and their market interaction. The structure of optimization models makes it easy to add or withdraw elements from a model by simply changing the formulation of the side constraints (ie, adding a further technical restriction).

Optimization models are often used to represent benchmark market conditions. They can easily obtain least-cost or welfare maximizing solutions that correspond to a perfect competitive market environment. Many large scale, bottom-up energy market models follow an optimization approach and include several technical side constraints to capture the underlying energy conversion and transport mechanics.

#### Recommended readings

In the literature recommendation below, you will find a simple natural gas market model (Neumann et al. 2009) and an electricity network model (Leuthold et al. 2008) examples. Both models follow a welfare maximizing approach. In the gas model, the constraints capture the gas transport via pipelines, ship (both require a network topology), and intertemporal storage. In the electricity model, the physics of power flows have to be included (again requiring a network topology) as well as power plant characteristics (introducing binary variables, more on this in Week 5) and pumped storage dynamics. Market models following those two examples are typically relatively easy to design as they have a limited set of needed equations. Nevertheless, they allow us to analyse and evaluate market challenges and thereby provide a good starting point for numerical modelers.

Neumann, A. et al. (2009). *InTraGas - A Stylized Model of the European Natural Gas Network*. Dresden University of Technology.

Leuthold, F. et al. (2008). ELMOD - A Model of the European Electricity Market. Dresden University of Technology. (Journal Version: Leuthold, F. et al. (2012). A large-scale spatial optimization model of the European electricity market. *Networks and spatial economics*, 12(1), pp. 75-107.)

For those that want to get more familiar with GAMS as modeling software: the initial GAMS tutorial uses a simple transport optimization problem to introduce the different features of GAMS.

© University of Basel