## 2 Materials and Methods
### Uncertainty Quantification  
A considerable challenge of simulation-based testing is the handling of uncertainty. In this context, uncertainty describes the discrepancy between simulation output and real-world observations that stems from measurement errors in data, system stochasticity, and the simplified nature of models. Since uncertainty can never be fully eliminated from a simulation, the process of uncertainty quantification (UQ) is instead applied to allow users to make quantitative statements about the accuracy/uncertainty of their simulation results (e.g., [26]). Figure 3: Overview of the simulation planning process. UQ is especially challenging in CPES co-simulation. On the one hand, the combination of different simulators and data sources can lead to the mixture of different forms and magnitudes of uncertainty. Some simulators, e.g., may produce data high with uncertainty that is propagated through the system and dominates the overall output uncertainty. Furthermore, different simulators may need different types of mathematical uncertainty representation (e.g., [27]). On the other hand, the simulation of highly interdisciplinary systems leads to an additional effort in the assessment of input uncertainties. The UQ process cannot be conducted by a single analyst but needs information from a variety of experts and data sources. Thus, it is likely that different states of knowledge have to be consolidated. The UQ process can be separated into the two subprocesses of uncertainty assessment and uncertainty propagation. During uncertainty assessment, users identify the uncertainty sources in their simulation setup. Most of these sources typically lie in the input data, but simplifying assumptions made in the modeling process can also be seen as uncertainty sources. After these initial uncertainties have been identified, they must receive a quantitative representation. This is typically done by modeling the data uncertainty as probability distributions, but intervals or probability boxes may also serve as uncertainty models (e.g., [28]). The information required to conduct uncertainty assessment may stem from different sources, be it data analysis, model comparison or expert knowledge. Once the assessment is concluded, the initial uncertainties are propagated through the simulation model. That means that calculations are conducted to trace how initial uncertainties are combined and transformed by model operations to form uncertainty in the simulation output. In CPES co-simulation, this has to be done in a non-intrusive manner since simulation models are treated as black boxes and usually cannot be manipulated on code basis to allow other forms of UQ. The procedure of conducting uncertainty assessment followed by propagation is called a forward problem of UQ. In contrast, the inverse problem, associated with the technique of Bayesian inference, involves comparison of UQ output with measurement data to adjust the initial uncertainties and gradually improve the UQ quality. While this method has gained a lot of attention in the recent years, it is not considered practical for co-simulation of future energy systems due to the lack of the necessary measurement data. The mosaik environment accounts for uncertainty with the help of the module _MoReSQUE_[29] that introduces an ensemble-based UQ process into the co-simulation. The module provides a propagation process that is conducted for each employed simulator individually. This is possible in a non-intrusive manner by replacing single simulation model instances by an ensemble of models that are able to process different input and parameter values. This provides the potential for the application of different propagation algorithms like Monte-Carlo simulation, polynomial chaos expansion (e.g., [30]), or new types of methods [31]. Depending on the employed propagation algorithms different types of uncertainty models can be supported. The corresponding uncertainty information is stored in so-called uncertainty structures that are exchanged between ensembles during runtime.