## 2 Model Free Algorithms
### Model Free Adaptive Control (MFAC)
#### 2.1.1 Compact Form Dynamic Linearization (CFDL)
This fact is due to the change in the value of \(\hat{\phi}_{k}\) when the system controls itself. Therefore, an algorithm for adjusting the initial value was developed so that the overall dynamic behavior improves to obtain the best performance in the first phase of the adjustment, but also later, for step-type variations of the reference signal. Taking into account the aforementioned, in order to apply the algorithm to obtain an optimized \(\hat{\phi}_{1}\), it is necessary that a sequence of step signals to be applied as a reference for the control system. Since the behavior of the system may not be exactly optimal until the first steady-state control error is obtained, only the errors obtained after the second step reference is applied are taken into account. These absolute control errors will be acquired, and their average will be calculated; they will be referred to as _aEs_ (average absolute error steps). Also, the average value for \(\hat{\phi}_{k}\) is computed for the last sample periods before a step-type variation of the reference is applied. The resulting value is called _al\(\hat{\phi}_{k}\)_ (average last \(\hat{\phi}_{k}\) values). A new value of \(\hat{\phi}_{1}\) is obtained using the previous value, _al\(\hat{\phi}_{k}\)_, and a _step_ factor is considered in order to determine the granularity after which the search for the optimized value is made. If the average error steps (_aEs_) value is lower than the product of the last average error steps (_last_aEs_) and a scalar, _var_, and the resulting value of \(\hat{\phi}_{1}\) is positive, then the _new_\(\hat{\phi}_{1}\)_ is validated and saved to the \(\hat{\phi}_{1}\) value history, \(\Phi_{k}\). Also, average error steps (_aEs_) are saved in the _aEs_\(v_{k}\)_ vector and validated for further use. If the value of _aEs_ does not decrease or remains constant for 3 consecutive iterations, then the loop breaks. The _var_ scalar makes the condition more or less relaxed depending on its value. Finally, the vector of _aEs_ values is analyzed and its minimum is sought. For the respective index, the value for which the minimum was obtained is searched in the \(\Phi\) vector. The optimized value of \(\hat{\phi}_{1}^{*}\) is compared experimentally with the value used at the beginning of the interactive algorithm, \(\hat{\phi}_{1}\). In conclusion, the algorithm is an iterative one, starting from a set of parameters that stabilize the control system, after which the necessary signals are acquired to determine a new value of \(\hat{\phi}_{1}\) based on the obtained _aEs_ values. Afterwards, the new value of \(\hat{\phi}_{1}\) is used in a simulation, after which data is acquired, _aEs_ is calculated, and the results are compared with what was previously obtained. The _aEs_ values, for all steps of the algorithm, are stored in parallel with the \(\hat{\phi}_{1}\) values for which they were obtained. After determining the minimum value of _aEs_ by reaching the stop condition, the \(\hat{\phi}_{1}\) value that offered the lowest _aEs_ value is considered the optimized value and becomes \(\hat{\phi}_{1}^{*}\). The following pseudocode describes the error minimization algorithm:  
From the point of view of complexity, Algorithm 1 may be categorized as an efficient one. It requires only \(O(i)\) complexity in terms of time and space, depending on the number of iterations \(i\) of the algorithm. \(O\) represents the order, while the value within parentheses indicates the growth rate of the algorithm. These values are the result of the fact that running the experiment from point 3.a. of the algorithm is constant, both in terms of time and space required to store the values acquired from the control system.