# Dynamic Optimization Using Local Collocation Methods and Improved Multiresolution Technique
## 2 Problem Statement and Local Collocation Methods  
Without a loss of generality, a dynamic optimization problem can be formulated as: minimizing the following Bolza cost functional:  
\[J=M(\mathbf{x}(t_{0}),t_{0},\mathbf{x}(t_{f}),t_{f})+\int_{t_{0}}^{t_{f}}L( \mathbf{x}(t),\mathbf{u}(t),t)\mathrm{d}t, \tag{1}\]  
subject to the state dynamic constraints  
\[\dot{\mathbf{x}}=\mathbf{f}(\mathbf{x}(t),\mathbf{u}(t),t),\;t\in[t_{0},t_{f}], \tag{2}\]  
the boundary constraints (i.e., initial and terminal constraints)  
\[\mathbf{E}(\mathbf{x}(t_{0}),t_{0},\mathbf{x}(t_{f}),t_{f})=0, \tag{3}\]  
and the inequality path constraints  
\[\mathbf{C}(\mathbf{x}(t),\mathbf{u}(t),t)\leq 0,t\in[t_{0},t_{f}], \tag{4}\]  
where \(t\in[t_{0},t_{f}]\subseteq\mathbb{R}\), \(\mathbf{x}:[t_{0},t_{f}]\rightarrow\mathbb{R}^{n}\), \(\mathbf{u}:[t_{0},t_{f}]\rightarrow\mathbb{R}^{m}\), \(M:\mathbb{R}^{n}\times\mathbb{R}\times\mathbb{R}^{n}\times\mathbb{R}\rightarrow \mathbb{R}\), and \(L:\mathbb{R}^{n}\times\mathbb{R}^{m}\times\mathbb{R}\rightarrow\mathbb{R}\), \(\mathbf{f}:\mathbb{R}^{n}\times\mathbb{R}^{m}\times\mathbb{R}\rightarrow \mathbb{R}^{n}\), \(\mathbf{E}:\mathbb{R}^{n}\times\mathbb{R}\times\mathbb{R}^{m}\times\mathbb{R} \rightarrow\mathbb{R}^{e}\), and \(\mathbf{C}:\mathbb{R}^{n}\times\mathbb{R}^{m}\times\mathbb{R}\rightarrow \mathbb{R}^{e}\). It should be noted that an equality path constraint can be decomposed into two inequality path constraints. In addition to better numerical stability, it is more convenient to solve a dynamic optimization problem on the unit time interval \([0,1]\). Therefore, the transformation \(\tau=(t-t_{0})/(t_{f}-t_{0})\) is used to express the abovementioned dynamic optimization problem on the interval \(\tau\in[\tau_{0},\tau_{f}]=[0,1]\). The local direct collocation methods based on RK discretizations [3] are used in the present research to transform the dynamic optimization problem into a NLP problem. The states, controls, and path constraints are discretized on a mesh \(G=\{\tau_{i}\}_{i=0}^{N_{\tau}}\) with \(\tau_{0}=0\), \(\tau_{N_{\tau}}=1\) and \(\tau_{i}<\tau_{i+1}\) for \(0\leq i\leq N_{\tau}-1\). Let us denote \(\mathbf{x}_{i}=\mathbf{x}(\tau_{i})\) and \(\mathbf{u}_{i}=\mathbf{u}(\tau_{i})\), and define the following sets:  
\[\mathbf{X}=\{\mathbf{x}_{0},\mathbf{x}_{1},\cdots,\mathbf{x}_{N_{\tau}}\}, \mathbf{U}=\{\mathbf{u}_{0},\mathbf{u}_{1},\cdots,\mathbf{u}_{N_{\tau}}\},\]  
The resulting NLP problem can be stated as: minimize the objective  
\[J=M(\mathbf{x}_{0},t_{0},\mathbf{x}_{f},t_{f})+\Delta t\sum_{i=0}^{N_{\tau}-1 }h_{i}\sum_{l=1}^{q}\beta_{l}L_{il}, \tag{5}\]  
subject to the following constraints:  
\[\boldsymbol{\xi}_{i}=\mathbf{x}_{i+1}-\mathbf{x}_{i}-\Delta t\cdot h_{i}\sum_ {j=1}^{q}\beta_{j}\mathbf{f}_{ij}=0,\;(i=0,\;1,\;\cdots,\;N_{\tau}-1), \tag{6}\]  
\[\mathbf{C}_{i}=\mathbf{C}(\mathbf{x}_{i},\mathbf{u}_{i},\tau_{i};t_{0},t_{f} )\leq 0,\;(i=0,\;1,\;\cdots,\;N_{\tau}), \tag{7}\]  
\[\overline{\mathbf{C}}_{ij}=\mathbf{C}(\mathbf{x}_{ij},\mathbf{u}_{ij},\tau_{ ij};t_{0},t_{f})\leq 0,\;\tau_{ij}\in\overline{G}, \tag{8}\]  
\[\mathbf{E}(\mathbf{x}_{0},t_{0},\mathbf{x}_{f},t_{f})=0, \tag{9}\]  
where \(\mathbf{X}\), \(\mathbf{U}\), \(\overline{\mathbf{U}}\), \(t_{0}\) and \(t_{f}\) are the decision variables, \(\Delta\tau=\tau_{f}-\tau_{0}\), \(h_{i}=\tau_{i+1}-\tau_{i}\), \(L_{il}=L_{il}(\mathbf{x}_{il},\mathbf{u}_{il},\tau_{il})\), and \(\mathbf{f}_{il}=\mathbf{f}_{ij}(\mathbf{x}_{il},\mathbf{u}_{il},\tau_{il})\). The intermediate variables \(\mathbf{x}_{il}\), \(\mathbf{u}_{il}\) and \(\tau_{il}\) are given by\[\dot{\mathbf{x}}=\mathbf{f}(\mathbf{x}(t),\mathbf{u}(t),t),\;t\in[t_{0},t_{f}], \tag{2}\]0  
The RK discretizations can be further classified according to the stage \(q\). The commonly used discretization schemes include the trapezoidal scheme (\(q=2\)), the Hermite-Simpson scheme (\(q=3\)), and the classical fourth-order RK scheme (\(q=4\)).