NEEShub services are beginning to be phased out. Please begin using DesignSafe ( Please submit a support ticket ( if you need any assistance.


Support Options

Submit a Support Ticket


Virtual RTHS Sample Using xPC

By Sarah Hacker1, Xin Li, Shirley Dyke1

1. Purdue University

Download (ZIP)

Licensed according to this deed.

Published on


This sample for virtual real-time hybrid simulation (vRTHS) was developed in the Intelligent Infrastructure Systems Laboratory at Purdue University to help users understand the steps necessary to perform a real-time hybrid simulation (RTHS) on a virtual platform. This vRTHS sample uses MATLAB xPC Target platform to communicate data between two target computers and a main host computer. For a true RTHS, either of the two target computers running a simulation could be replaced with a physical substructure connected to the rest of the system through xPC. Included in the sample are a tutorial and a MATLAB code that has been tested to run on MATLAB 2011a (32-bit)/ Windows 7 (64-bit). This sample simulation will model a two-story building subjected to an earthquake and an MR damper placed between the ground and the first story of the structure. The MATLAB code and models will be downloaded from the host over TCP to xPC Target 1 and xPC Target 2. xPC Target 1 will execute the model of the two floor structure in real-time, and xPC Target 2 will execute the model of the damper in real-time. The two target computers will communicate with each other and share data over a network using UDP. The information contained in the UDP blocks will include the displacement, velocity, and force. After the simulation has completed, results, such as structural responses and damper forces, will be sent from the xPC Target 1 to the host computer. By working with and manipulating this tool, users will gain a better understanding of how vRTHS and RTHS can be executed using xPC target. This activity was supported in part by the National Science Foundation under Grant: NSF-ACI-1148255

Cite this work

Researchers should cite this work as follows:

  • Sarah Hacker; Xin Li; Shirley Dyke (2013), "Virtual RTHS Sample Using xPC ,"

    BibTex | EndNote