## Appendix A
``` %%%%%%%%%  
```
k=i+nzeros; phi=[Y(t-1) Y(t-2) U(t-1) U(t-2) epsilon(t) epsilon(t-1) epsilon(t-2) epsilon(k-3)]'; K=P*phi*1/(1+phi*P*phi); P=P*PiPiin%pinv(1+phi*P*phi)*Pi*P; error(i)=Y(k)-phi*theta_hat_els(,:); theta_hat_els(,:i+1)=theta_hat_els(:)+K*error(i); epsilon(k)=Y(k)-phi*theta_hat_els(,:+1);%Form Posterior Residual THETA_hat(,:+1) = theta_hat_els(1:4:i+1); a1=THETA_hat(1,i+1);a2=-THETA_hat(2,i+1);b0=THETA_hat(3,i+1);b1=THETA_hat(4,i+1);%Update A & B coefficients; Af(:)=[1 a1 a2]; BF(i,:)=[b0 b1]'; %Store final A and B for comparison with real A&B to generate epsilon errors r1=(b1/b0)+(b1^2-am1*b0*b1+am2*b0^2)*(b1+a0*b0)/(b0*(b1^2-a1*b0*b1+a2*b0^2)); s0=b1*(a0*am1-a2-am1*a1+a1^2+am2-a1*a0)/(b1^2-a1*b0*b1+a2*b0^2)+b0*(am1*a2-a1*a2-a0*am2+a0*a2)/(b1^2-a1*b0*b1+a2*b0^2); s1=b1*(a1*a2-am1*a2+a0*am2+a0*a2)/(b1^2-a1*b0*b1+a2*b0^2)+b0*(a2*am2-a2*a0*am2*a1+a0*a2*am1)/(b1^2-a1*b0*b1+a2*b0^2); R=[1 r1]*S=[s0 s1];T=BETA*[1 a0];
```  
```
%calculate control signal U(t)=[T(1) T(2) -R(2) -S(1) -S(2)]*[Uc(t) Uc(t-1) U(t-1) Y(t) Y(t-1)]'; U(t)=1.3*[T(1) T(2) -R(2) -S(1) -S(2)]*[Uc(t) Uc(t-1) U(t-1) Y(t) Y(t-1)]';%Arbitrarily increased to duplicate text end plotu = [plotu; U]; plotb = [plotv; Y]; plottttt = [plotttt;THETA_hat]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%END OF EXTENDED LEAST SQUARES





* [PERSON] and [PERSON] between Denmark and Germany Center of Scientific Communication in Astronomy. In _Around [PERSON] and the Geometric Representation of Complex Numbers: Proceedings of the Wessel Symposium at the Royal Danish Academy of Sciences and Letters, Copenhagen, 11-15 August 1998_; Invited Papers; Videnskabernes Selskab: Copenhagen, Denmark, 2001; pp. 99-120. Available online: [[http://gymarkiv.sdu.dk/MFM/kdvs/mfm%2040-49/mfm-46-2.pdf](http://gymarkiv.sdu.dk/MFM/kdvs/mfm%2040-49/mfm-46-2.pdf)]([http://gymarkiv.sdu.dk/MFM/kdvs/mfm%2040-49/mfm-46-2.pdf](http://gymarkiv.sdu.dk/MFM/kdvs/mfm%2040-49/mfm-46-2.pdf)) (accessed on 29 April 2021). * Astrophysical Institute (2012) Astrophysical Institute. _Astronomische Nachrichten_; Archived from the original on 28 June 2012; Astrophysical Institute: Potsdam, Germany, 2012. Available online: [[https://onlinelibrary.wiley.com/loi/15213994/year/1823](https://onlinelibrary.wiley.com/loi/15213994/year/1823)]([https://onlinelibrary.wiley.com/loi/15213994/year/1823](https://onlinelibrary.wiley.com/loi/15213994/year/1823)) (accessed on 29 April 2021). * [PERSON] (1929) [PERSON] _A Source Book of Mathematics_; McGraw-Hill Book Company: New York, NY, USA, 1929; pp. 576-579. * [PERSON] (1805) [PERSON] _Notes on Nourvelles Methodes pour la Determination des Orbites des Cometes_; Second supplement to the third edition of Legendre (1805); [PERSON]; [PERSON]; [PERSON], [PERSON]; Courcier: Paris, France; McGraw-Hill: New York, NY, USA, 1920. Available online: [[https://catalogue.nla.gov.au/Record/866184](https://catalogue.nla.gov.au/Record/866184)]([https://catalogue.nla.gov.au/Record/866184](https://catalogue.nla.gov.au/Record/866184)) (accessed on 27 May 2021). * [PERSON] and Wittenmark (1972) [PERSON]; [PERSON] On the Control of Constant but Unknown Systems. In Proceedings of the 5 th IFAC World Congress, Paris, France, 12-17 June 1972. * [PERSON] and [PERSON] (1973) [PERSON]; [PERSON] On self-tuning regulators. _Automatica_**1973**, \(9\), 185-199. [CrossRef]
* [PERSON] and [PERSON] (1995) [PERSON]; [PERSON] _Adaptive Control_; Addison-Wesley: Boston, FL, USA, 1995; pp. 43, 48, 63-65, 331. * [PERSON] (2018) [PERSON] Space System Identification Algorithms. _J. Space Explor._**2018**, \(6\), 138. * [PERSON] (2017) [PERSON] Nonlinear-Adaptive Mathematical System Identification. _Computation_**2017**, \(5\), 47. [CrossRef]
* [PERSON] and [PERSON] (1991) [PERSON]; [PERSON] _Applied Nonlinear Control_; Prentice-Hall: London, UK, 1991; pp. 331, 365. * [PERSON] (1993) [PERSON] Comments on Hamiltonian adaptive control of spacecraft by [PERSON] and [PERSON]. _IEEE Trans. Autom. Control_**1993**, _38_, 671-672.