# Trading with an External Market¶

In urbs it is possible to model the trade with an external market. For this two new commodity types, buy and sell commodities are introduced. For each a time series representing the momentary cost at each timestep is given. This time series is of course known to the model in advance, which has two implications. First, the modeled system is considered too small to influence the external market and any possible influence is not captured by the model, and, second, the perfect price foresight can distort the results when compared to a realistic trader in a market. For models with buy and sell commodities the variable vector takes the following form:

where \(\varrho_{yvct}\) is the amount of sell commodity \(c\) sold to the external market in year \(y\) from vertex \(v\) at time \(t\) and \(\psi_{yvct}\) is the amount of buy commodity \(c\) bought from the external market in year \(y\) at vertex \(v\) and time \(t\).

## Costs¶

The cost function is amended by two new cost types when the trading with an external market is modeled, the purchase and the revenue costs

The two new cost types are then specified by the following equations:

where \(k^{\text{b}}_{yvct}\) and \(k^{\text{s}}_{yvct}\) represents the time series of the given buy and sell commodity prices respectively.

## Commodity Dispatch Constraints¶

Buy and sell commodities change the vertex rule (Kirchhoff’s current law), by adding a new way for in- an output flows of commodities. The rule is thus amended by the following two equations:

The commodity balance itself is not changed. The new rules state that any amount of energy sold needs to be provided to (negative CB) the system via processes, storages or transmission lines, while buy commodity consumed by processes, storages or transmission lines in the system has to be replenished.

### Buy/Sell Commodity Limitations¶

The trade with the market in each modeled year and each vertex can be limited per time step and for an entire year. This introduces the following constraints:

and

Here, the parameters \(\overline{b}_{yvc}\) and \(\overline{B}_{yvc}\) limit the hourly and yearly maximums of buy from and \(\overline{g}_{yvc}\) and \(\overline{G}_{yvc}\) the hourly and yearly maximum of selling to the external market.

This concludes the discussion of the modeled trading with an external market.