# A Neural Network Model for Estimating the Heart Rate Response to Constant Intensity Exercises
## 2 Materials and Methods
### Mathematical Analysis  
The architecture of the single-input and single-output NN model proposed by the present study is equivalent to a non-linear function \(hr(t)\) that defines a mapping between two scalars, the beat-to-beat heart rate (\(hr\)) values and the time (\(t\)). Mathematical evaluations of this function have been proposed and extensively studied, as to their goodness of fit  
Figure 4: Flow chart of the whole procedure from end to end.  
to raw HR data, as well as to their rigor and mathematical validity. In this sub-section, we will briefly reference the two main mathematical approaches, the exponential 3-phase model and the dynamical systems model (both discussed in more detail in [9, 10]).  
The 3-phase model has been emerged as the best fit to the data, from a statistical point of view. To simulate the body's response to exercise, the _hr_ values are calculated by use of the following exponential relation (the two last distinct terms are activated at the beginning of the last two phases):  
\[\begin{array}{ll}hr(t)=hr(0)&+A_{1}\Big{(}1-e^{-t/\tau_{1}}\Big{)}&\mbox{ \it phase 1}\\ &+A_{2}\Big{(}1-e^{-(t-TD_{2})/\tau_{2}}\Big{)}&\mbox{\it phase 2}\\ &+A_{3}\Big{(}1-e^{-(t-TD_{3})/\tau_{3}}\Big{)}&\mbox{\it phase 3}\end{array} \tag{2}\]  
where \(\tau_{1}\), \(\tau_{2}\), and \(\tau_{3}\) are the time constants used to fit the exponentials, the parameters \(A_{1}\), \(A_{2}\), and \(A_{3}\) control the asymptotic HR values, and the constants \(TD_{2}\) and \(TD_{3}\) are the time delays that correspond to each one of the assumed phases. The _hr_ values during recovery are modeled using one exponential.  
It should be noted that much debate exists as to the validity of this model as, despite many attempts for a number of years, no convincing physiological mechanism for such discontinuous behavior has been proven to exist. It is very likely that the observed three phases are a figment of the incorrect and overly simple treatment of the data (such as averaging). Moreover, the above 3-phase model cannot be used for prediction, as the model's parameters reflect the body's physiological response to the particular exercise intensity only.  
An alternative mathematical approach based on dynamical systems assumes the _hr_ values to arise as solutions of the following set of coupled ordinary differential equations, regarding the rates of change of heart rate _hr_ and velocity \(v\):  
\[\begin{array}{ll}\frac{\mathit{d}hr}{d1}=-f_{min}(hr,\lambda)\cdot f_{max}(hr) \cdot f_{D}(hr,hr(0),v,\lambda,t)\\ \frac{dv}{dt}=I(t)\end{array} \tag{3}\]  
where \(\lambda\) is a global parameter that defines the current cardio-vascular condition (takes values between 0 and 1), \(f_{min}\) and \(f_{max}\) are functions that act as repellers and control the dynamics near the minimum and the maximum heart rate respectively, \(f_{D}\) is a function that acts as an attractor and controls the dynamics near the heart rate demand, and \(I(t)\) is the exercise intensity. In this dynamical systems model, the resulting _hr_ is a smooth and continuous function of time, as no phases or time-delays in the body's response to exercise are assumed to exist. This model is able to simulate and predict heart rate kinetics for any given exercise intensities. Examples of the HR values simulated by the above dynamical systems model are provided in the following section.