## 2 Methodology
### Neural Ordinary Differential Equation  
The core concept of a neural ODE is to provide a residual neural network (ResNet) architecture to describe a continuous-time dynamical behavior. Suppose the state of a system at the \(k^{th}\) sampling time is denoted as \(\mathbf{h}(k)\); the dynamics can be described by ResNet as  
\[\mathbf{h}(k+1)=\mathbf{h}(k)+f(\mathbf{h}(k),\boldsymbol{\theta}) \tag{25}\]  
where \(f(\mathbf{h}(k),\boldsymbol{\theta})\) is a nonlinear function modeled by a neural network and parameterized by \(\boldsymbol{\theta}\). The iterative update equation in (25) can be seen as a Euclidean discretization result for a continuous-time model [31]. The output of the neural network can be regarded as the time derivative of the state when the time step \(\Delta t\) approaches zero:  
\[\frac{d\mathbf{h}(t)}{dt}=f(\mathbf{h}(t),\boldsymbol{\theta}) \tag{26}\]  
where \(t\) represents the continuous time stamp. In a continuous-time structure, the update equation can be written as  
\[\mathbf{h}(t)=\mathbf{h}(0)+\int_{0}^{t}f\big{(}\mathbf{h}\big{(}t^{\prime} \big{)},\boldsymbol{\theta}\big{)}dt^{\prime} \tag{27}\]  
The integral can be calculated by any kind of ODE solver. In this paper, the 4 th order Runge-Kutta (RK4) method is applied for numerical integration because of its conventional usage. As the discrete time step becomes smaller and a more precise ODE solver is used for discretization, the neural network model can approximate a differential equation closely. Modeling fan dynamics using neural ODE has been applied in the previous study [25]. Instead of only depending on the initial value, such as (27), the state of the cooling fan system is also affected by the forced input. Therefore, the neural ODE for the cooling fan system is defined as  
\[\begin{split}\dot{\omega}(t)&=f(\omega(t),\tau(t),\boldsymbol{\theta})=\mathbf{W}_{o}\text{tanh}\Big{(}\mathbf{W}_{i}\cdot \big{[}\begin{array}{cc}\omega(t)&\tau(t)\end{array}\big{]}^{T}+\mathbf{b}_ {i}\Big{)}+b_{o}\\ \omega(t)&=\omega(0)+\int_{0}^{t}f(\omega(t^{\prime}),\tau(t^{\prime}), \boldsymbol{\theta})dt^{\prime}\end{split} \tag{28}\]  
where \(\mathbf{W}_{i}\in\mathbb{R}^{n\times 2},\mathbf{W}_{o}\in\mathbb{R}^{1\times n}\) are weights, and \(\mathbf{b}_{i}\in\mathbb{R}^{n\times 1},b_{o}\in\mathbb{R}\) are biases, of the neural network. The neural network used in this paper only contains one hidden layer, which is displayed in Figure 3. The inputs of the neural network include the state of the system, the rotor speed, and the applied torque. The parameters \(\boldsymbol{\theta}=\{\mathbf{W}_{i},\mathbf{W}_{o},\mathbf{b}_{i},b_{o}\}\) can be estimated  
Figure 2: The structure of the NARX model.  
by applying gradient-based optimization to reduce the value of the loss function. In this paper, the loss function is set as the mean absolute error (MAE).  
\[L=\frac{1}{N}\sum_{k=1}^{N}|\omega(t)-\hat{\omega}(t)| \tag{29}\]  
After calculating the loss, the gradient-based optimization updates the parameters using the following equation  
\[\boldsymbol{\theta}^{(i+1)}=\boldsymbol{\theta}^{(i)}-\alpha\
abla_{ \boldsymbol{\theta}}L \tag{30}\]  
The subscript \((i)\) represents the number of iterations. \(\alpha\) is the learning rate, which is adjusted based on specific applications and optimization methods used. In this paper, ADAM optimization is applied to train the parameters of the neural network.