## 2 Materials and Methods
### Cardiac Function  
Ventricular functions were described using the relationship between ventricular pressure and volume signals by utilising both active and passive contraction components. The left ventricular pressure signal (p\({}_{\rm lv}\)) during the active contraction of the left ventricle is driven by an activation function (f\({}_{\rm act,lv}\)) and it utilises the end-systolic elastance (E\({}_{\rm es,lv}\)), left ventricular volume (V\({}_{\rm lv}\)) and left ventricular zero pressure volume (V\({}_{\rm lv,0}\)) [28]. The left ventricular passive pressure component (p\({}_{\rm lv,p}\)) was modelled using an exponential relationship between pressure and volume signals [28]. \[\rm P_{lv,a}(t)=E_{es,lv}(V_{lv}-V_{lv,0})f_{act,lv}(t), \tag{1}\]  
\[\rm P_{lv,p}=Ae^{(BV_{lv})}-1, \tag{2}\]  
\[\rm P_{lv}=p_{lv,a}+p_{lv,b}, \tag{3}\]  
Left ventricular volume (V\({}_{\rm lv}\)) was described using the left ventricular radius (r\({}_{\rm lv}\)), long axis length (l\({}_{\rm lv}\)) and an additional coefficient (K\({}_{\rm lv}\)), which includes effects of the contraction in the long axis and scales the proportion between the left ventricular radius and volume over a cardiac cycle [28]. Change of the left ventricular radius (r\({}_{\rm lv}\)) was described utilising the flow rates through the aortic and mitral valves (Q\({}_{\rm av}\), Q\({}_{\rm mv}\)), left ventricular volume, long axis length and the coefficient K\({}_{\rm lv}\)[28]. \[\rm V_{lv}=\frac{2}{3}\pi K_{lv}r_{lv}^{2}l_{lv}, \tag{4}\]  
\[\rm\frac{dr_{lv}}{dt}=\frac{3(Q_{mv}-Q_{av})}{4\pi K_{lv}l_{lv}}\bigg{(}\frac {3V_{lv}}{2\pi K_{lv}l_{lv}}\bigg{)}^{-1/2}, \tag{5}\]  
Figure 1: **(a)** The RR intervals used in simulations to simulate normal sinus rhythm (SR) and atrial fibrillation (AF) with unimodal and bimodal sample distributions, the frequency diagrams of RR intervals used to simulate **(b)** normal sinus rhythm, **(c)** atrial fibrillation with unimodal RR interval distribution and **(d)** atrial fibrillation with bimodal RR interval distribution. Time bin is 5 ms in the frequency histograms. The activation function (f\({}_{\text{act,lv}}\)) was described using instantaneous time (t), the durations of active contraction (T\({}_{1}\)) and relaxation (T\({}_{2}\)) phases and the duration of an RR interval (RR) [29]. \[\text{f}_{\text{act,lv}}(\text{t})=\left\{ \begin{array}{ll}\frac{1-\cos((t/ \text{T}_{1})\pi)}{2}&0\leq\text{t}<\text{T}_{1},\\ \frac{1+\cos((\text{t}-\text{T}_{1})/(\text{T}_{2}-\text{T}_{1})\pi)}{2}&\text{ T}_{1}\leq\text{t}<\text{T}_{2}\\ 0&\text{T}_{2}\leq\text{t}<\text{RR},\end{array} \right., \tag{6}\]  
The durations of the active contraction (T\({}_{1}\)) and relaxation (T\({}_{2}\)) phases in the cardiovascular system model with normal SR were described by utilising linear relationships considering the physiological data [30]. \[\text{T}_{1}=0.33\text{RR}, \tag{7}\]  
\[\text{T}_{2}=0.45\text{RR}, \tag{8}\]  
The left atrial pressure (p\({}_{\text{la}}\)) and volume (V\({}_{\text{la}}\)) relationship was described using elastance (E\({}_{\text{la}}\)) [28,29]. \[\text{p}_{\text{la}}(\text{t})=\text{E}_{\text{la}}(\text{t})(\text{V}_{\text {la}}-\text{V}_{\text{la},0}), \tag{9}\]  
Left atrial volume (V\({}_{\text{la}}\)) was described using the left atrial radius (r\({}_{\text{la}}\)), long axis length (l\({}_{\text{la}}\)) and an additional coefficient (K\({}_{\text{la}}\)) [28]. Change of the left atrial radius (r\({}_{\text{la}}\)) was described utilising the flow rates through the mitral valve and pulmonary vein (Q\({}_{\text{mv}}\), Q\({}_{\text{vp}}\)), left atrial volume, long axis length and the coefficient K\({}_{\text{la}}\)[28].