The directory bcvtb/examples
contains
several example files that show how to use the BCVTB. In
these examples, the following programs are linked to the
BCVTB:
The C and Fortran 90 simulation programs are provided to show developers how to couple a new program to the BCVTB. The program that is called at each time step with different program arguments shows how programs can be called and how their output files can be parsed. The BCVTB also contains examples that show how models of control systems and of HVAC systems can be implemented directly in Ptolemy II using Ptolemy II's graphical model editor. The examples of control systems include a heterogeneous system consisting of a discrete time controller with a Finite State Machine.
One of the simplest examples can be found in the
directory bcvtb/examples/c-room
. This
example illustrates the implementation of a simulation
program written in C that communicates with Ptolemy II
through BSD sockets. The simulation program computes the
temperature change in two rooms with different heat
capacities. Input to the simulation program is the vector
of control signals
uk
. Output of the simulation program are the vector of new
room temperatures
Tk+1
. The control action is computed in Ptolemy II.
Figure 3.1
shows the Ptolemy II model.
Figure 3.1. System model that links Ptolemy II to a room model that is implemented in the C language.