How do I discretize an optimal control problem with Bolza-type objective function? I'm doing research on an optimal control problem whose cost (objective) function is of the Bolza type.
$$\min J (x,u) = \mu ( x (T) ) + \frac12 \int_{t_0}^T F (t, x(t), u(t) ) \, {\rm d} t \tag{Bolza-type}$$
Where I have issues now is on how to discretize the function using a numerical scheme in order to reduce the function to systems of equations. My major challenge is the Mayer term that is added to the integral. Please, if you have done something like this before or you have experience on what I can do to scale through this stage, I will be willing to learn from you. Thank you very much.
I'm a research student, from my research, I realize there are few published works on Optimal Control Problem (OCP) having Bolza-type objective function. Hence, my motivation to work in this area of OCP. I've checked a lot of published works on OCPs which are my references but won't be able to list them here. But in all, what I need is a suggestion or a recommended journal or article where I can get clues to discretize my work successfully.
 A: What you need to do is know the system dynamics and impose them as a constraint to the problem, i.e.,
\begin{align}
  \min_{u} \ &J(u) = \mu(x(T)) + \int_{t_0}^TF(x,u)\text{d}t\\
  \notag\text{s.t.}&.\\
      &\dot x= f(x,u),\quad t>t_0, \quad x(t_0)=x_0
 \end{align}
Then you need to discretize the entire problem. There are several different ways to do this. Perhaps one of the most easy-to-understand (since you don't need a separate quadrature rule to integrate the running costs $F()$) is to re-formulate the problem and augment the system state $x$ by the running costs, i.e.
\begin{align}
  \min_{u} \ &J(u) = \mu(x(T)) + y(T)\\
  \notag\text{s.t.}&.\\
      &\dot x= f(x,u),\quad t>t_0, \quad x(t_0)=x_0\\
      &\dot y= F(x,u),\quad t>t_0, \quad y(t_0)=0
 \end{align}
with the new state $y$.
Note that its initial value is zero! And its right-hand-side is the integrand from the original problem.
Now we basically transformed the Bolza problem into the Mayer form by introducing the additonal state $y$.
To make this more clear, set $z = [x,\, y]^\top$ and $g(z,u)=[f(x,u)^\top,\,F(x,u)^\top]^\top$ and $\varphi(z(T))=\mu(x(T))+y(T)$ such that
\begin{align}
  \min_{u} \ &J(u) = \varphi(z(T))\\
  \notag\text{s.t.}&.\\
       &\dot z= g(z,u),\quad t>t_0, \quad z(t_0)=z_0
 \end{align}
with $z_0=[x_0,\,0]^\top$.
Now choose a discretization scheme for the differential equation, for example a forward Euler, to obtain a static (possibly) nonlinear program
\begin{align}
  \min_{w} \ &c(w) = \varphi(z_N)\\
  \notag\text{s.t.}&\\
       &z_0=[x_0,0]^\top\\
       &z_{k+1}= z_k+\frac{T}{N}g(z_k,u_k),\quad k = 0,\,...,\,N-1
 \end{align}
that you can pass to any NLP solver. Note that you have decision variables $w=[z_0,\,...\,z_N,\,u_0,\,...,\,u_N]$ or, in other words $w=[x_0,\,y_0,\,...,\,x_N,\,y_N,\,u_0,\,...,\,u_N]$.
This is essentially a direct simultaneous method, also called a full discretization.
Further note that the last equation is actually multiple constraints, one for each $k$! Your cost function, then, only needs the (augmented) state vector $z_N$, i.e., the state evaluated at the final time. One additional remark: Augmenting the state vector like this might not be the best idea, since the numerical solution of the integral in the original problem now depends on the discretization scheme of the differential equation and, therefore, might not be good enough. This is, I guess, one of the reasons why dedicated algorithms exist to perform this so-called quadrature separate from the solution of the differential equation.
