I have been pondering about this issue for some time...Say, I want to minimize a costfunctional$$\tilde J(u) = J(v(u),u) = \frac 12 \int_0^T (v-v_0)^2 + \alpha u^2 dt$$subject to$$\dot v = v^2 + u, \quad v(0)=0.$$Then, from the first order necessary optimality conditions it follows that at an optimal point $(v^*,u^*)$, there is a $\lambda$ that solves$$-\dot \lambda = 2v^*\lambda - (v^*-v_0), \quad \lambda(T)=0, \tag{1}$$such, that that the gradient of $\tilde J$ is given as$$D_u\tilde J(u^*) = \lambda + \alpha u^*=0. \tag{2}$$ From $(1)$ and $(2)$, I infer that $$u^*(T) = 0.$$ My Question: Is this right? Or is there something wrong in the argumentation.Two more remarks:I don't think that the answer lies in the right functional analytic formulation. (I have had a very close look at this). If one uses gradient based methods, then $(2)$ implies that the update is zero at $t=T$. Which means that the terminal value of the converged control will equal the terminal value of the initial guess. (I have seen this in a master thesis, where a fluid/structure interaction was successfully controlled by the adjoint based approach; see the screenshot)
zero terminal value of the adjoint based optimal control
optimization;optimal control;adjoint equation
You won't like the answer, but it is in fact This lies in the right functional-analytic framework -- which you have not given! In particular, you did not specify in which function space you are looking for $u$ in. If $u\in L^2$ as the formulation suggests, then asking for the value of $u$ at a single point makes no sense a priori. (Even if the ODE is based on classical derivatives, the optimal control will be $\bar u = \alpha^{-1}\bar \lambda$ in the sense of $L^2$. Hence even though the latter is indeed continuous and will have zero value at $t=T$, if you change $\bar u$ at $t=T$ arbitrarily, you will still get the same $L^2$ function (or rather, equivalence class of functions), so asking for the value of $\bar u(T)$ is not meaningful.)Now if you do a naive discretization of $u,v,\lambda$ by finite differences, identifying their function with their values at the nodes, you get exactly the behavior that you describe. If you do not want that, the usual procedure is to discretize a control in $L^2$ as piecewise constant on each control interval, in which case the optimal control $\bar u$ will not be $\alpha^{-1}\bar \lambda$ but its $L^2$ projection -- i.e., the average over each interval, which can be nonzero on the last interval even for $\bar \lambda(T)=0$.You could also look for $u\in H^1$ (not $H^1_0$!) -- adding an appropriate penalty to make the problem well-posed. In this case, $\bar u = (\alpha I+\beta \Delta)^{-1} \bar \lambda$ (i.e., the solution to $\beta\Delta u + \alpha u =\bar \lambda$  subject to homogeneous Neumann boundary conditions) will be continuous due to the Sobolev embedding and have a well-defined -- not necessarily zero -- value at $t=T$ even if $\bar \lambda(T)=0$.