# External vs. internal

One important aspect when designing a model is to determine which variables are exogenous and which are endogenous. This determination is directly followed by the question of which is the variable you are actually interested in analyzing.

Let’s use our cost minimization model as an example:

(1) \(SC = \sum_{k, l}(c_{k}^{inv}\cdot\ q_{k}^{max}+ c_{k}^{var} \cdot\ \phi_l^k \cdot\ q_{k}^{max}) + scc \cdot\ \sum_ke_{k}+ snc \cdot\ q_{Nuclear}^{max}\)

s.t.

(2) \(\sum_k\phi_l^k \cdot\ q_k^{max} = d_l\)

(3) \(e_k = \epsilon_k \cdot\ {\sum}_{l=1}^4 \phi_l^k \cdot\ q_k^{max}\)

For the exercise you were asked to decide about \(scc\) (social costs of carbon) and \(scn\) (social costs of nuclear energy). So, you could think those are the relevant model variables, as those are the ones you are interested in and of which you want to test the impact.

However, for the underlying mathematical model those are external values similar to the costs for the different power plants (exogenous variables). From a model’s perspective the ‘choice variables’ are those values that are determined by the model process (endogenous variables); the variables the model can adjust to obtain the optimal solution. In our minimization model, the choices are the amount of installed capacity \(q_k^{max}\) and for coal, gas, and nuclear, the share of production during the modeled hours \(\phi_l^k\).

All other values are fixed: the costs \(c_k^{inv}\) and \(c_k^{var}\), the demand for each hour \(d_l\), the emission factors, \(\epsilon_k\), for the different power plants, the hourly supply factors for wind, \(\phi_l^{Wind}\), and PV, \(\phi_ l^{PV}\), and your choice of \(scc\) and \(scn\). For the model they are external variables (often termed parameters or exogenous variables). Values that do not change during the solving process and are not determined by the model but by the modeler – you!

Now, that still leaves \(e_k\). Within the model this is a definition of how the emission values for the different technologies are derived based on their hourly output, \(\phi_l^k \cdot\ q_k^{max}\), and their emission factor, \(\epsilon_k\). You could replace the \(e_k\) in the objective function with the formulation in equation (3) and would obtain the same model results. But often it is more helpful to include specific definitions of model aspects to keep the overall model more traceable for the user instead of minimizing the number of variables within the model.

Summarizing, for the model all values that are fixed and not determined by the solution of the model are external or exogenous variables while those that are determined by the model are endogenous variables. Later in the course we will have a short look at how to address the data gathering and handling of those two variable types.

Nevertheless, this leaves the question how your two ‘choice variables’, *scc* and *scn*, fit into the bigger picture. After all, those are the economic variables you want to analyze. In the model exercise you were free to vary their values and obtained the resulting optimal supply mix as model output.

Naturally, you could do the same with all other parameters; for example, how does the model outcome change if you assume a change in power plant costs or if you assume a higher wind and solar availability? To decide which set of external parameters to test for, you first have to answer the follow up question: which choices are you interested in analyzing? Or, in other words, what was the problem you originally wanted to answer with your model?

If we assume that the impacts of carbon prices and nuclear risk premiums are your main concern, you should design your model with those two factors in mind. Keep all other external variables on reasonable levels and then derive a set of scenarios with different *scc* and *scn* values. This will allow you to determine the impact the two factors have on the supply mix and hopefully allow you to draw some first conclusions.

You are always free to extend and verify your finding by running sensitivity simulations and also by varying other external variables; for example, whether your conclusion about the impact of carbon prices still holds if renewable power plants become significantly cheaper. But don’t try to include all of those right from the start. You will likely end up not being able to identify whether your cost assumptions or your carbon price assumptions drive the result.

© University of Basel