Design and implementation of real time simulator with Modelica The usefulness of a simulation is determined by the validity and results of the simulation that can be used by a user to experiment with the system being simulated. In order to to develop a flexible simulatorsystem with a long useful life, an abstraction needs to be introduced in the modeling and validation proses to separate it from the simulation engine itself. The aim is to develop an architecture that can separate the modeling proses of a simulation from the simulation engine that is being used. The language used to model the simulation is Modelica. The Modelica file is converted into the C programming language using tools provided from OpenModelica that is then integrated to the real-timesimulator runtime developed in this thesis. This paper discusses the design and implementation of two different simulator architectures. These two architectures are the multi-threaded and non-threaded real-time simulator runtime. The conclusion of the testing and analysis done towards the two architectures is that the non-threaded architecture results in the most valid simulation producing simulation values closest to the real value and is able to fulfill the hard-real time requirements of the simulation.