## 2 Materials and Methods
### Continuous Predictive Closed Loop Optimum Controller  
This section briefly describes the implementation of a feedback optimum controller where the constants of integration are continuously calculated by the controller instantaneously. The basis of the derivation begins with the previously mentioned solution to the optimization problem, substantiating a novel contribution. Recall from the previous section, Equation (21) \(u=-12t+6\) is not the global optimum controller. As time progresses, the boundary conditions used to solve Equation (17) \(u=at+b\) change. Additionally, the starting position changes due to movement, noise, and uncertainties. This and subsequent controllers implement the optimum control using feedback to deal with changing boundary conditions. Rather than command the controller using the local optimum solution in Equation (21), instead use the global optimal solution in Equation (17) with full state feedback. Using the present state as the new initial boundary value, we solve for the constants of integration of the general optimum control in Equation (17). Recall that \(a=-12\) and \(b=6\) resulted from the specified initial and final conditions. As time progresses, this continuous predictive (closed loop) optimum controller will calculate new \(a\)'s and \(b\)'s using its present time as the initial condition. 1. Recall Equations (18)-(20) where \(\theta(1)=1,\omega(1)=0\) yields: \[\theta(1)=\frac{a}{6}(1)+\frac{b}{2}(1)+c(1)+d=\frac{a}{6}+\frac{b}{2}+c+d=1\] (22) \[\omega(1)=\frac{a}{2}(1)+b(1)+c=\frac{a}{2}+b+c=0\] (23)
2. Set up a matrix equation in the form \([A][x]=[B]\) simulated in Figure 3.  
\[\underbrace{\left[ \begin{array}{cccc}\frac{t_{0}^{3}}{6}&\frac{t_{0}^{2}}{2 }&t_{0}&1\\ \frac{t_{0}^{2}}{2}&t_{0}&1&1\\ \frac{t_{0}^{2}}{2}&t_{0}&1&1\\ \frac{t_{1}}{2}&1&1&0\end{array} \right]}_{[A]}\underbrace{\left[ \begin{array} []{c}a\\ b\\ c\\ d\end{array} \right]}_{[x]}=\underbrace{\left[ \begin{array}{c}\theta(0)\\ 1\\ \omega(0)\\ 0\end{array} \right]}_{[B]}\rightarrow\{x^{\star}\}=[A]^{\dagger}[B]\rightarrow \left\{ \begin{array}{c}x(1)\\ x(2)\\ x(3)\\ x(4)\end{array} \right. \tag{24}\]  
This matrix expression in Equation (24) can be solved in real-time as the simulation progresses in several ways. Two methods are depicted in Figure 3. There is a complication to continuously updating constants \(a\) and \(b\). As time approaches the end time (\(t=1\)), the \([A]\) matrix becomes rank deficient, because the rows are linearly dependent. This will cause the computer program to become unstable. The integration constants in Figure 4 vary as time progresses. As \(t\) approaches \(t_{f}=1\), the values of the constants oscillate unstably to very large values. To account for this shrinking horizon prediction control problem, an optimum open loop controller is inserted and used at these times. We disregard  
Figure 2: SIMULINK model of optimal controlled double integrator plant with noise added. the unstable values that come out of the continuous predictive control logic. Intuition: This should increase cost slightly from the optimum case. The LU inverse approach to dealing with matrix inverses in Figure 3 required open loop command to occur as early as \(t=0.9\), while the LU solver approach allows for smaller blind time. This is desirable, because this blind time foreshadows errors in meeting our end conditions. This is a good time to point out that it is not the value of \([A]^{-1}\). The value of \([A]^{-1}\) is an intermediate calculation step to get \([a\ b\ c\ d]\). Calculating the matrix inverse can be problematic, so avoid the unnecessary pitfalls by not calculating \([A]^{-1}\). Instead, use the LU solver (or QR solver, etc.) or the LU inverse. This control is somewhat unrealistic, since a body's onboard computer may not have access to information quickly enough to generate correct integration constants. There is a lag time associated with sensing, and onboard computers may be limited.