This paper reports on experiences from case studies in using Modelica/Dymola models interfaced to control and optimization software, as process models in real time process control applications. Possible applications of the integrated models are in state-and parameter estimation and nonlinear model predictive control. It was found that this approach is clearly possible, providing many advantages over modeling in low-level programming languages. However, some effort is required in making the Modelica models accessible to NMPC software. Particular consideration is given to implementation of gradient computation for real-time dynamic optimization, where the dynamic models can be Modelica models. Analytical methods for gradient computation based on sensitivity integration are compared to finite difference-based methods. A case study reveals that analytical methods outperform finite difference-methods as the number of inputs and/or input blocks increases.