# Flow module The flow module deals with parts of the LP-problem related to flow based market coupling (FBMC) which is an alternative to the more standard ATC (available transfer capacity) method. ## Input to the module FBMC employs a description of the power grid which uses PTDF-matrices in order to describe the relation between net positions and AC-line flow. In general, the PTDF-matrices are time-dependent. Therefore, a required input is a matrix valued time series, exposed through the API as an ['NDArrayTS'](lmndarrayts). The other input time series and their resource URLs, which have default values, are documented in the [flow module documentation](moduleflow). ## Algorithm Typically, the system of areas and lines for which FBMC is defined is a subset of the entire system. We impose a restriction in defining the FBMC system requiring a connected grid, and that each end of a line is also within the subsystem. For each master problem, a simulation with standard ATC constraints defined according to the transmission capacities in the system is performed. Based on the solution of this problem, the net positions of all FBMC areas are computed, and from them, the FBMC flows. If any of the FBMC flows exceed their allowed capacity, new constraints and penalty variables are added to the problem, prompting a new solution of the current master problem. This procedure continues until no additional constraints and variables are added. Since we are expecting the addition of constraints pertaining to a specific price segment will propagate to later price segments, which may lead to unecessary iterations, we add constraints and variables for all of them if any restriction is violated. ## Output As output, the module produces time series for the FBMC flow on each line in the FBMC system in addition to dual values corresponding to violation of the upper and lower limits of the flow constraints. The output time series and their resource URLs are documented in the [flow module documentation](moduleflow).