HOME

TheInfoList



OR:

The Hamiltonian is a function used to solve a problem of optimal control for a
dynamical system In mathematics, a dynamical system is a system in which a function describes the time dependence of a point in an ambient space. Examples include the mathematical models that describe the swinging of a clock pendulum, the flow of water i ...
. It can be understood as an instantaneous increment of the Lagrangian expression of the problem that is to be optimized over a certain time period. Inspired by, but distinct from, the Hamiltonian of classical mechanics, the Hamiltonian of optimal control theory was developed by Lev Pontryagin as part of his
maximum principle In the mathematical fields of partial differential equations and geometric analysis, the maximum principle is any of a collection of results and techniques of fundamental importance in the study of elliptic and parabolic differential equations. ...
. Pontryagin proved that a necessary condition for solving the optimal control problem is that the control should be chosen so as to optimize the Hamiltonian.


Problem statement and definition of the Hamiltonian

Consider a
dynamical system In mathematics, a dynamical system is a system in which a function describes the time dependence of a point in an ambient space. Examples include the mathematical models that describe the swinging of a clock pendulum, the flow of water i ...
of n first-order
differential equation In mathematics, a differential equation is an equation that relates one or more unknown functions and their derivatives. In applications, the functions generally represent physical quantities, the derivatives represent their rates of change, a ...
s :\dot(t) = \mathbf(\mathbf(t),\mathbf(t),t) where \mathbf(t) = \left x_(t), x_(t), \ldots, x_(t) \right denotes a vector of state variables, and \mathbf(t) = \left u_(t), u_(t), \ldots, u_(t) \right a vector of control variables. Once initial conditions \mathbf(t_) = \mathbf_ and controls \mathbf(t) are specified, a solution to the differential equations, called a ''trajectory'' \mathbf(t; \mathbf_, t_), can be found. The problem of optimal control is to choose \mathbf(t) (from some set \mathcal \subseteq \mathbb^) so that \mathbf(t) maximizes or minimizes a certain
objective function In mathematical optimization and decision theory, a loss function or cost function (sometimes also called an error function) is a function that maps an event or values of one or more variables onto a real number intuitively representing some "cos ...
between an initial time t = t_ and a terminal time t = t_ (where t_ may be
infinity Infinity is that which is boundless, endless, or larger than any natural number. It is often denoted by the infinity symbol . Since the time of the ancient Greeks, the philosophical nature of infinity was the subject of many discussions am ...
). Specifically, the goal is to optimize a performance index I(\mathbf(t),\mathbf(t),t) at each point in time, :\max_ J = \int_^ I(\mathbf(t),\mathbf(t),t) \, \mathrmt subject to the above equations of motion of the state variables. The solution method involves defining an ancillary function known as the control Hamiltonian which combines the objective function and the state equations much like a
Lagrangian Lagrangian may refer to: Mathematics * Lagrangian function, used to solve constrained minimization problems in optimization theory; see Lagrange multiplier ** Lagrangian relaxation, the method of approximating a difficult constrained problem with ...
in a static optimization problem, only that the multipliers \mathbf(t), referred to as ''costate variables'', are functions of time rather than constants. The goal is to find an optimal control policy function \mathbf^\ast(t) and, with it, an optimal trajectory of the state variable \mathbf^\ast(t), which by Pontryagin's maximum principle are the arguments that maximize the Hamiltonian, :H(\mathbf^\ast(t),\mathbf^\ast(t),\mathbf(t),t) \geq H(\mathbf(t),\mathbf(t),\mathbf(t),t) for all \mathbf(t) \in \mathcal The first-order necessary conditions for a maximum are given by :\frac = 0 which is the maximum principle, :\frac = \dot which generates the state transition function \mathbf(\mathbf(t),\mathbf(t),t) = \dot, :\frac = - \dot(t) which generates \dot(t) = - \left I_(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf_(\mathbf(t),\mathbf(t),t) \right/math> the latter of which are referred to as the costate equations. Together, the state and costate equations describe the Hamiltonian dynamical system (again analogous to but distinct from the
Hamiltonian system A Hamiltonian system is a dynamical system governed by Hamilton's equations. In physics, this dynamical system describes the evolution of a physical system such as a planetary system or an electron in an electromagnetic field. These systems can ...
in physics), the solution of which involves a two-point
boundary value problem In mathematics, in the field of differential equations, a boundary value problem is a differential equation together with a set of additional constraints, called the boundary conditions. A solution to a boundary value problem is a solution to ...
, given that there are 2n boundary conditions involving two different points in time, the initial time (the n differential equations for the state variables), and the terminal time (the n differential equations for the costate variables; unless a final function is specified, the boundary conditions are \mathbf(t_) = 0, or \lim_ \mathbf(t_) = 0 for infinite time horizons). A sufficient condition for a maximum is the concavity of the Hamiltonian evaluated at the solution, i.e. :H_(\mathbf^\ast(t),\mathbf^\ast(t),\mathbf(t),t) \leq 0 where \mathbf^\ast(t) is the optimal control, and \mathbf^\ast(t) is resulting optimal trajectory for the state variable. Alternatively, by a result due to
Olvi L. Mangasarian Olvi Leon Mangasarian (12 January 1934 – 15 March 2020) was the ''John von Neumann Professor Emeritus'' of Mathematics and Computer Sciences in Department of Mathematics, University of California, San Diego and Professor Emeritus of Computer Sc ...
, the necessary conditions are sufficient if the functions I(\mathbf(t),\mathbf(t),t) and \mathbf(\mathbf(t),\mathbf(t),t) are both concave in \mathbf(t) and \mathbf(t).


Derivation from the Lagrangian

A
constrained optimization In mathematical optimization, constrained optimization (in some contexts called constraint optimization) is the process of optimizing an objective function with respect to some variables in the presence of constraints on those variables. The obj ...
problem as the one stated above usually suggests a Lagrangian expression, specifically :L = \int_^ I(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \left \mathbf(\mathbf(t),\mathbf(t),t) - \dot(t) \right\, \mathrmt where the \mathbf(t) compare to the
Lagrange multiplier In mathematical optimization, the method of Lagrange multipliers is a strategy for finding the local maxima and minima of a function subject to equality constraints (i.e., subject to the condition that one or more equations have to be satisfied ...
in a static optimization problem but are now, as noted above, a function of time. In order to eliminate \dot(t), the last term on the right-hand side can be rewritten using
integration by parts In calculus, and more generally in mathematical analysis, integration by parts or partial integration is a process that finds the integral of a product of functions in terms of the integral of the product of their derivative and antiderivative. ...
, such that :- \int_^ \mathbf^(t) \dot(t) \, \mathrmt = -\mathbf^(t_) \mathbf(t_) + \mathbf^(t_) \mathbf(t_) + \int_^ \dot^(t) \mathbf(t) \, \mathrmt which can be substituted back into the Lagrangian expression to give :L = \int_^ \left I(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf(\mathbf(t),\mathbf(t),t) + \dot^(t) \mathbf(t) \right\, \mathrmt - \mathbf^(t_) \mathbf(t_) + \mathbf^(t_) \mathbf(t_) To derive the first-order conditions for an optimum, assume that the solution has been found and the Lagrangian is maximized. Then any perturbation to \mathbf(t) or \mathbf(t) must cause the value of the Lagrangian to decline. Specifically, the
total derivative In mathematics, the total derivative of a function at a point is the best linear approximation near this point of the function with respect to its arguments. Unlike partial derivatives, the total derivative approximates the function with r ...
of L obeys :\mathrmL = \int_^ \left[ \left( I_(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf_(\mathbf(t),\mathbf(t),t) \right) \mathrm\mathbf(t) + \left( I_(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf_(\mathbf(t),\mathbf(t),t) + \dot(t) \right) \mathrm\mathbf(t) \right] \mathrmt - \mathbf^(t_) \mathrm\mathbf(t_) + \mathbf^(t_) \mathrm\mathbf(t_) \leq 0 For this expression to equal zero necessitates the following optimality conditions: :\begin I_(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf_(\mathbf(t),\mathbf(t),t) &= 0 \\ I_(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf_(\mathbf(t),\mathbf(t),t) + \dot(t) &= 0 \end If both the initial value \mathbf(t_) and terminal value \mathbf(t_) are fixed, i.e. \mathrm\mathbf(t_) = \mathrm\mathbf(t_) = 0, no conditions on \mathbf(t_) and \mathbf(t_) are needed. If the terminal value is free, as is often the case, the additional condition \mathbf(t_) = 0 is necessary for optimality. The latter is called a transversality condition for a fixed horizon problem. It can be seen that the necessary conditions are identical to the ones stated above for the Hamiltonian. Thus the Hamiltonian can be understood as a device to generate the first-order necessary conditions.


The Hamiltonian in discrete time

When the problem is formulated in discrete time, the Hamiltonian is defined as: : H(x_,u_,\lambda_,t)=\lambda^\top_f(x_,u_,t)+I(x_,u_,t) \, and the costate equations are : \lambda_^\top=-\frac + \lambda_^\top (Note that the discrete time Hamiltonian at time t involves the costate variable at time t+1. This small detail is essential so that when we differentiate with respect to x we get a term involving \lambda(t+1) on the right hand side of the costate equations. Using a wrong convention here can lead to incorrect results, i.e. a costate equation which is not a backwards difference equation).


Behavior of the Hamiltonian over time

From Pontryagin's maximum principle, special conditions for the Hamiltonian can be derived. When the final time t_1 is fixed and the Hamiltonian does not depend explicitly on time \left(\tfrac = 0\right), then: :H(x^*(t),u^*(t),\lambda^*(t)) = \mathrm\, or if the terminal time is free, then: :H(x^*(t),u^*(t),\lambda^*(t)) = 0.\, Further, if the terminal time tends to
infinity Infinity is that which is boundless, endless, or larger than any natural number. It is often denoted by the infinity symbol . Since the time of the ancient Greeks, the philosophical nature of infinity was the subject of many discussions am ...
, a
transversality condition In optimal control theory, a transversality condition is a Boundary value problem, boundary condition for the terminal values of the costate equation, costate variables. They are one of the necessary conditions for optimality infinite-horizon optima ...
on the Hamiltonian applies. :\lim_ H(t) = 0


The Hamiltonian of control compared to the Hamiltonian of mechanics

William Rowan Hamilton Sir William Rowan Hamilton LL.D, DCL, MRIA, FRAS (3/4 August 1805 – 2 September 1865) was an Irish mathematician, astronomer, and physicist. He was the Andrews Professor of Astronomy at Trinity College Dublin, and Royal Astronomer of Ire ...
defined the Hamiltonian for describing the mechanics of a system. It is a function of three variables: :\mathcal = \mathcal(p,q,t) = \langle p,\dot \rangle -L(q,\dot,t) where L is the
Lagrangian Lagrangian may refer to: Mathematics * Lagrangian function, used to solve constrained minimization problems in optimization theory; see Lagrange multiplier ** Lagrangian relaxation, the method of approximating a difficult constrained problem with ...
, the extremizing of which determines the dynamics (''not'' the Lagrangian defined above), q is the state variable and \dot is its time derivative. p is the so-called " conjugate momentum", defined by :p = \frac Hamilton then formulated his equations to describe the dynamics of the system as :\fracp(t) = -\frac\mathcal :\fracq(t) =~~\frac\mathcal The Hamiltonian of control theory describes not the ''dynamics'' of a system but conditions for extremizing some scalar function thereof (the Lagrangian) with respect to a control variable u. As normally defined, it is a function of 4 variables :H(q,u,p,t)= \langle p,\dot \rangle -L(q,u,t) where q is the state variable and u is the control variable with respect to that which we are extremizing. The associated conditions for a maximum are :\frac = -\frac :\frac = ~~\frac :\frac = 0 This definition agrees with that given by the article by Sussmann and Willems. (see p. 39, equation 14). Sussmann and Willems show how the control Hamiltonian can be used in dynamics e.g. for the brachistochrone problem, but do not mention the prior work of Carathéodory on this approach.


Current value and present value Hamiltonian

In
economics Economics () is the social science that studies the production, distribution, and consumption of goods and services. Economics focuses on the behaviour and interactions of economic agents and how economies work. Microeconomics analy ...
, the objective function in dynamic optimization problems often depends directly on time only through exponential discounting, such that it takes the form :I(\mathbf(t),\mathbf(t),t) = e^ \nu(\mathbf(t),\mathbf(t)) where \nu(\mathbf(t),\mathbf(t)) is referred to as the instantaneous
utility function As a topic of economics, utility is used to model worth or value. Its usage has evolved significantly over time. The term was introduced initially as a measure of pleasure or happiness as part of the theory of utilitarianism by moral philosoph ...
, or felicity function. This allows a redefinition of the Hamiltonian as H(\mathbf(t),\mathbf(t),\mathbf(t),t) = e^ \bar(\mathbf(t),\mathbf(t),\mathbf(t)) where :\begin \bar(\mathbf(t),\mathbf(t),\mathbf(t)) \equiv& \, e^ \left I(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf(\mathbf(t),\mathbf(t),t) \right\\ =& \, \nu(\mathbf(t),\mathbf(t),t) + \mathbf^(t) \mathbf(\mathbf(t),\mathbf(t),t) \end which is referred to as the current value Hamiltonian, in contrast to the present value Hamiltonian H(\mathbf(t),\mathbf(t),\mathbf(t),t) defined in the first section. Most notably the costate variables are redefined as \mathbf(t) = e^ \mathbf(t), which leads to modified first-order conditions. :\frac = 0, :\frac = - \dot(t) + \rho \mathbf(t) which follows immediately from the
product rule In calculus, the product rule (or Leibniz rule or Leibniz product rule) is a formula used to find the derivatives of products of two or more functions. For two functions, it may be stated in Lagrange's notation as (u \cdot v)' = u ' \cdot v + ...
. Economically, \mathbf(t) represent current-valued
shadow price A shadow price is the monetary value assigned to an abstract or intangible commodity which is not traded in the marketplace. This often takes the form of an externality. Shadow prices are also known as the recalculation of known market prices in o ...
s for the capital goods \mathbf(t).


Example: Ramsey–Cass–Koopmans model

In
economics Economics () is the social science that studies the production, distribution, and consumption of goods and services. Economics focuses on the behaviour and interactions of economic agents and how economies work. Microeconomics analy ...
, the Ramsey–Cass–Koopmans model is used to determine an optimal savings behavior for an economy. The objective function J(c) is the
social welfare function In welfare economics, a social welfare function is a function that ranks social states (alternative complete descriptions of the society) as less desirable, more desirable, or indifferent for every possible pair of social states. Inputs of the ...
, :J(c) = \int^T_0 e^u(c(t)) dt to be maximized by choice of an optimal consumption path c(t). The function u(c(t)) indicates the
utility As a topic of economics, utility is used to model worth or value. Its usage has evolved significantly over time. The term was introduced initially as a measure of pleasure or happiness as part of the theory of utilitarianism by moral philosoph ...
the representative agent of consuming c at any given point in time. The factor e^ represents
discounting Discounting is a financial mechanism in which a debtor obtains the right to delay payments to a creditor, for a defined period of time, in exchange for a charge or fee.See "Time Value", "Discount", "Discount Yield", "Compound Interest", "Efficie ...
. The maximization problem is subject to the following differential equation for
capital intensity Capital intensity is the amount of fixed or real capital present in relation to other factors of production, especially labor. At the level of either a production process or the aggregate economy, it may be estimated by the capital to labor ratio ...
, describing the time evolution of capital per effective worker: :\dot=\frac =f(k(t)) - (n + \delta)k(t) - c(t) where c(t) is period t consumption, k(t) is period t capital per worker (with k(0) = k_ > 0), f(k(t)) is period t production, n is the population growth rate, \delta is the capital depreciation rate, the agent discounts future utility at rate \rho, with u'>0 and u''<0. Here, k(t) is the state variable which evolves according to the above equation, and c(t) is the control variable. The Hamiltonian becomes :H(k,c,\mu,t)=e^u(c(t))+\mu(t)\dot=e^u(c(t))+\mu(t) (k(t)) - (n + \delta)k(t) - c(t)/math> The optimality conditions are :\frac=0 \Rightarrow e^u'(c)=\mu(t) :\frac=-\frac=-\dot \Rightarrow \mu(t) '(k)-(n+\delta)-\dot in addition to the transversality condition \mu(T)k(T)=0. If we let u(c)=\log(c), then log-differentiating the first optimality condition with respect to t yields :-\rho-\frac=\frac Inserting this equation into the second optimality condition yields :\rho+\frac=f'(k)-(n+\delta) which is known as the Keynes–Ramsey rule, which gives a condition for consumption in every period which, if followed, ensures maximum lifetime utility.


References


Further reading

* * * {{DEFAULTSORT:Hamiltonian (Control Theory) Optimal control