So I have this problem but I dont know if my solution is right. Can someone help me?
We consider the following fixed endpoint and free end time problem
$\min \int_{0}^{t_f}1 dt \\ s.t\\ x_{1}{'}(t) = x_2(t) \\ x_{2}{'}(t)) = u(t)\\ x_1(0) = 0\\ x_2(0) = 0\\ x_1(t_f) = 2\\ x_2(t_f) = 2\\ u(t) ∈ [−1, 1] ∀t ∈ [0, t_f].$
The optimal control for this problem is $u^∗ ≡ 1$, which leads to the optimal endtime $t^∗ = 2$.
1.) Calculate the corresponding endtime variation giving a pointwise structured solution.
So what I have done is: According to the Pontryagin's Maximum Principle, the optimal control for this problem must satisfy the following conditions:
There exists an adjoint state, denoted by p, that is co-state to the state variables and satisfies the adjoint equations: \begin{align*} p_{1}{'}(t) &= -p_{2}(t) \ p_{2}{'}(t) &= -p_{1}(t)u(t) \ p_1(t_f) &= 0 \ p_2(t_f) &= 0 \end{align*} The optimal control must satisfy the following transversality conditions: \begin{align*} p_1(0) &= 0 \ p_2(0) &= -1 \end{align*} The optimal control must satisfy the Hamiltonian equation: \begin{align*} H(x, u, p) = p_{1}u + p_{2} &= \max_{u \in [-1, 1]} H(x, u, p) \ \end{align*} Given the Hamiltonian equation, we can see that the optimal control for this problem is u^∗ = 1.
Next, we can use the optimal control to calculate the endtime variation. To do this, we can consider the problem with a small perturbation in the endtime, say $t_f + Δt_f$. The optimal control for this perturbed problem would also be $u^∗ = 1$, but the corresponding endtime would be $t_f + Δt_f$.
Now, we can use the adjoint state to calculate the sensitivity of the optimal cost with respect to the endtime, which can be expressed as: \begin{align*} \frac{d}{dt} \int_{0}^{t_f} 1 dt &= p_{1}(0)x_{1}'(0) + p_{2}(0)x_{2}'(0) \ &= p_{2}(0) \end{align*}
Therefore, the sensitivity of the optimal cost with respect to the endtime is equal to $p_2(0)$, which is equal to $-1$. This means that a small increase in the endtime would result in a decrease in the optimal cost by $1$.
So, the corresponding endtime variation for this problem would be $-1$.