In the BCVTB, data is exchanged between the different clients using a fixed synchronization time step. There is no iteration between the clients. In the co-simulation literature, this coupling scheme is referred to as *quasi-dynamic coupling*, *loose coupling* or *ping-pong coupling*. See [Hensen (1999)] and [Zhai and Chen (2005)] for details.
The algorithm for exchanging data between clients is as follows: Suppose we have a system with two clients, where each client solves an initial value ordinary differential equation that is coupled to the ordinary differential equation of the other client. Let
$N\in \mathbb{N}$
denote the number of time steps and let
$k\in \{0,\dots ,N\}$
denote the time steps.
For some
${n}_{1},{n}_{2}\in \mathbb{N}$,
let
${f}_{1}\phantom{\rule{0.167em}{0ex}}:\phantom{\rule{0.167em}{0ex}}{\Re}^{{n}_{1}}\times {\Re}^{{n}_{2}}\to {\Re}^{{n}_{1}}$
and
${f}_{2}\phantom{\rule{0.167em}{0ex}}:\phantom{\rule{0.167em}{0ex}}{\Re}^{{n}_{2}}\times {\Re}^{{n}_{1}}\to {\Re}^{{n}_{2}}$
denote the functions that compute the next value of the state variables in simulator 1 and 2. Note that these functions are defined by the sequence of code instructions executed in the respective simulator.
The simulator 1 computes, for
$k\in \{0,\dots ,N-1\}$, the sequence

$\phantom{\rule{1.00em}{0ex}}{x}_{1}(k+1)={f}_{1}({x}_{1}\left(k\right),\phantom{\rule{0.167em}{0ex}}{x}_{2}\left(k\right)),$,

and, similarly, the simulator 2 computes the sequence

$\phantom{\rule{1.00em}{0ex}}{x}_{2}(k+1)={f}_{2}({x}_{2}\left(k\right),\phantom{\rule{0.167em}{0ex}}{x}_{1}\left(k\right)),$

with initial conditions ${x}_{1}\left(0\right)={x}_{1,0}$ and ${x}_{2}\left(0\right)={x}_{2,0}$. An implementation difficulty is presented by the situation that ${f}_{1}(\cdot ,\cdot )$ and ${f}_{2}(\cdot ,\cdot )$ need to know the initial value of the other simulator. Thus, at $\mathrm{k=0}$, both simulators exchange their initial value ${x}_{\mathrm{1,0}}$ and ${x}_{\mathrm{2,0}}$. To advance from time $k$ to $\mathrm{k+1}$, each simulator uses its own time integration algorithm. At the end of the time step, the simulator 1 sends the new state ${x}_{1}\mathrm{(k+1)}$ to the BCVTB and it receives the state ${x}_{2}\mathrm{(k+1)}$ from the BCVTB. The same procedure is done by the simulator 2. The BCVTB synchronizes the data in such a way that it does not matter which of the two simulators is called first.

In terms of numerical methods for ordinary differential equations, this scheme is identical to an explicit Euler integration, which is an integration algorithm for a differential equation

$\phantom{\rule{1.00em}{0ex}}\dot{x}=h\left(x\right),x\left(0\right)={x}_{0},$

where $h\phantom{\rule{0.167em}{0ex}}:\phantom{\rule{0.167em}{0ex}}{\Re}^{n}\to {\Re}^{n}$ for some $n\in \mathbb{N}$. On the time interval $t\in [0,\phantom{\rule{0.167em}{0ex}}1]$, the explicit Euler integration algorithm leads to the following sequence:

Step 0:
| Initialize counter $\mathrm{k\; =\; 0}$ and number of steps $n\in \mathbb{N}$. |

Set initial state ${\mathrm{x(k)=x}}_{0}$ and set time step $\mathrm{\Delta t\; =\; 1/N}$. | |

Step 1:
| Compute new state $\mathrm{x(k+1)\; =\; x(k)\; +}h\mathrm{(x(k))\; \Delta t}$. |

Replace $k$ by $\mathrm{k+1}$. | |

Step 2:
| If $\mathrm{k=N}$ stop, else go to Step 1. |

In the situation where the differential equation is integrated over time using co-simulation, the above algorithm becomes:

Step 0:
| Initialize counter $\mathrm{k\; =\; 0}$ and number of steps $n\in \mathbb{N}$ |

Set initial states ${x}_{1}\mathrm{(k)=}{x}_{\mathrm{1,0}}$ and ${x}_{2}\mathrm{(k)=}{x}_{\mathrm{2,0}}$. | |

Set time step $\mathrm{\Delta t\; =\; 1/N}$. | |

Step 1:
| Compute new states |

$\phantom{\rule{1.00em}{0ex}}{x}_{1}(k+1)={x}_{1}\left(k\right)+{f}_{1}({x}_{1}\left(k\right),\phantom{\rule{0.167em}{0ex}}{x}_{2}\left(k\right))\phantom{\rule{0.167em}{0ex}}\Delta t$, and | |

$\phantom{\rule{1.00em}{0ex}}{x}_{2}(k+1)={x}_{2}\left(k\right)+{f}_{2}({x}_{2}\left(k\right),\phantom{\rule{0.167em}{0ex}}{x}_{1}\left(k\right))\phantom{\rule{0.167em}{0ex}}\Delta t$. | |

Replace $k$ by $\mathrm{k+1}$. | |

Step 2:
| If $\mathrm{k=N}$ stop, else go to Step 1. |

This algorithm is implemented in the BCVTB. It does not require an iteration between the two simulators.

We note that other data synchronizations may be possible. For example, in *strong coupling*, within each time step, simulators exchange data until a convergence criteria is satisfied. This implementation requires the numerical solution of a nonlinear system of equations in which the termination criteria is a function of the state variables of the coupled simulators. However, many building simulation programs contain solvers that compute with relatively coarse precision. This can introduce significant numerical noise which may cause convergence problems for the co-simulation. The computing time of strong coupling vs. loose coupling of EnergyPlus and TRNSYS was compared by
[Trcka et al. (2007)].
Although loose coupling required shorter synchronization time steps, the work per time step was smaller (as no iterations were needed) which caused loose coupling to compute faster than strong coupling. An additional implementation benefit of loose coupling is that state variables need not be reset to previous values. Thus, loose coupling is easier to implement, is numerically more robust and it computed faster in the experiments reported by
[Trcka et al. (2007)].