Distribution Utility

The Distribution Utility is responsible for per-broker and overall load balancing, and for accounting, during an Execution phase.

Balancing
The total net load should be zero. This is computed in each timeslot by adding up the net load from the Portfolio and broker position from the Wholesale Market for each broker, and summing across brokers. The result is net imbalance by broker, and overall net imbalance. Next, for each broker, the DU must access the balancing capacity for that broker. If there is sufficient balancing capacity, then the DU asserts the necessary balancing controls to bring that broker into balance.

After individual brokers have been balanced, there will be some residual imbalance. This is resolved in three steps:
 * 1) Reducing imports for brokers who are in surplus, in a way that does not reward brokers for buying excess power in the market, and only for imports that are not matched by exports of other brokers. We will assume for now that exports cannot be reduced.
 * 2) Cross-broker balancing. Remaining balancing capacity can be used to resolve imbalances, with accounting implications as listed below. To the extent possible, use of remaining balancing capacity will be spread evenly across brokers.
 * 3) Active balancing. If the remaining imbalance is a deficit (this is the most likely possibility, because unless the entire distribution grid is in surplus the imbalance would have been resolved by reducing imports), then the DU will apply its own balancing capacity (presumably some sort of spinning reserve) to handle the remaining imbalance.

Accounting
The DU is the entity that has the necessary visibility to do the accounting for the system. Assume there is a Bank with accounts for each Broker, and also for the DU. During an Execution phase, accounting tasks include:
 * 1) Distribution fees. Brokers are charged a fixed fee per kWh transferred across the DU's infrastructure. This includes all energy transfers for which the individual broker bears responsibility. In other words, if broker A has battery capacity that is used to match a surplus or deficit in broker B's portfolio, then the transfer fee is charged to broker B. As a regulated utility, the distribution fee is mostly used for infrastructure investment and maintenance, with a fixed profit margin. For simplicity, we assume the cost is immediately deducted when fees are paid, while the profit goes into the Bank.
 * 2) Payments for energy use or production. Each customer must make or receive payment for its usage or production according the the terms of its contract or tariff, regardless of whether such usage or production was the result of normal operation or of balancing activities initiated by the DU. These payments are paid to the broker at the end of each timeslot, in order to avoid the need for accrual accounting.
 * 3) Balancing fees. When a broker does not have the resources to achieve balance internally, the surplus must be absorbed or the deficit supplied by the DU, by one of the methods described in the previous section. There are several possibilities:
 * 4) *If a broker's wholesale imports are reduced, then presumably the broker has to pay for the commitment anyway, and must also pay a fee (a percentage of the bid price) to the DU to pay for the market intervention.
 * 5) *If a broker's balancing source (CHP or battery discharge, for example) is used to balance some other broker's deficit, then the broker in deficit must pay the full balancing power fee to the DU, and the DU pays the customer's broker for the power at the rate determined by the customer's contract. The broker must then pass this payment through to the customer, of course.
 * 6) *If a broker's balancing load (water heater or battery charger, for example) is used to balance some other broker's surplus, then the broker in surplus must pay the full balancing power fee to the DU, and the DU charges the customer's broker for the power at the rate determined by the customer's contract. The broker must then pass this charge through to the customer, of course.
 * 7) *If the DU's own resources are used to achieve balance (spinning reserve, for example), then the affected broker must pay the balancing fee to the DU.
 * 8) Dividends. The DU is either investor-owned or it is owned by some government unit. In either case, dividends must be paid periodically in order to make the investment attractive.