# Speeding up Statistical Tolerance Analysis to Real Time
## 1 Introduction  
Manufactured components are subject to deviations that reduce the functional and aesthetic quality of the final product. For this reason, tolerances are specified based on the results of statistical tolerance analyses to minimize the degradation of geometrical accuracy and number of rejects in manufacturing. Additionally, economic aspects must also be considered. Needlessly tight tolerance specifications lead to higher expenses and an increase in production time due to the stricter demands on the manufacturing process. A common approach to satisfying both of these requirements is establishing statistical tolerance analyses based on Monte Carlo simulation to identify the cost-optimal manufacturing tolerance specification based on repeated random sampling and statistical analysis [1]. Monte Carlo simulation has consistently been the preferred choice of the tolerance community to evaluate the statistical implications of manufacturing deviations on the key characteristics of mechanical assemblies. Furthermore, Monte Carlo simulation is an established and common standard in a large variety of different scientific and industrial areas, because it allows simulating and tackling complex systems and processes. However, Monte Carlo simulation is computationally intensive, which means that the associated execution times can range from seconds to hours and even days. The ongoing digital transformation of manufacturing through the adoption of Industry 4.0 [2; 3; 4] requires that product characteristics be analyzed after each manufacturing process in order to establish a continuous information flow to enable a self-learning and self-adapting manufacturing process [5; 6].  
To support the digitization of manufacturing products with high geometric accuracy, it is therefore important to accelerate the statistical tolerance analysis. The runtime optimization of Monte Carlo simulation is nothing new to academic research. Various studies have discussed approaches to speed up Monte Carlo simulation, mainly focusing on either a proper distribution of the random sample generation among several local computers (such as [7]) or on carrying out the Monte Carlo simulation on a single GPU or on multiple GPUs (such as the application of NVIDIA's Compute Unified Device Architecture (CUDA)in [7]). However, none of the existing work considers the specifics of tolerance engineering and investigates whether a Monte Carlo simulation using the GPU architecture has the potential to significantly speed up statistical tolerance analysis and statistical tolerance synthesis. The present paper attempts to investigate this using scientific open source computing libraries provided by the Python programming language.  
The rest of this paper is structured as follows. Section 2 gives an overview of the software solutions used in tolerance engineering and provides a sufficient background concerning the basics of the programming language Python. Section 3 defines the research question and the main challenge of the paper. In Section 4, an overconstraint door hinge assembly is introduced, which serves as a case study. The implementations of a statistical tolerance analysis and statistical tolerance synthesis of the door hinge assembly are detailed in Sections 5.1-5.4. This is followed by a brief description of the runtime measurement procedures and details on the software and hardware used in Sections 5.5-5.7. The runtime results of the statistical tolerance analysis and statistical tolerance synthesis implementations are presented and discussed in Sections 6.1 and 6.2. In Section 6.2.2, the sample size required for credible statistical tolerance synthesis for the tolerance model is determined, followed by some conclusions in Section 7, in which recommendations for tolerance engineers and researchers are given to speed up statistical tolerance analysis to real time.