An interface is developed to couple the finite element program FEFLOW with the MATLAB-SIMULINK software. The TCP/IP based data exchange routine allows for a co-simulation of borehole heat exchangers and of HVAC components, so that each subsystem can be modeled in its specialized simulation environment. Hereby, the interaction of the subsystems is taken into account, which leads to a more precise representation of the systems’ dynamic behavior. Furthermore, the concept supports the application of mathematical optimization algorithms that can be utilized to automatically determine several design parameters for an overall improved system performance.