## 2 Theoretical Background and Preliminaries
### Nn-Narx Modeling of the MI System
The vector is obtained from the input weight coefficients defined in IW1,1, bias, b1, and the output network vector, \(y(t)\), which leads to a time delay block and then multiplied by the weight coefficient, LW1,3. The resulting vector, \(n1(t)\) is then directed to the first layer activation function, f1. The output from the first layer \(a1(t)\), which represents the result of the operation of the activation function, f1, reaches the second layer, which is converted to the vector \(n2(t)\) by the weight coefficients of LW2,1 and the b2 bias. This vector is then plotted in bias f2 to obtain the final neural network output, y(t). The feedback from the output neurons to the input of network causes a system state formation and lead to mimicing dynamical system models. Therefore, it can learn and represent time responses of dynamic systems. Two-layer neural networks with a nonlinear activation function are capable of learning nonlinear relations in inputs and state transition patterns. This property enables representation of nonlinear system dynamics by NARX model when it is trained properly. Therefore, after training with input-output data of the dynamical systems, NARX model can mimic dynamical behavior of systems and it is employed for prediction of time response of dynamic systems. This property makes NARX modeling a good candidate solution for online modeling problems of nonlinear dynamical systems in intelligent control applications. The reason why a neural network is selected for modeling is that neural networks are very good at time-series problems. A neural network with enough elements (neurons) can model dynamic systems with arbitrary accuracy. They are particularly well suited for addressing non-linear dynamic problems. Neural network is a good candidate for solving this problem. The network will be designed by using recordings of an actual levitated magnet's position responding to a control current. The output of a NARX artificial neural network has the following form [20; 23; 24]:  
\[y(t)=f\left( \begin{array}{c}y(t-1),y(t-2),...y(t-n)\\ u(t-1),u(t-2),...u(t-n)\end{array} \right), \tag{33}\]  
where \(y(t-i)\) is the \(ith\) previous sample of NARX output and \(u(t-i)\) is the \(i\)-th previous sample of the NARX input. These samples are stored to the TDL buffers and the parameter \(n\) configures the buffer size that determines depth of delayed memory to be considered in the NARX model. The feedback from model output with previous values [\(y(t-1)\), \(y(t-2)\), \(y(t-3)\),...,\(y(t-n)\)] forms an autoregressive model to predict the current value of the dynamical system. This delayed output values constitute pseudo-states to allow learning of system dynamics from time response data. The weight coefficients are indicated by \(lw\), obtained vector is stated with \(n\), first layer named \(a_{1}(t)\), \(b\) is bias, and \(f\) is activation functions. To obtain a black-box model of the experimental ML system via NARX modeling, time-series data was collected from the output of controller and the sphere position sensors. The data from output of controller was used for input data (\(u(t)\)) of NARX model. A time-series signal for the sphere position was collected and used to form output data (\(y(t)\)) of NARX model. The data set [\(u(t)y(t)\)] consists of 30,001 samples and it was used for training of the NARX model. The sampling period of data collection was 0.001 s and the data collection interval was continued for 30 s.  
In this section, the real MLS system is presented in order to compare the simulated models. The real MLS model is located between two ADC cards as the hardware-in-the-loop part. Details of neural network is shown in Table 2. The NARX model used a one input and three output neural network with a input layer with 12 neurons and hidden layer with one neuron. The buffer size (\(n\)) set to 1, which provides a sample delaying of input and output data in TDL blocks. Figure 5 shows the input and output with filters.