## 2 Methodologies and Techniques of the Research Work
### Methodology Adopted to Define the Simulation Model  
Since the end of the last century, the methodologies of design and modelling of object-oriented systems have been gaining popularity in the field of systems analysis and design, especially since the development of the unified modelling language (UML) in 1997. Although the initial use of the UML was focused on software systems, it was rapidly extended to other mixed systems (mechatronics, embedded, etc.) and to complex systems (systems of systems), as is the case of the current cyber-physical manufacturing/production systems, by UML profiles as systems modelling language (SysML) [19]. While the use of SysML is crucial for establishing formal and unambiguous communications between system engineers, disciplinary designers, and system analysts, Modelica is an equation-based, object-oriented behavioral simulation language that has been shown to be a suitable language to take into account geometrical and multi-physical constraints at the conceptual design phase under a MBSE approach [20; 21]. The synergy created by integrating SysML and Modelica in the design and specification of simulation systems is very significant and the advantages from the joint use of both languages are multiple [22; 23]. However, MBSE promotes the construction of executable simulation models (e.g., Modelica models) from descriptive models, such as SysML models. Therefore, there is a need to automate SysML-Modelica transformations and vice versa [24]. The methodology proposed to define the simulation model is based on both SysML and Modelica. Furthermore, the methodology adopts the MBSE approach and it follows the flow of activities for product development proposed in the extended V-model [25], which incorporates an approach to virtual product development. Note that this research work can be placed in the first phases of the V-model related to the process of systems, when the phase for modelling and specification of the system to be analyzed has already been carried out and a design of the concept of the system is given. The proposed methodology is inspired by the results of some published research [24], mainly in the field of product development, with the aim of systematizing the tasks involved in the design and implementation of simulation systems. The methodology is composed of five steps and it is generally enough to be applied in the definition of any type of simulation model:  
1. Analysis of the functional and logical structure of the system to be simulated. The system must be analyzed in order to know the structural elements and their relationships that characterize it. This structure is usually described using a SysML block definition diagram (BDD), where the logical system components are represented by blocks and activity diagrams for process modelling. Figure 1: (**a**) Multistage assembly system (MAS) with N stations; (**b**) illustration of error propagation in a 2D MAS. Definition of concepts and requirements for the simulation system model. For this, various aspects must be considered, such as the type of simulations (e.g., continuous dynamic or discrete events), the goals of the study (e.g., maximum defect index value, minimum throughput value, etc. ), and the simulation alternatives for the prototype. For this task, SysML diagrams, such as BDD and requirement diagrams are used. 3. Structural and behavioral modelling of the simulation system (the system of interest). Taking into account the results of the previous step, a viable solution is proposed for the objects structure of the simulation system and their prescribed behavior. Structure and behavior descriptions are decomposed to the level of abstraction required and they are described using SysML diagrams, such as BDDs, internal block diagrams (IBDs), parametric diagrams, activity diagrams, sequence diagrams, etc. 4. Modelling the simulations.