Comparative analysis of sanitation systems for resource recovery: Influence of configurations and single technology components

Resource recovery and emissions from sanitation systems are critical sustainability indicators for strategic urban sanitation planning. In this context, sanitation systems are the most often structured using technology-driven templates rather than performance-based sustainability indicators. In this work, we answer two questions: Firstly, can we estimate generic resource recovery and loss potentials and their uncertainties for a diverse and large set of sanitation systems? And secondly, can we identify technological aspects of sanitation systems that indicate a better overall resource recovery performance? The aim is to obtain information that can be used as an input into any strategic planning process and to help shape technology development and system design for resource recovery in the future. Starting from 41 technologies, which include novel and conventional options, we build 101,548 valid sanitation system configurations. For each system configuration we quantify phosphorus, nitrogen, total solids, and water flows and use that to calculate recovery potentials and losses to the environment, i.e. the soil, air, or surface water. The four substances cover different properties and serve as a proxy for nutrient, organics, energy, and water resources. For modelling the flows ex-ante, we use a novel approach to consider a large range of international literature and expert data considering uncertainties. Thus all results are generic and can therefore be used as input into any strategic planning process or to help guide future technology development. A detailed analysis of the results allows us to identify factors that influence recovery and losses. These factors include the type of source, the length of systems, and the level of containment in storage and treatment. The factors influencing recovery are related to interactions of different technologies in a system which shows the relevance of a modelling approach that allows to look at all possible system configurations systematically. Based on our analysis, we developed five recommendations for the optimization of resource recovery: (i) prioritize short systems that close the loop at the lowest possible level; (ii) separate waste streams as much as possible, because this allows for higher recovery potentials; (iii) use storage and treatment technologies that contain the products as much as possible, avoid leaching technologies (e.g. single pits) and technologies with high risk of volatilization (e.g. drying beds); (iv) design sinks to optimise recovery and avoid disposal sinks; and (v) combine various reuse options for different side streams (e.g. urine diversion systems that combine reuse of urine and production of biofuel from faeces). © 2020 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY license ( http://creativecommons.org/licenses/by/4.0/ )


a b s t r a c t
Resource recovery and emissions from sanitation systems are critical sustainability indicators for strategic urban sanitation planning. In this context, sanitation systems are the most often structured using technology-driven templates rather than performance-based sustainability indicators. In this work, we answer two questions: Firstly, can we estimate generic resource recovery and loss potentials and their uncertainties for a diverse and large set of sanitation systems? And secondly, can we identify technological aspects of sanitation systems that indicate a better overall resource recovery performance? The aim is to obtain information that can be used as an input into any strategic planning process and to help shape technology development and system design for resource recovery in the future. Starting from 41 technologies, which include novel and conventional options, we build 101,548 valid sanitation system configurations. For each system configuration we quantify phosphorus, nitrogen, total solids, and water flows and use that to calculate recovery potentials and losses to the environment, i.e. the soil, air, or surface water. The four substances cover different properties and serve as a proxy for nutrient, organics, energy, and water resources. For modelling the flows ex-ante, we use a novel approach to consider a large range of international literature and expert data considering uncertainties. Thus all results are generic and can therefore be used as input into any strategic planning process or to help guide future technology development. A detailed analysis of the results allows us to identify factors that influence recovery and losses. These factors include the type of source, the length of systems, and the level of containment in storage and treatment. The factors influencing recovery are related to interactions of different technologies in a system which shows the relevance of a modelling approach that allows to look at all possible system configurations systematically. Based on our analysis, we developed five recommendations for the optimization of resource recovery: (i) prioritize short systems that close the loop at the lowest possible level; (ii) separate waste streams as much as possible, because this allows for higher recovery potentials; (iii) use storage and treatment technologies that contain the products as much as possible, avoid leaching technologies (e.g. single pits) and technologies with high risk of volatilization (e.g. drying beds); (iv) design sinks to optimise recovery and avoid disposal sinks; and (v) combine various reuse options for different side streams (e.g. urine diversion systems that combine reuse of urine and production of biofuel from faeces).

Introduction
Sanitation protects human health and the environment and thereby promotes social and economic development. Sustainable sanitation also protects natural resources by closing material cycles. The aim is to reduce the net consumption of water and nutri- The call for more sustainable sanitation solutions has triggered substantial investments in the development of novel technologies and system configurations such as urine diversion or containerbased sanitation ( Tilmans et al., 2015 ;Tobias et al., 2017 ). Such innovations have the potential to enhance sustainability and resilience by reducing water requirements, being more adaptable for socio-demographic changes and environmental changes, and allowing for recovery of nutrient, energy, and water resources (e.g. Diener et al., 2014 ;Larsen et al., 2016 ;Tilmans et al., 2015 ;Tobias et al., 2017 ). Being independent from energy, water and sewer networks, these innovations are also more appropriate for developing urban areas (e.g. Evans, 2013 ;Hoffmann et al., 2020 ;Larsen et al., 2016 ;Russel et al., 2019 ) where most current population growth is taking place ( Dodman et al., 2013 ;UNDESA, 2014 ). Today, it is widely recognized that substance flows and resource recovery potentials are highly relevant performance indicators for sustainability evaluations of different sanitation systems (e.g. Ashley et al., 2008 ;Drangert et al., 2018 ;Harder et al., 2019 ;Orner and Mihelcic, 2018 ). They serve as input for comparisons, using methods such as Multi-criteria Decision Analysis ( Schütze et al., 2019 ), Life-cycle Analysis ( Pasqualino et al., 2009 ), or Cost-Benefit Analysis ( Balkema et al., 2002 ;Döberl et al., 2002 ).
Currently, the sanitation system options space is, however, mostly structured based on technologies and their characteristics but not on their functions and performance characteristics related to sustainability. This is reflected in the sanitation system templates ( Spuhler et al., 2018 ;Tilley et al., 2014 ) or the sanitation ladder used by the Joint Monitoring Programme ( WHO and UNICEF, 2017 ). To consider resource recovery in line with SDG 6 ( UN, 2014 ), a more functional approach to characterise sanitation systems is required as suggested by the functional sanitation ladder ( Kvarnström et al., 2011 ).
One of these functions is the protection of the environment and natural resources ( Kvarnström et al., 2011 ;SuSanA, 2008 ). The most straightforward attribute that allows to evaluate this objectives is the knowledge how much pollutants are lost to the environment and how much of resources can be recovered (e.g. Lienert et al., 2015, McConville et al., 2014, Spuhler et al., 2020a. Interestingly, for sanitation systems, many of occurring substances such as nutrients or organic matter are both, potential pollutant and resource for agricultural or energy production. Therefore, a typical method to quantify resource recovery and loss potentials is material flow analysis (MFA), also known as substance flow modelling (SFM). It is a type of system analysis based on the principles of mass balances providing indication of material use, emissions, and costs. The nature of the system is captured in a mathematical model. Analytical methods quantify flows and stocks of substances and/or materials, which are transformed or consumed within the system boundaries ( Baccini and Brunner, 2012 ;Brunner and Rechberger, 2004 ). MFA/SFM are widely applied for waste-and wastewater management in Europe ( Beretta et al., 2013 ;Binder, 2007 ;Binder et al., 2010 ;Binder et al., 2009 ;Cooper and Carliell-Marquet, 2013 ;Finnveden et al., 2007 ;Huang et al., 2012 ;Huang et al., 2007 ;Lang et al., 2006 ;Lederer and Rechberger, 2010 ); specifically nutrient management ( Do-Thu et al., 2010 ;Gumbo, 2005 ; or environmental sanitation planning ( Harder et al., 2019 ;Jain, 2012 ;Koffi et al., 2010 ;Meinzinger, 2009 ;Montangero and Belevi, 2008 ;Ormandzhieva et al., 2014 ;Schütze et al., 2019 ;Sinsupan et al., 2005 ;Ushijima et al., 2012 ;Wang, 2013 ;Yiougo et al., 2011 ).
Various simulation tools have been implemented to support these quantifications. E.g.: (i) static modelling of costs and contaminant for treatment units (e.g. WAWTTAR Finney and Gearheart, 2004 ); (ii) dynamic modelling for urban water flows (e.g. UWOT, Makropoulos et al., 2008 ), or the LiwaTool ( Robleto et al., 2010 ;Schütze and Alex, 2014 ;Schütze et al., 2011 ); and (iii) dynamic modelling for energy, costs and emissions of entire systems, (e.g. ORWARE ( Assefa et al., 2005 ), URWARE ( Dahlmann, 2009 ;Jeppsson et al., 2005 ). More recently, also a simulation software that potentially could be applied for novel sanitation systems has been developed ( Schütze et al., 2019 ). Unfortunately, all these models require detailed knowledge about technologies and how they connect together as well as available data or in-situ measurements to quantify transfer coefficients. The data requirements make it very demanding to use SFM at a pre-planning stage. Consequently, they most existing studies apply SFM to a few technologies and systems in a specific context only (e.g. . The increasing number of technologies and corresponding system configurations increase the complexity further. As shown in Spuhler et al. (2020b) , a set of over 40 technologies can be combined to over 10 0 0 0 0 plausible system configurations due to combinatorial explosion. Little knowledge exists about which combination might be the most performant for a given case. Moreover, little or no data exists on novel technologies and systems. Therefore, we have developed a method for the ex-ante quantification of substance flows (e.g. nutrients, water, total solids) of a diverse and large set of sanitation systems which we presented in Spuhler et al. (2020b) . This method builds on algorithms that automatically generate sanitation systems ( Spuhler et al., 2018 ). The model uses different technologies as building blocks and products as connectors. Each technology contains transfer coefficients for the substance in question. The flow path of substances is defined by the connections between technologies. The fate of the substances is defined by three loss compartments (air loss, soil loss, and surface water loss) and one recovery compartment. To be applicable ex-ante, the algorithms are complemented with a data library that provides transfer coefficients based on international literature and expert knowledge ( [dataset] . Additionally, uncertainties are modelled to express the variability of available data and the confidence in the expert opinion. By summing up all losses and recoveries for a system, the overall system resource recovery potentials and their uncertainty can be calculated. These results serve as basis for the performance comparison of the different sanitation systems in question. The experiences from developing this model and its preliminary application to a full-case real example have indicated, that there exists some sys-tem characteristics that could help to predict the resource recovery or loss potentials. These predictors could be used to develop a more functional characterisation of the system options at least in relation to resource recovery and loss potentials.

Aim
In this work we aim to answer the following two questions: 1 Can we estimate generic resource recovery and loss potentials and their uncertainties for a diverse and large set of sanitation systems? 2 Can we identify technological characteristics of sanitation systems that indicate a better overall resource recovery performance and therefore can be used as a predictor for resource recovery potentials or to guide future technology and system development?
To answer these questions, we perform a quantitative analysis of the recovery and loss potentials for a diverse and large range of sanitation systems using the model and full-scale application from Spuhler et al. (2020b) . This case generated from 41 sanitation technologies 101,548 valid sanitation systems and quantifies the resource recovery and loss potentials for nitrogen, phosphorus, total solids and water.

Overview
This paper presents an advanced application of a modelling approach previously presented in Spuhler et al. (2020b) . The approach includes two main elements. First, Spuhler et al. (2020b) presents a generic substance flow model to be applied ex-ante and for a large and diverse set of sanitation technologies and systems. And secondly, Spuhler et al. (2020b) also presents transfer coefficients for four substances for 41 technologies. The four substances represent different properties and cover nutrients (phosphorus, nitrogen) total solids (as a proxy for energy and organics) and water. These results are then to be looked at and discussed in regards of the influence of technical aspects such as technology interaction and system configurations on resource recovery and losses. The advanced application requires three steps: 1 The generation of entire system using the System Builder ( Spuhler et al., 2018 ). 2 The characterisation of the option space using the system templates as defined in Spuhler et al. (2020b) . 3 The modelling of substance flows in all sanitation systems and the quantification of recovery and loss potentials Spuhler et al. (2020b) .
The definition of the technologies and the transfer coefficients are provided in the technology library that is available here: https://doi.org/10.25678/0 0 0 0ss ( [dataset] Spuhler andSpuhler and. The System Builder and the substance flow model are implemented in Julia ( Bezanson et al., 2017 ) and are accessible at https://github.com/Eawag-SWW/ SanitationSystemMassFlow.jl (v1.0). A copy of the algorithms as well as all input and output data used for this publication are available in the associated data package at ERIC: https://doi.org/10. 25678/0 0 01TN ( [dataset] Spuhler, 2020 ).

Sanitation system generation
Sanitation system generation is based on the System Builder ( Spuhler et al., 2018 ), which is an algorithm that automatically generates all valid sanitation system configurations from a set of technologies. Here, we provide just a short summary of definitions and the applied methodology.
A sanitation technology ( Tech ) is defined as any process, infrastructure, method or service that contains, transforms or transports sanitation products. It is characterized by its name and the in-and output products (e.g. blackwater or greywater -> septic tank -> sludge and effluent) and its functional group (FG): the toilet user interface or source (FG U), on-site storage (FG S), conveyance (FG C), treatment (FG T), and reuse or disposal sinks (FG D). A technology belonging to FG U is always a source, while a technology belonging to FG D is always a sink. In this paper, we focus on toilet sources only.
A sanitation system ( SanSys ) is defined as a combination of compatible technologies which manage sanitation products from the point of generation to a final point of reuse or disposal ( Maurer et al., 2012 ;Spuhler et al., 2018 ;Tilley et al., 2014 ). A sanitation system is valid if it contains only compatible technologies and every sanitation product either finds its way into a subsequent technology or a sink ( Spuhler et al., 2018 ). Two sanitation technologies are compatible if the output product of one can be the input product of the other ( Maurer et al., 2012 ). For each source (FG U), the System Builder tests stepwise which combination of technologies allow treatment of output products and ends when there is no further combination possible. This happens when there is no more output, meaning that a valid system was formed. Or when it results in an open-ended system which is not valid and abandoned. Loops between technologies are only permitted if the infrastructures are situated close enough to each other, which is true for technologies from the functional groups storage (FG S) and treatment (FG T). An example would be a loop between the two technologies wastewater stabilisation pond (WSP) and a biogas reactor (both from FG T). The sludge from the WSP could be circulated to the biogas reactor, while the effluent from the reactor could be circulated back to the WSP.

Characterisation of the option space: system templates
Starting from 41 technologies, typically over 10 0 0 0 0 systems can be automatically generated. To structure and characterize the option space, system templates (STs) are used. The templates characterize technologies in terms of technological features and thereby group them regarding technical concepts (dry or wet, urine diversion, energy recovery, etc.) and spatial concepts (onsite, offsite, decentralized, hybrid). The system templates were first defined in ( Tilley et al., 2010 ) and further detailed in the Compendium of Sanitation Systems and Technologies ( Tilley et al., 2014 ). This compendium is supported by the 'The Water Supply & Sanitation Collaborative Council' and by the 'International Water Association'; its second edition is published in six different languages. Based on this widespread use ( Spuhler and Germann, 2019 ;Spuhler et al., 2020a ;Spuhler and Scheidegger, 2019 ), we adapted the existing templates to include novel technologies such as the production of liquid urine fertilizer or briquetting (see also Section 2.6 ). Here, we use the templates from Spuhler et al. (2020b) which include 19 templates that cover the entire options space, while grouping the options into four categories: simple onsite systems (ST1-ST3), urine diversion (ST4-ST8), biofuel systems (ST9-ST12), and blackwater systems (ST13-ST19). An overview is shown in Fig. 1 based on [dataset] Spuhler and Roller, (2020) .

Substance flow modelling
To quantify substance mass flows, transfer coefficients (TCs) for each technology are required. The TCs define how much of an entering substance is either transferred to one of the output prod- To characterise the diversity of the sanitation system option space we used nine binary conditions in order to define 19 different system templates that characterise systems according to different paradigms (onsite simple, urine diversion, biofuel, blackwater) and their degree of centralization. Note that modular systems integrating semi-centralized management of some products are considered as centralized. Source: Spuhler et al. (2020a) . ucts or to the loss compartments air, soil, or surface water. The TCs and the corresponding uncertainties as well as the data used to define them are compiled in the technology library ( [dataset] . The detailed description on how transfer coefficients and their uncertainties are derived can be found in Spuhler et al. (2020b) . Here we provide a short overview.
We use two ways to define transfer coefficient. Whenever possible we use literature data from which we selected the median of all data reported and the variability range between the lowest and highest data point to model the uncertainty. In the absence of literature data for example for very novel technologies, we contacted experts involved in the development of the technology. There we elicited the median value for the TC based on the expert's judgement. To define the variability range we used their confidence in the knowledge about the substance behaviour and the technology readiness level. All variability ranges are expressed as a concentration factor and modelled using a Dirichlet distribution.
Using the transfer coefficients, the inputs are propagated through the systems. This allows to calculate for each technology, the percentage of substance transferred or lost . In the sink technologies, substances are not transferred further but either lost or recovered. By summing up all losses and recoveries within one system, the system's resource recovery and loss potentials can be calculated. The uncertainties are computed by Monte Carlo error propagation and expressed as standard deviations. The standard deviations obtained in preliminary results ( Spuhler et al., 2020b ) are comparable to those obtained in studies applying a more sophisticated conventional post-ante material flow analysis in sanitation systems (e.g. Montangero and Belevi, 2008 ). Therefore, we concluded that our approach is capable of providing reasonable results also ex-ante ( Spuhler et al., 2020b ).

Substances and inflows
So far, we have defined transfer coefficients for four substances that typify different properties: total phosphorus (TP), total nitrogen (TN), total solids (TS), and water (H2O). All four substances are relevant as indicators for resource recovery and pollution potential. Both phosphorus and nitrogen have value and crucial significance: as important macronutrients, there are resources to be recovered; and as environmental pollutants, there are emissions to be minimised. Total solids can be used as a proxy for energy that could be recovered, for example, in the form of briquettes or biochar, as well as for organic matter that could be recovered as soil amendment. If discharged into the environment, total solids also has significant pollution potential. Water is under increasing pressure in many urban areas and has become a scarce commodity which should either be saved or reused.
For these four substances, we also defined fluxes for toilet sources using the values based on international literature (e.g. Lohri et al., 2010 ;Rose et al., 2015 ) provided in the technology library. These inflow values are shown in Table 1 and are based on literature from all over the world and therefore are quite generic. For the application in a specific case, those values could be adjusted to account for the local diet and flush water usages. Because we are more interested in the impact of the technology uncertainty then the uncertainty related to the population specificities in a given case, we did not consider inflow variability in our calculations. However, the variability range of the literature data can be found in the supplementary material of Spuhler et al. (2020b) and in the technology library ( [dataset] Spuhler and Roller, 2020 ).

Technologies and application case
In collaboration with a Swiss philanthropic organisation and a local organisation, we tested the System Builder from Spuhler et al. (2018) and the SFM model from Spuhler et al. (2020b) in Nepal in 2017. The details for this application case are described in ( Spuhler et al., 2018 ). The characterisation of the technology is independent of the case and are therefore fully transferrable to any case as shown in ( Spuhler et al., 2020b ). Therefore, the case circumstances are not relevant for the analysis presented in this manuscript.
The 41 sanitation technologies (see Fig. 2 ) are originally based on the Compendium ( Tilley et al., 2014 ) and further developed in Spuhler et al. (2018) and Spuhler et al. (2020b) . The resulting set includes conventional as well as novel technologies. Examples of such novel technologies include production of liquid urine fertilizer (aurin) and its application ( Bonvin et al., 2015 ;Etter et al., 2015 ;Fumasoli et al., 2016 ), briquetting based on the process imple- Table 1 Inflow mass for one person equivalent based on international literature and therefore generic for any application. TP: total phosphorus; TN: total nitrogen; TS: total solids; and H2O: water. Note that the amount of TP, TN, and TS are the same for all sources; only water inflow masses depend on the flush volume. We consider 2 Lday -1 person -1 for the pour flush toilet and 60 L/day/person for the cistern flush toilet. Source: Spuhler et al. (2020b

Fig. 2.
Overview of the 41 technologies in this study used to generate sanitation systems and to quantify their substance flows grouped by functional group. Each technology is defined by its name, possible input and output products, and how these products relate to each other (e.g. 'OR' for either one or another, 'AND' if they always arise jointly. Taken from Spuhler et al. (2020b) . mented by Sanivation in Naivasha ( Jones 2017 ), and latrine dehydration and pasteurization using ladepa pelletizing ( Septien et al., 2018b ). Using these 41 technologies the System Builder created automatically 101,548 valid sanitation systems. Valid means they are all able to manage all products from a given source in such a way that no open output remains at the end. The number is so high because of combinatorial explosion. The large number of generated sanitation systems represents almost the entire space of potential solutions -some of them with only minor variations.
It is important to note, that we here only consider toilet sources in order to reduce the complexity of the results. We also did not consider urine diversion flush toilets (and therefore no systems from ST7 and ST8 were formed). However, the underlying mod-els, both the System Builder and the substance flow model, could also accommodate other streams and related technologies such as greywater, stormwater, or organic solid waste.
For the substance flow modelling, we used the transfer coefficients from the library and inflow masses for 10 0 0 person equivalent and a period of one year. This was based on the requirements of our partner organisation that aimed of developing a city sanitation plan for the centre of the small town in Nepal.

Data analysis
To identify the influence of technical aspects such as technology interaction and system configurations on resource recovery and losses we used R for visual data analysis ( R Development Core Team, 2018 ). We also triangulated and reflected the results with Fig. 3. Recovery potential profiles of the sanitation system option space for all four substances. The x-axis shows the recovery potential from 0 to 100%. The y-axis shows the density of occurrence of a specific value for the recovery potential amongst all systems. The is based on kernel density estimate, which is a smoothed version of the histogram. TP: Total phosphorus; TN: total nitrogen; TS: total solids; H2O: water. For TP, TN, and TS we show the recovery ratio [%]. For H2O we show the absolute volume [m 3 year −1 ], as water flow depends on the source used and therefore the relative recoveries cannot be directly compared. data from two other case studies for larger cities. One of this case studies was the city of Arba Minch with 10 0 0 0 0 inhabitants in Ethiopia and another case studies was a low-income settlement of 20 0 0 0 inhabitants in Lima, Peru. With visual data analysis we refer to plotting different combinations of results in order to show dependencies between different technical aspects such as for instance the occurrence of urine diversion or the length of a system.

Overview
From the 41 Techs, 101,548 valid sanitation systems were generated and the substance flows for total phosphorus (TP), nitrogen (TN), total solids (TS), and water (H2O) were computed, considering the uncertainty of the TCs. Fig. 3 shows a density plot of the resource recovery of all systems. In the x-axis the recover potential from 0 to 100% is shown and in the y-axis the relative occurrence of systems with a given recovery (density). For TP, TN, and TS we show the ratio [%]. For water, we provide the absolute volume [m 3 year −1 ], as the relative recovery does not provide any useful information (e.g. comparing dry toilets with pour flush). As can be expected, across more than 10 0,0 0 0 systems, all four substances show recovery from nothing to almost 100%. This indicates that the choice of technologies has enough breadth to cover the entire spectrum. However, the maximum recovery ratio for the four substances are different and lower for nitrogen and total solids than for phosphorus and water: 98% for TP, 87% for TN, 88% for TS, and 97% for H2O. Also, the shapes of the profiles differ greatly from each other. But all of them show several peaks, indicating some key characteristics that lead to shifts in the recovery potentials. In the following paragraphs, we look at some of these key characteristics in more detail.

Source technologies (FG U)
The two wet sources (U1. cistern flush and U2. pour flush toilets) generate the same output product, blackwater, and therefore also the same numbers of SanSys (26,124). For dry toilets (U3), the number of valid systems is significantly lower (3704) because the generated output (excreta) can enter far fewer subsequent technologies and results in fewer partitions. Almost half of all the San-Sys generated (45,596) originate from the urine diversion dry toilet (U4), increasing the diversity of the option space. UDDT toilets generate two output products: urine and faeces. The more products occur, the more valid system configurations can be created.
Besides the fact that sources influence the number of system configurations, they also impact the recovery potentials and losses. This is illustrated in Fig. 4 which shows all resource recovery and loss potentials grouped by the source of the system. Each dot represents a system, the colours represent the sources: • For phosphorus the median recovery ratio is highest for UDDTs (61%) and lowest for dry toilets (21%). TP losses are dominated by soil loss and significantly higher for dry toilets which show a median soil loss of 75% as compared to 32% and 37% for wet sources and UDDTs respectively. But for wet sources, substantial amounts can also be lost to surface waters. • A similar but even more pronounced pattern is observed for nitrogen. Again the highest median recovery which is 75% is observed for UDDT systems and the lowest for dry toilets (4%). Nitrogen losses go also to the soil and are also higher for dry sources (29% for dry toilet, 17% for wet sources, and 5% for UD-DTs). What is different for nitrogen is that high amounts are also lost to the air for all sources (59% for dry toilet, 40% for wet sources, and 15% for UDDTs). • For total solids, the pattern is similar to the nitrogen pattern but less pronounced. The middle line of the boxplot represents the median, which is also written on each plot. The lower and upper hinges correspond to the first and third quartiles (the 25th and 75th percentiles). The upper whisker extends from the hinge to the largest value no further than 1.5 * IQR from the hinge (where IQR is the inter-quartile range, or distance between the first and third quartiles). The lower whisker extends from the hinge to the smallest value at most 1.5 * IQR of the hinge. Data beyond the end of the whiskers is removed from the plot. The colours correspond to the sources used by the systems. For TP, TN, and TS, we show the ratio [%]; for water we show the absolute amount [m 3 yr -1 ].
• Water recovery is obviously dominated by cistern flush systems as the water volume entering the system is much higher (0 to 21,773 m 3 year −1 , median of 1687 m 3 year −1 ). However, cistern flush systems also have the potential for important losses from all three compartments (3125 m 3 year −1 to air, 362 m 3 year −1 to water, and 4021 m 3 year −1 to soil).
In summary, we learn three things from this figure. First, dry toilets result in much higher losses and thus in lower recovery potentials. Secondly, UDDT systems result in low losses and high recovery ratio. And thirdly, most losses occur for nitrogen and total solids.

System length (number of technologies in a system)
Urine diversion systems are generally longer and more complex (more products, more bifurcations), and onsite dry (ST1 and ST2), biogas, or blackwater (e.g. ST9, ST13, and ST16) systems are shorter. For longer systems, the number of different SanSys and thus the diversity increases illustrated by the high number of UDDT sys-tems. However, this also means that SanSys which are longer are also more similar and therefore have similar resource recovery potentials. This is illustrated in Fig. 5 showing a clustering of similar recovery potentials to the right. The figure also shows that the median recovery potential increases initially with length, and is maximal at 14 technologies. But there are some very short systems that show extreme values. Either very low what is the case for systems including uncontained storage and a disposal sink. Or very high recovery ratio for systems that include contained storage and a recovery sink. The absolute highest recovery is achieved in short UDDT systems combined with biofuel (again ST9). For longer UDDT systems, recovery is systematically reduced by more possibilities for losses. This shows that the shorter the system the higher the potential for a very high recovery. Table 2 provides the number of systems per System Template (ST) and the detailed description of each template. there are far fewer onsite simple systems than urine diversion, biofuel, or black-  25th and 75th percentiles). The upper whisker extends from the hinge to the largest value, no further than 1.5 * IQR from the hinge (where IQR is the inter-quartile range, or distance between the first and third quartiles). The lower whisker extends from the hinge to the smallest value, at most 1.5 * IQR of the hinge. Data beyond the end of the whiskers not shown here. Colours correspond to the sources used by the systems. Median length per template is shown in Table 2 in the last column. water systems, mainly because they are simpler and fewer permutations can be generated. Fig. 6 shows the recovery potentials for all substances grouped by template and coloured by source. Most templates include systems with both high and low recoveries. Thus, template are not sufficient indicators for resource recovery potentials. Exceptions are ST1 and ST2 with exclusively low recovery rates. The clouds indicate clusters of systems with similar recovery potentials. Some STs show only two clusters of either very high or very low recovery potentials, (e.g. ST3, dry onsite and composting). This distinction is due to only a few products ending up either in a disposal or in a recovery sink. At a first glance the pattern of all four substances looks similar. But there are some differences.

Templates
For phosphorus , urine diversion templates (ST4-ST6) show the highest median recovery ratio, followed by the biofuel templates (ST9-ST12) and some blackwater templates (ST14, ST16). The five systems with the absolute highest phosphorus recovery ratios are from ST3 (onsite composting) and ST14 (onsite blackwater systems) with fewer treatment steps. This is different for the accumulated recovery ratio which is highest for ST9 as we have shown in the previous paragraph and Fig. 5 .
For nitrogen and total solids , urine diversion templates clearly outcompete the other . The five systems with the highest nitrogen recovery ratios are from ST6 (urine diversion and onsite faeces storage) and ST9 (urine diversion and biofuel production). The five SanSys with the highest total solids recovery ratios are also from ST9 and ST11, with exclusively UDDT sources. This also explains why the absolute highest accumulated recovery is achieved in ST9.
For water , the recovery ratio in % is not that interesting -as a system with high recovery is similar to a system with low use. Therefore, we look at the absolute amount of water recovered or lost. Higher recovery is obviously obtained in templates with a cistern flush toilet (ST9 to ST 19). The five SanSys with the highest water recovery by mass are again from ST9, followed by a ST11, and ST15 (onsite blackwater system). High water recovery ratios (in %) can also be achieved by dry systems (especially UDDT systems), but are obviously not relevant in absolute terms.
Looking at the accumulated ratios (bottom of Fig. 6 ); urine diversion systems clearly perform best especially if combined with biofuel production as it is the case for ST9 (onsite biofuel without effluent transport) or ST11 (offsite biogas without blackwater transport).

Shifting factors and key technologies
The peaks in Fig. 3 and clusters in Fig. 6 indicate that key characteristics act as "shifting factors" which are either due to the occurrence of a single technology or a combination of technologies. By analysing the systems that are part of the peaks we identified ten possible "shifting factors": (1) if a single pit is part of the system; (2) if transport is by pipe; (3) if no transport technology occurs (purely onsite system); (4) if urine source separation occurs (in UDDT); (5) if blackwater occurs; (6) if biofuel production occurs; (7) if toilet producing pit occur (i.e. in twin pits); (8) if composting technologies are used; (9) if surface water discharge is used; and (10) if soak pits are used. We used visual data analysis to better understand the respective influence of these shifting factors. The detailed figures are presented in the supplementary material (SI, Figs. 10 to 13), Fig. 7 summarised the following: • The single pit and soak pit are clear indicators for losses because of soil infiltration. As they occur in the beginning of the chain, they have increased influence. However, these soil losses are also associated with high uncertainties (quality of inflow, technology implementation). • Obviously, cistern flush combined with sewers achieve comparatively higher water recovery volumes because inflowing water volumes are also higher. But they also have the potential to lead to more losses (e.g. if effluent is simply discharged). • Transport technologies (assuming reasonable implementation, operation, and maintenance) have no major impact on resource recovery. • Composting can lead to high recovery ratios. But major air losses can occur for total solids and nitrogen either in the composting technology itself or during an earlier or later drying or storage step ( Benitez et al., 1999 ;Jönsson et al., 2004 ;Lalander et al., 2015 ;Meinzinger, 2010 ;Yadav et al., 2012 ). • Systems producing biofuel achieve high recovery rates only if all side streams are exploited for reuse. • No imperative trade-offs exist between energy, nutrient, or water recovery because the different recovery pathways can be combined and can help to optimize resource recovery. For example, urine diversion and reuse technologies combined with technologies that transform faeces into biofuel resulted in the highest recovery potentials.

Functional groups
The shifting factors and key technologies presented in the previous paragraph can clearly be associated with the functional groups user interface (sources, FG U), storage (FG S) treatment (FG T) or reuse or disposal (sinks, FG D). Sources have a direct impact on water volume and thus on the magnitude of losses or recoveries or if urine diversion or blackwater occurs. Transport (FG C) has little influence. To validate these results and be more specific, we looked at the mean recoveries and losses of all systems over the system templates. The results are displayed in Fig. 8 . Obviously, sinks (FG D) have a major impact on recovery ratios as they define whether the final product is reused or lost. However, the storage (FG S) and treatment (FG T) are also relevant because they determine how much is lost before products end up in the sinks. Storage (FG S) losses are mainly to soil and air, and are important for onsite systems without sludge (ST4, ST13, ST14). Treatment (FG T) losses are mainly air losses of TN (and to a lesser extent, TS) and are particularly dominant in onsite blackwater systems with sludge (ST 16 to ST18), offsite blackwater systems (ST19) and biogas systems with effluent transport (ST10, ST11). Storage (FG S) and treatment (FG T) also have high uncertainties. For sinks (FG D), losses are mainly soil losses and relevant for all templates. Some biogas and blackwater systems with effluent transport (ST10, ST11, ST16) and offsite blackwater systems (ST19) also show substantial water losses.

Uncertainty
In Fig. 9 , we show the simulated standard deviation of all substance recovery potentials. Each dot in a figure represents a system, the colour code shows the system template the system belongs to. The x-axis shows the recovery potential and the y-axis shows the standard deviation. Low and high recovery ratios have lower uncertainties because the TCs cannot vary below 0 or above 100% to conserve the mass balance ( Spuhler et al., 2020b ).
As shown in Spuhler et al. (2020b) and [dataset] Spuhler and Roller (2020) , the identified uncertainties for each technology can already be quite high as they integrated different aspects such as the quality of inflow, the technology implementation (design and maintenance), environmental conditions, measurement methods, or available knowledge (which is particularly limited for novel technologies). Nevertheless, the maximum standard deviation of the system recovery ratio is 28%, which is comparable to the accuracy of classical material flow analysis (e.g. Montangero and Belevi, Table 2 System configurations per system template (ST). ST7 and ST8 are not represented by any generated sanitation systems because they require a urine-diverting flush-toilet as source. The wet sources (U1. cistern flush and U2. pour flush toilets) occur in all system templates except ST3-ST6 and are the only source represented in templates ST10 and ST12-ST19. The U3. dry toilet is only represented in ST1-ST3, ST9 and ST11, and it is the only source in ST3. UDDT is represented in templates ST4-ST6 (urine diversion templates) but also in the two biofuel templates ST9 and ST11 (if a system integrates both urine diversion and biofuel, it is associated with the biofuel STs from ST 9-ST12). 2008 ). This indicates that the used approach for the ex-ante quantification of resource recovery potentials is capable of producing plausible and thus relevant results for practice. As a consequence, we suggest to use recovery ratios and standard deviations presented in Fig. 9 as a data pool to guide any strategic sanitation planning case. For instance, the resource recovery potentials can be used to prioritise resource efficient systems already at an early planning phase. Or the recovery ratio are used to compare different options when making a final decision using e.g. multi-criteria decision analysis. This would allow to introduce value functions for different resource recovery pathways (e.g. nutrients versus energy) and the uncertainties could be used to evaluate the robustness of the final outcome.

Discussion
The quantitative analysis of recovery and loss potentials of four typical substances and over 10 0 0 0 0 sanitation systems contribute to science and practice in two ways. First, most of the input data represents a large body of literature and is therefore generic and could be utilised for other applications. Thus, the resulting recovery and loss potentials and the uncertainty estimations are transferable and could serve as input for the multi-criteria decision analysis or costs-benefit analysis. Second, we were able to identify system characteristics and technology interactions relevant for recovery potentials in order to help shape future technology and system design. In the following two paragraphs, we briefly discuss the main results in order to answer our two main questions. We will start with the discussion of key characteristics that can help to predict resource recovery and guide future technology and system innovations. Secondly, we will discuss the generalisation of the results and their relevance for strategic planning.

Factors influencing resource recovery and losses
By analysing the mass flows for a large number of sanitation systems, we extracted some key characteristics that have a direct impact on the understanding of resource recovery potentials (see also Table 3 ). Most of these influencing factors are related to tech-nology interactions and system configurations. However, we were not able to identify an unequivocal set of factors determining resource recovery or loss, which reveals the need for two considerations. First, performance evaluation, in terms of resource recovery, cannot be based on a single technology but must be based on the analysis of the entire system. Second, the need for a generic and automated model that allows substance mass flows to be quantified, even for large numbers of sanitation systems, is highlighted.
Length: Shorter systems can achieve higher recovery rates due to fewer possibilities for losses. Each additional treatment step potentially contributes to more losses while the recovery only depends on the sinks. Quantitative knowledge about such trade-offs (e.g. treatment quality versus recovery potential) can be used to support the decision-making process. Source: The system source (functional group FG U) strongly impacts both the system configuration and the recovery potentials. For all four sources studied, TN and TS recovery ratios cannot be as high as for TP and water (more stable substances). But wet systems based on cistern flush and pour flush toilets generally have lower TN recovery potentials than urine diversion systems due to losses to soil and air. However, some systems based on wet sources can achieve very high recovery ratios for all substances if they are short and effluent is reused in irrigation. Obviously, wet systems lead to higher water recovery in absolute terms but also more significantly to higher losses in absolute terms. Dry toilets create systems that perform poorly in recovery, either due to the combination with the single pit (FG S, high soil losses) and/or sludge treatments such as composting and drying beds (FG T, high air losses). However, if dry toilets are linked to pit humus or compost production and irrigation, they can achieve high recovery combined with Fig. 8. Percent of lost substances within a system, showing the mean over all systems within a system template (ST). The losses to the air, soil, and surface water are indicated seperately for each functional group user interface (U), storage and/or treatment (S), conveyance (C), (semi-)centralized treatment (T), and reuse and/or disposal (D). The contribution of the functional group U (toilet sources) to losses is negligible. The functional groups S and T clearly contribute most to the losses. The losses in S go mostly to the soil. The losses in T go mostly to the air. D losses (in blue) refer mainly to the disposal sinks. The number of systems with disposal sinks is approximately equal to half of the systems per template or less. ST1 and ST2 clearly have lower recovery potentials in the mean, while ST4-ST9 clearly have higher recovery potentials than the others. low water use/loss. Urine diversion systems that integrate recovery sinks clearly show recovery potentials for TP, TN, and TS that are higher than for all other sources.
Other functional groups: Resource recovery is influenced not only by sources (FG U), but also by the sinks, storage, and treatment (FG D) technologies and how these are combined. Obviously, sinks (FG D) have a major impact on recovery ratios as they define whether the final product is reused or lost. However, the storage and treatment technologies define how much of a substance is lost before it enters the sink. Sink (FG D) losses are mainly soil losses and relevant for all templates. Some biogas and blackwater systems with effluent transport (system template ST10, ST11, ST16) and offsite blackwater systems (ST19) also show substantial water losses. Storage (FG S) losses are mainly soil and air losses and are important for onsite systems without sludge (system template ST4, ST13, ST14). Treatment (FG T) losses are mainly air losses of TN (and to Fig. 9. Jittered point plots of the recovery potentials mean values (x-axis) and the standard deviation (y-axis). The colours define the system templates (STs). ST1-ST3 are dry onsite systems, ST4-ST7 are urine diversion systems, ST8-ST13 are biofuel systems, and ST14-ST19 are blackwater systems (see Table 2 and Spuhler et al. (2020b) ) for detailed definitions of STs). The uncertainties are higher for the mean values as there is more room for variability. STs have some influence on the uncertainties as they are related to the technologies within the systems and thus also to the uncertainties defined for those technologies.

Table 3
Summary of observations made in this publications on factors affecting resource recovery potentials. The intensity of the effect is evaluated on a qualitative scale: ' + ', ' ++ ', ' +++ ' indicate an enhancing effect and '-', '-', '-' indicate a diminishing effect. The evaluation is based on our personal judgement based on the analysis of the data presented in this publications and the data from three other case studies. TP: total phosphorus; TN: total nitrogen; TS: total solids; H2O: water; ND: not defined. . a lower extent TS) and are particularly dominant in onsite blackwater systems with sludge (system template ST16 to ST18), offsite blackwater systems (ST19) and biogas systems with effluent transport (ST10, ST11). Storage (FG S) and treatment (FG T) also have high uncertainties (see Spuhler et al., 2020b ). System templates: System templates are currently the approach most used to describe the sanitation system option space (see e.g. Gensch et al., 2018 ; Tilley et al., 2014 ;WSP, 2007 ;Zakaria et al., 2015 ). System templates are not a sufficient indicator for potential resource recovery. However, different templates lead to different recovery and loss characteristics. Dry onsite systems without sludge templates (ST1 and ST2) mostly include systems with high losses and little recovery. Urine diversion templates (ST4-ST6) have the least number of loss systems and the most recovery systems, followed by biogas templates (ST9-ST12). The blackwater templates (ST13-ST19) integrate systems with mostly moderate losses. However, short blackwater systems with relatively little treatment (e.g. ST 15) can achieve high recovery ratios for all substances. The highest recovery ratios are achieved in urine diversion systems combined with biofuel production (ST9).
Key technologies: • Single pits and soak pits: Based on the literature data we found, these clearly show high losses of phosphorus and nitrogen (except if urine is separated and recovered), and other substances to a smaller extent. But these high losses are also associated with high uncertainties dependant on contextual conditions. • Transport generally does not impact recovery potentials • Cistern flush systems with no sewers achieve higher water recovery, but also potentially higher losses. • Composting systems show high recovery potentials for TP and TN, but high losses for TS and in some cases also for TN. • Systems with technologies that produce biofuel achieve high recovery rates, but only if the side products (e.g. sludge from biogas digesters) are also reused (e.g. drying and application to soil).
There is no imperative trade-off between energy, nutrient, and water recovery. The highest recovery is achieved when combining urine diversion and reuse, biogas production from faeces in codigestion, reuse of sludge for soil amendment, and irrigation with any effluent.

Relevance of the results
The above findings are based on generic data from the literature and therefore likely to be relevant input for strategic planning in general. Furthermore, they could also contribute to the design of future technologies or to the development of policies and decision support tools. The generic datasets contain the technologies and systems, the considered substances, inflows per capita, and transfer coefficients and their uncertainties.
Technologies and system configurations: The set of technologies covers a broad range of currently available concepts (onsite/offsite/decentralized, nature-based/advanced, dry/wet, etc.). Consequently, the generated system configurations also cover almost the entire diversity defined by the system templates (see also Spuhler et al., 2018 ).
System templates: The system templates are efficient in describing the diversity of systems in terms of technological concepts. However, they fail to predict resource recovery. This leads us to ask whether a more performance-based characterisation of systems would contribute to a more streamlined strategic planning process. In this publication, we identify a set of factors for resource recovery which could be used to implement such a performancebased characterisation and to render templates useful for the operationalisation of SDG 6. For instance, the factors would allow groups of templates to be defined based on different types of system requirements (e.g. high freshwater requirements versus low) or more importantly, on different types of recovery (e.g. nutrients versus energy).
Relevance of substances considered: In principle, our model could be extended to any substance. We have chosen substances which we rated as most relevant to the discourse on sustainable sanitation, water management, and resource recovery. Both TP and TN are important macronutrients with significant environmental pollution potential. TS can be used as a proxy for energy, for example, as briquettes or biochar (e.g. Andriessen et al., 2019 ;Motte et al., 2013 ), and as organic matter for soil amendment (e.g. Diener et al., 2014 ;Septien et al., 2018a ). Principally, also the chemical oxygen demand (COD) or the exergy flow could be used. However, in most circumstance TS data are more readily available and more frequently used in the available case studies. Water in many urban areas is under increasing pressure and has become a scarce commodity.
Inflows: As for the other input data, we used generic data from literature for a reference case of a city zone of 10 0 0 people to quantify inflows (e.g. centre of an emerging small town in Nepal). These inflows could be adapted to reflect local specifications related to diet (nutrient intake), water volumes used for flushing or the number of inhabitants. However, the mean recovery ratio as well as the standard deviation, would not change and therefore these results can also be reused directly in any other case.
Transfer coefficients (TCs) and uncertainties: A major strength of our approach is the quantitative integration of literature data in the form of TCs. The data in the library are based on an extensive literature research, complemented with expert knowledge. It represented a compact and accessible overview of the currently available knowledge on the performance of diverse set of sanitation technologies and makes it available for almost any application ( [dataset] . Confidence in knowledge about the performance of a specific technology is reflected in the defined variability ranges. This approach has two main advantages. First it allows to use a large body of knowledge. Second, it enables the evaluation of the robustness of the final results based. This can be illustrated with the transfer coefficients for phosphorus and nitrogen in the single pit. Based on our literature data we found a median P loss to soil of 71% and a variability range of almost 40 %. This high literature data variability is due to the uncertainty about the technology implementation (e.g. how sealed is it?), the local context (e.g. climate) and most importantly the inflowing product (dilution of the products). Considering not only the median but the variability range as well allows to safeguard this knowledge in the simulation. The uncertainty reflects in the standard deviations of the resource recovery of the entire systems which in this case are almost as high as the recovery ratio itself. This was shown for system 11 in a didactic example presented in Spuhler et al. (2020b) . Nevertheless, it is important to note that the coefficients presented here may not be fully representative of all possible conditions in the world, especially for complex processes that can vary greatly depending on context.
Additional to these generic data, we also compared our results to those from similar studies to check the plausibility of the resource recovery results. For instance, we found a median nitrogen recovery of 76% in ST6 'Dry onsite storage and treatment', with urine diversion ( Fig. 6 ). This is very similar to the nitrogen recovery potentials of 82% for urine diverting composting latrine systems found in Orner and Mihelcic (2018) . The maximum standard deviation of the recovery ratio is 28%, which is comparable to the accuracy found by Montangero and Belevi (2008) . This study used a material flow analysis to determine the phosphorus flows to surface water from sanitation systems in Hanoi and found 1572 tonnes per year with a standard deviation of 608 tonnes.
Due to the generic approach, both the resource recovery potentials and the key influencing factors generalize well. We see three possible use for the results in practice: • As an input into strategic sanitation planning either to prescreen for resource efficient systems or systems with low emissions during the pre-planning phase. For instance, if sensitive urban water bodies require protection, systems with high nitrogen or phosphorus water losses could be eliminated from the beginning. Or in the case of a demand for organic fertiliser, systems with high nutrient recovery potentials could be preselected (see also Spuhler et al., 2020b ). Obviously, the resource recovery and loss potentials are not the only performance indicator for sustainable sanitation but should be evaluated simultaneously with other important indicators such as hygiene, economic and financial viability, and technical, institutional and socio-cultural appropriateness (e.g. Bracken et al., 2005 ;Spuhler et al., 2020a ;SuSanA, 2008 ). In Spuhler et al. (2018) we provide a method to evaluate the technical, institutional and socio-cultural appropriateness. • The key factors for resource recovery and the four recommendations for their optimisation could be used for the fine-tuning of systems during the detailed planning and implementation phase. For example, the length of the system could be optimised with the combination of different recovery sinks. • The key factors and recommendations could also guide researchers or technology developers working on future innovations. For instance, the recommendations for resource recovery could be used to guide the development of containment and treatment technologies that minimise losses.
Above these direct practical applications, we also see a potential of the presented approach to be used by researchers or technology developer. The potential recovery potentials of a novel technology could be pre-evaluated by first generating valid system configurations and then quantifying potential recovery ratio. This aspect is discussed on in Spuhler et al. (2020b) .

Outlook
The most obvious next step would be to make the results available to practice, an interactive user interface could be developed with different use cases. For instance, one could submit a technology and its transfer coefficients and would get back possible system configurations and phosphorus recovery potentials. Translating the influencing factors into guidelines for future technology development is another way of dissemination as described in the relevance chapter. Attempts to summarize the results with easy to interpret decision guidance for option selection were not very successful, as shown in the example decision tree shown in supplementary information SI Figure 15 in the supplementary information. This hints to highly interlinked influence factors.
Another exciting future activity includes the expansion of the technology library with additional products (e.g. greywater, stormwater, or organic solid waste) and technologies (e.g. black solder flies, vertical gardens, etc.). This would allow to analyse the resulting systems and their recovery and loss potentials and to complete the set of recommendations provided here.

Limitations
It is important to note that the models used to produce the presented data are based on a number of simplifications that include the very generic definitions of technologies and products. Consequently, the substance transfer coefficients which are defined for each technology and product are also impacted by these simplifications. Therefore, systems must be checked by an expert for plausibility when they are being seriously considered as planning options. An example is the treatment of faeces alone in a biogas reactor; it would not make much sense from an engineering perspective, while it would make sense if sludge and e.g. organics are also digested in the same reactor. Another example concerns transfer coefficients: soil loss in a single pit could be defined much more accurately if one would know whether the input product is moist (excreta with pour flush water) or dry (pure faeces). Consequently, the approach is suitable for strategic planning but not for detailed design and implementation of a specific sanitation system.
Modelling substance flows based only on TCs is clearly a simplification, as it excludes possible substance generation, (e.g. through biological fixation, see also Spuhler et al. (2020b) . For most technologies, this limitation is not relevant. A more detailed approach would substantially increase computational demand and the collection of comparable parameters from literature would also be difficult. Another simplification is the assumption of fault free implementation, operation, and maintenance of the technologies.
Importantly, these simplifications allow the automation and generalization of the model application. Consequences of the simplifications are captured in the uncertainty calculations. The user is free to be more specific in the technology and product definition (e.g. make different types of single pits for different products), or to use more complicated TC models if more accuracy is needed.

Conclusions and outlook
• Nutrient, water, and total solids recovery potentials and losses to the environment are relevant indicators in evaluation of the sustainability of different sanitation options. By analysing a large set of system options representative for almost the entire option space we could: (1) quantify resource recovery and loss potentials that are generic and can be used to influence technology design or strategic planning; and (2) identify characteristics of sanitation systems that provide information on potential resource recovery and losses and can be used to orientate future technology and system development. • The consideration of a large body of international literature data and expert knowledge to generate is the results is enabled through a novel approach to consider uncertainty. • Factors influencing recovery are related to the interaction of different technologies in a system. For instance, even if a sink technology could potentially recover 99% of inflowing substances, the recovery of the entire system will depend on the fraction of substances that actually arrives at this specific sink. This means that resource recovery potentials have to be looked at on a system level and not at an individual technology level.
It also justifies such a modelling approach that allows to look at all possible configurations. • Factors influencing resource recovery are: source and sink technologies, the length of the systems, and the storage and treatment technologies and their level of containment. Moreover, five key recommendations for the optimization of resource recovery from sanitation systems are developed: (i) prioritize short systems that close the loop at the lowest possible level (fewer treatment steps, less losses); (ii) separate waste streams as much as possible, because this does not lead necessarily to fewer treatment steps, but it allows for higher recovery potentials, (e.g. through urine diversion); (iii) use storage and treatment technologies that contain the products as much as possible, avoid leaching technologies (e.g. single pits) and technologies with high risk of volatilization (e.g. drying beds); (iv) design sinks to optimise recovery and avoid disposal sinks; and (v) combine various reuse options for different side streams (e.g. urine diversion systems that combine reuse of urine and production of biofuel from faeces). • The comparative analysis also showed that system templates are very efficient in describing technological diversity but not in providing indicators on resource recovery. This leads to the question of whether the concept of system templates should be adapted in order to become more performance based and thereby more useful for the strategic planning process in line with SDG 6. The factors for resource recovery which we present here could be used to implement such a performance-based characterisation, for instance, based on different types of recovery (e.g. nutrients versus energy). • In order to make the generic resource recovery potentials available for practice, an interactive interface could be developed that would allow browsing and extracting results for a specific system. For instance, one could submit a given system configuration and the number of inhabitants of its area to receive the specific resource recovery potentials. Or one could provide a number of technologies and explore which systems could be used and find their respective resource recovery potentials. The same could be done to explore loss potentials as indicators for environmental pollution. • Another straightforward extension of the approach would be to include additional substances (e.g. potassium), technologies (e.g. future innovations), or product streams (e.g. solid waste or storm water). • Future research activities could look at the potential quantification of performance indicators other than resource and loss potentials. For instance, the mass flows within a system could feed into technology-specific costing functions as discussed in Spuhler and Germann (2019) . This would allow the exploration of economies of scale.

Author contributions
D.S., A.S., and M.M. conceptualized this publication together. D.S. was responsible for data curation, formal analysis, investigation, and validation. The methodology and software were developed jointly by D.S. and A.S.. D.S. also wrote the original draft and visualized the results. A.S. and M.M. supervised the process. D.S. and M.M. were responsible for funding acquisition. Resources (primary literature data) was collected by Leandra Roller.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.