For device with two heaters, we will apply a multiple-input-multiple-output (MIMO) modeling.

Fig. 1 The device with two heaters. Heat from one heater affects another heater.

Fig. 1 The device with two heaters. Heat from one heater affects another heater.

Fig. 2 The heat exchange routes between the two resistors through convections. The exchange rates are represented by $c_1$, $c_2$, $c_3$, and $c_4$ .

Fig. 2 The heat exchange routes between the two resistors through convections. The exchange rates are represented by $c_1$, $c_2$, $c_3$, and $c_4$ .

Let us write the proper governing equations, as follows.

$$ \begin{equation} \begin{split} \dot{T}1(t)=\frac{K_1}{\tau_1}u_1(t-\theta_1)-c_1[T_1(t)-T{\infty}]-c_3[T_1(t)-T_2(t)] \\

\dot{T}2(t)=\frac{K_2}{\tau_2}u_2(t-\theta_2)-c_2[T_2(t)-T{\infty}]-c_4[T_2(t)-T_1(t)] \end{split} \end{equation} $$

where

$$ \begin{equation} \begin{split} c_1 &= \frac{1}{\tau_1} \\ c_2 &= \frac{1}{\tau_2} \end{split} \end{equation} $$

Let us first discretize the first line of Eq. 1, as follows.

$$ \begin{equation} \begin{split}

\frac{T_1(k)-T_1(k-1)}{\Delta t}=&\frac{K_1}{\tau_1}u_1\bigg(k-\frac{\theta_1}{\Delta t}\bigg)-c_1\big[T_1(k)-T_{\infty}\big]-\\&c_3\big[T_1(k)-T_2(k)\big] \\

(1+\Delta t c_1 + \Delta t c_3)T_1(k) =& \Delta t c_1 K_1u_1\bigg(k-\frac{\theta_1}{\Delta t}\bigg)+\Delta t c_1T_{\infty}+\\ &\Delta t c_3T_2(k) + T_1(k-1) \end{split} \end{equation} $$

Rearranging Eq. 3 and applying the similar technique to the second line of Eq. 1 give us the following equations.

$$ \begin{equation} \begin{split} T_1(k) = \frac{\Delta t c_1 K_1u_1\bigg(k-\frac{\theta_1}{\Delta t}\bigg)+\Delta t c_1T_{\infty}+\Delta t c_3T_2(k)+T_1(k-1)}{(1+\Delta t c_1 + \Delta t c_3)}\\

T_2(k) = \frac{\Delta t c_2 K_2u_1\bigg(k-\frac{\theta_2}{\Delta t}\bigg)+\Delta t c_2T_{\infty}+\Delta t c_4T_1(k)+T_2(k-1)}{(1+\Delta t c_2 + \Delta t c_4)}\\ \end{split} \end{equation} $$

We can now implement Eq. 4 into MATLAB as follows.