After defining the problem space, the next step in QSD is to automate the process of translating QSD inputs into a system inventory (i.e., all mass and energy flows entering and leaving the system), which can be accomplished by establishing mathematical representations of the system across its life cycle. This step in QSD leverages design algorithms and process algorithms, where design algorithms correspond to the construction and end-of-life stages and process algorithms correspond to the operation and maintenance stage. Both design and process algorithms are linked to QSD inputs such that the system performance -including mass and energy balances across life cycles -responds to changes in decision variables, technological parameters, and contextual parameters. For example, in designing a roadway drainage system, the choice of the stormwater conveyance element (grass swales, bioswales, or storm sewers) would be a discrete decision variable connecting with design algorithms to determine the mass of materials needed for construction (Table , Example 1). Similarly, technological parameters related to contaminant removal in grass swales and bioswales would connect with the contaminant mass balance using process algorithms. The following section illustrates the process of developing simulation algorithms to ensure there are mathematical connections between QSD inputs and indicators of interest.