# Value function

The value function of an optimization problem gives the value attained by the objective function at a solution, while only depending on the parameters of the problem. In a controlled dynamical system, the value function represents the optimal payoff of the system over the interval [t, t$_1$] when started at the time-t state variable x(t)=x. If the objective function represents some cost that is to be minimized, the value function can be interpreted as the cost to finish the optimal program, and is thus referred to as "cost-to-go function." In an economic context, where the objective function usually represents utility, the value function is conceptually equivalent to the indirect utility function.
In a problem of optimal control, the value function is defined as the supremum of the objective function taken over the set of admissible controls. Given $(t_{0},x_{0})\in [0,t_{1}]\times \mathbb {R} ^{d}$, a typical optimal control problem is to
    ${\text{maximize}}\quad J(t_{0},x_{0};u)=\int _{t_{0}}^{t_{1}}I(t,x(t),u(t))\,\mathrm {d} t+\phi (x(t_{1}))$
subject to
    ${\frac {\mathrm {d} x(t)}{\mathrm {d} t}}=f(t,x(t),u(t))$
with initial state variable $x(t_{0})=x_{0}$. The objective function $J(t_{0},x_{0};u)$ is to be maximized over all admissible controls $u\in U[t_{0},t_{1}]$, where $u$ is a Lebesgue measurable function from $[t_{0},t_{1}]$ to some prescribed arbitrary set in $\mathbb {R} ^{m}$. The value function is then defined as
$V(t,x(t))=\max _{u\in U}\int _{t}^{t_{1}}I(\tau ,x(\tau ),u(\tau ))\,\mathrm {d} \tau +\phi (x(t_{1}))$
with $V(t_{1},x(t_{1}))=\phi (x(t_{1}))$, where $\phi (x(t_{1}))$ is the "scrap value". If the optimal pair of control and state trajectories is $(x^{\ast },u^{\ast })$, then $V(t_{0},x_{0})=J(t_{0},x_{0};u^{\ast })$. The function $h$ that gives the optimal control $u^{\ast }$ based on the current state $x$ is called a feedback control policy, or simply a policy function.
Bellman's principle of optimality roughly states that any optimal policy at time $t$, $t_{0}\leq t\leq t_{1}$ taking the current state $x(t)$ as "new" initial condition must be optimal for the remaining problem. If the value function happens to be continuously differentiable, this gives rise to an important partial differential equation known as Hamilton–Jacobi–Bellman equation,
    $-{\frac {\partial V(t,x)}{\partial t}}=\max _{u}\left\{I(t,x,u)+{\frac {\partial V(t,x)}{\partial x}}f(t,x,u)\right\}$
where the maximand on the right-hand side can also be re-written as the Hamiltonian, $H\left(t,x,u,\lambda \right)=I(t,x,u)+\lambda (t)f(t,x,u)$, as
    $-{\frac {\partial V(t,x)}{\partial t}}=\max _{u}H(t,x,u,\lambda )$
with $\partial V(t,x)/\partial x=\lambda (t)$ playing the role of the costate variables. Given this definition, we further have $\mathrm {d} \lambda (t)/\mathrm {d} t=\partial ^{2}V(t,x)/\partial x\partial t+\partial ^{2}V(t,x)/\partial x^{2}\cdot f(x)$, and after differentiating both sides of the HJB equation with respect to $x$,
    $-{\frac {\partial ^{2}V(t,x)}{\partial t\partial x}}={\frac {\partial I}{\partial x}}+{\frac {\partial ^{2}V(t,x)}{\partial x^{2}}}f(x)+{\frac {\partial V(t,x)}{\partial x}}{\frac {\partial f(x)}{\partial x}}$
which after replacing the appropriate terms recovers the costate equation
    $-{\dot {\lambda }}(t)=\underbrace {{\frac {\partial I}{\partial x}}+\lambda (t){\frac {\partial f(x)}{\partial x}}} _{={\frac {\partial H}{\partial x}}}$
where ${\dot {\lambda }}(t)$ is Newton notation for the derivative with respect to time.
The value function is the unique viscosity solution to the Hamilton–Jacobi–Bellman equation. In an online closed-loop approximate optimal control, the value function is also a Lyapunov function that establishes global asymptotic stability of the closed-loop system.