Optimal control theory is a branch of control theory that deals with finding a control for a dynamical system over a period of time such that an objective function is optimized.[1] It has numerous applications in science, engineering and operations research. For example, the dynamical system might be a spacecraft with controls corresponding to rocket thrusters, and the objective might be to reach the Moon with minimum fuel expenditure.[2] Or the dynamical system could be a nation's economy, with the objective to minimize unemployment; the controls in this case could be fiscal and monetary policy.[3] A dynamical system may also be introduced to embed operations research problems within the framework of optimal control theory.[4][5]
Optimal control is an extension of the calculus of variations, and is a mathematical optimization method for deriving control policies.[6] The method is largely due to the work of Lev Pontryagin and Richard Bellman in the 1950s, after contributions to calculus of variations by Edward J. McShane.[7] Optimal control can be seen as a control strategy in control theory.[1]
Optimal control deals with the problem of finding a control law for a given system such that a certain optimality criterion is achieved. A control problem includes a cost functional that is a function of state and control variables. An optimal control is a set of differential equations describing the paths of the control variables that minimize the cost function. The optimal control can be derived using Pontryagin's maximum principle (a necessary condition also known as Pontryagin's minimum principle or simply Pontryagin's principle),[8] or by solving the Hamilton–Jacobi–Bellman equation (a sufficient condition).
We begin with a simple example. Consider a car traveling in a straight line on a hilly road. The question is, how should the driver press the accelerator pedal in order to minimize the total traveling time? In this example, the term control law refers specifically to the way in which the driver presses the accelerator and shifts the gears. The system consists of both the car and the road, and the optimality criterion is the minimization of the total traveling time. Control problems usually include ancillary constraints. For example, the amount of available fuel might be limited, the accelerator pedal cannot be pushed through the floor of the car, speed limits, etc.
A proper cost function will be a mathematical expression giving the traveling time as a function of the speed, geometrical considerations, and initial conditions of the system. Constraints are often interchangeable with the cost function.
Another related optimal control problem may be to find the way to drive the car so as to minimize its fuel consumption, given that it must complete a given course in a time not exceeding some amount. Yet another related control problem may be to minimize the total monetary cost of completing the trip, given assumed monetary prices for time and fuel.
A more abstract framework goes as follows.[1] Minimize the continuous-time cost functional [math]\displaystyle{ J[\textbf{x}(\cdot), \textbf{u}(\cdot), t_0, t_f] := E\,[\textbf{x}(t_0),t_0,\textbf{x}(t_f),t_f] + \int_{t_0}^{t_f} F\,[\textbf{x}(t),\textbf{u}(t),t] \,\mathrm dt }[/math] subject to the first-order dynamic constraints (the state equation) [math]\displaystyle{ \dot{\textbf{x}}(t) = \textbf{f}\,[\,\textbf{x}(t), \textbf{u}(t), t], }[/math] the algebraic path constraints [math]\displaystyle{ \textbf{h}\,[\textbf{x}(t),\textbf{u}(t),t] \leq \textbf{0}, }[/math] and the endpoint conditions [math]\displaystyle{ \textbf{e}[\textbf{x}(t_0),t_0,\textbf{x}(t_f),t_f] = 0 }[/math] where [math]\displaystyle{ \textbf{x}(t) }[/math] is the state, [math]\displaystyle{ \textbf{u}(t) }[/math] is the control, [math]\displaystyle{ t }[/math] is the independent variable (generally speaking, time), [math]\displaystyle{ t_0 }[/math] is the initial time, and [math]\displaystyle{ t_f }[/math] is the terminal time. The terms [math]\displaystyle{ E }[/math] and [math]\displaystyle{ F }[/math] are called the endpoint cost and the running cost respectively. In the calculus of variations, [math]\displaystyle{ E }[/math] and [math]\displaystyle{ F }[/math] are referred to as the Mayer term and the Lagrangian, respectively. Furthermore, it is noted that the path constraints are in general inequality constraints and thus may not be active (i.e., equal to zero) at the optimal solution. It is also noted that the optimal control problem as stated above may have multiple solutions (i.e., the solution may not be unique). Thus, it is most often the case that any solution [math]\displaystyle{ [\textbf{x}^*(t),\textbf{u}^*(t),t_0^*, t_f^*] }[/math] to the optimal control problem is locally minimizing.
A special case of the general nonlinear optimal control problem given in the previous section is the linear quadratic (LQ) optimal control problem. The LQ problem is stated as follows. Minimize the quadratic continuous-time cost functional [math]\displaystyle{ J=\tfrac{1}{2} \mathbf{x}^{\mathsf{T}}(t_f)\mathbf{S}_f\mathbf{x}(t_f) + \tfrac{1}{2} \int_{t_0}^{t_f} [\,\mathbf{x}^{\mathsf{T}}(t)\mathbf{Q}(t)\mathbf{x}(t) + \mathbf{u}^{\mathsf{T}}(t)\mathbf{R}(t) \mathbf{u}(t)]\, \mathrm dt }[/math]
Subject to the linear first-order dynamic constraints [math]\displaystyle{ \dot{\mathbf{x}}(t)= \mathbf{A}(t) \mathbf{x}(t) + \mathbf{B}(t) \mathbf{u}(t), }[/math] and the initial condition [math]\displaystyle{ \mathbf{x}(t_0) = \mathbf{x}_0 }[/math]
A particular form of the LQ problem that arises in many control system problems is that of the linear quadratic regulator (LQR) where all of the matrices (i.e., [math]\displaystyle{ \mathbf{A} }[/math], [math]\displaystyle{ \mathbf{B} }[/math], [math]\displaystyle{ \mathbf{Q} }[/math], and [math]\displaystyle{ \mathbf{R} }[/math]) are constant, the initial time is arbitrarily set to zero, and the terminal time is taken in the limit [math]\displaystyle{ t_f\rightarrow\infty }[/math] (this last assumption is what is known as infinite horizon). The LQR problem is stated as follows. Minimize the infinite horizon quadratic continuous-time cost functional [math]\displaystyle{ J= \tfrac{1}{2} \int_{0}^{\infty}[\mathbf{x}^{\mathsf{T}}(t)\mathbf{Q}\mathbf{x}(t) + \mathbf{u}^{\mathsf{T}}(t)\mathbf{R}\mathbf{u}(t)]\, \mathrm dt }[/math]
Subject to the linear time-invariant first-order dynamic constraints [math]\displaystyle{ \dot{\mathbf{x}}(t) = \mathbf{A} \mathbf{x}(t) + \mathbf{B} \mathbf{u}(t), }[/math] and the initial condition [math]\displaystyle{ \mathbf{x}(t_0) = \mathbf{x}_0 }[/math]
In the finite-horizon case the matrices are restricted in that [math]\displaystyle{ \mathbf{Q} }[/math] and [math]\displaystyle{ \mathbf{R} }[/math] are positive semi-definite and positive definite, respectively. In the infinite-horizon case, however, the matrices [math]\displaystyle{ \mathbf{Q} }[/math] and [math]\displaystyle{ \mathbf{R} }[/math] are not only positive-semidefinite and positive-definite, respectively, but are also constant. These additional restrictions on [math]\displaystyle{ \mathbf{Q} }[/math] and [math]\displaystyle{ \mathbf{R} }[/math] in the infinite-horizon case are enforced to ensure that the cost functional remains positive. Furthermore, in order to ensure that the cost function is bounded, the additional restriction is imposed that the pair [math]\displaystyle{ (\mathbf{A},\mathbf{B}) }[/math] is controllable. Note that the LQ or LQR cost functional can be thought of physically as attempting to minimize the control energy (measured as a quadratic form).
The infinite horizon problem (i.e., LQR) may seem overly restrictive and essentially useless because it assumes that the operator is driving the system to zero-state and hence driving the output of the system to zero. This is indeed correct. However the problem of driving the output to a desired nonzero level can be solved after the zero output one is. In fact, it can be proved that this secondary LQR problem can be solved in a very straightforward manner. It has been shown in classical optimal control theory that the LQ (or LQR) optimal control has the feedback form [math]\displaystyle{ \mathbf{u}(t) = -\mathbf{K}(t)\mathbf{x}(t) }[/math] where [math]\displaystyle{ \mathbf{K}(t) }[/math] is a properly dimensioned matrix, given as [math]\displaystyle{ \mathbf{K}(t) = \mathbf{R}^{-1}\mathbf{B}^{\mathsf{T}}\mathbf{S}(t), }[/math] and [math]\displaystyle{ \mathbf{S}(t) }[/math] is the solution of the differential Riccati equation. The differential Riccati equation is given as [math]\displaystyle{ \dot{\mathbf{S}}(t) = -\mathbf{S}(t)\mathbf{A}-\mathbf{A}^{\mathsf{T}} \mathbf{S}(t) +\mathbf{S}(t)\mathbf{B}\mathbf{R}^{-1}\mathbf{B}^{\mathsf{T}}\mathbf{S}(t) - \mathbf{Q} }[/math]
For the finite horizon LQ problem, the Riccati equation is integrated backward in time using the terminal boundary condition [math]\displaystyle{ \mathbf{S}(t_f) = \mathbf{S}_f }[/math]
For the infinite horizon LQR problem, the differential Riccati equation is replaced with the algebraic Riccati equation (ARE) given as [math]\displaystyle{ \mathbf{0} = -\mathbf{S}\mathbf{A}-\mathbf{A}^{\mathsf{T}}\mathbf{S}+\mathbf{S}\mathbf{B}\mathbf{R}^{-1}\mathbf{B}^{\mathsf{T}}\mathbf{S}-\mathbf{Q} }[/math]
Understanding that the ARE arises from infinite horizon problem, the matrices [math]\displaystyle{ \mathbf{A} }[/math], [math]\displaystyle{ \mathbf{B} }[/math], [math]\displaystyle{ \mathbf{Q} }[/math], and [math]\displaystyle{ \mathbf{R} }[/math] are all constant. It is noted that there are in general multiple solutions to the algebraic Riccati equation and the positive definite (or positive semi-definite) solution is the one that is used to compute the feedback gain. The LQ (LQR) problem was elegantly solved by Rudolf E. Kálmán.[9]
Optimal control problems are generally nonlinear and therefore, generally do not have analytic solutions (e.g., like the linear-quadratic optimal control problem). As a result, it is necessary to employ numerical methods to solve optimal control problems. In the early years of optimal control (c. 1950s to 1980s) the favored approach for solving optimal control problems was that of indirect methods. In an indirect method, the calculus of variations is employed to obtain the first-order optimality conditions. These conditions result in a two-point (or, in the case of a complex problem, a multi-point) boundary-value problem. This boundary-value problem actually has a special structure because it arises from taking the derivative of a Hamiltonian. Thus, the resulting dynamical system is a Hamiltonian system of the form[1] [math]\displaystyle{ \begin{align} \dot{\textbf{x}} & = \frac{\partial H}{\partial\boldsymbol{\lambda}} \\[1.2ex] \dot{\boldsymbol{\lambda}} & = -\frac{\partial H}{\partial\textbf{x}} \end{align} }[/math] where [math]\displaystyle{ H= F +\boldsymbol{\lambda}^{\mathsf{T}}\textbf{f}- \boldsymbol{\mu}^{\mathsf{T}}\textbf{h} }[/math] is the augmented Hamiltonian and in an indirect method, the boundary-value problem is solved (using the appropriate boundary or transversality conditions). The beauty of using an indirect method is that the state and adjoint (i.e., [math]\displaystyle{ \boldsymbol{\lambda} }[/math]) are solved for and the resulting solution is readily verified to be an extremal trajectory. The disadvantage of indirect methods is that the boundary-value problem is often extremely difficult to solve (particularly for problems that span large time intervals or problems with interior point constraints). A well-known software program that implements indirect methods is BNDSCO.[10]
The approach that has risen to prominence in numerical optimal control since the 1980s is that of so-called direct methods. In a direct method, the state or the control, or both, are approximated using an appropriate function approximation (e.g., polynomial approximation or piecewise constant parameterization). Simultaneously, the cost functional is approximated as a cost function. Then, the coefficients of the function approximations are treated as optimization variables and the problem is "transcribed" to a nonlinear optimization problem of the form:
Minimize [math]\displaystyle{ F(\mathbf{z}) }[/math] subject to the algebraic constraints [math]\displaystyle{ \begin{align} \mathbf{g}(\mathbf{z}) & = \mathbf{0} \\ \mathbf{h}(\mathbf{z}) & \leq \mathbf{0} \end{align} }[/math]
Depending upon the type of direct method employed, the size of the nonlinear optimization problem can be quite small (e.g., as in a direct shooting or quasilinearization method), moderate (e.g. pseudospectral optimal control[11]) or may be quite large (e.g., a direct collocation method[12]). In the latter case (i.e., a collocation method), the nonlinear optimization problem may be literally thousands to tens of thousands of variables and constraints. Given the size of many NLPs arising from a direct method, it may appear somewhat counter-intuitive that solving the nonlinear optimization problem is easier than solving the boundary-value problem. It is, however, the fact that the NLP is easier to solve than the boundary-value problem. The reason for the relative ease of computation, particularly of a direct collocation method, is that the NLP is sparse and many well-known software programs exist (e.g., SNOPT[13]) to solve large sparse NLPs. As a result, the range of problems that can be solved via direct methods (particularly direct collocation methods which are very popular these days) is significantly larger than the range of problems that can be solved via indirect methods. In fact, direct methods have become so popular these days that many people have written elaborate software programs that employ these methods. In particular, many such programs include DIRCOL,[14] SOCS,[15] OTIS,[16] GESOP/ASTOS,[17] DITAN.[18] and PyGMO/PyKEP.[19] In recent years, due to the advent of the MATLAB programming language, optimal control software in MATLAB has become more common. Examples of academically developed MATLAB software tools implementing direct methods include RIOTS,[20] DIDO,[21] DIRECT,[22] FALCON.m,[23] and GPOPS,[24] while an example of an industry developed MATLAB tool is PROPT.[25] These software tools have increased significantly the opportunity for people to explore complex optimal control problems both for academic research and industrial problems.[26] Finally, it is noted that general-purpose MATLAB optimization environments such as TOMLAB have made coding complex optimal control problems significantly easier than was previously possible in languages such as C and FORTRAN.
The examples thus far have shown continuous time systems and control solutions. In fact, as optimal control solutions are now often implemented digitally, contemporary control theory is now primarily concerned with discrete time systems and solutions. The Theory of Consistent Approximations[27][28] provides conditions under which solutions to a series of increasingly accurate discretized optimal control problem converge to the solution of the original, continuous-time problem. Not all discretization methods have this property, even seemingly obvious ones.[29] For instance, using a variable step-size routine to integrate the problem's dynamic equations may generate a gradient which does not converge to zero (or point in the right direction) as the solution is approached. The direct method RIOTS is based on the Theory of Consistent Approximation.
A common solution strategy in many optimal control problems is to solve for the costate (sometimes called the shadow price) [math]\displaystyle{ \lambda(t) }[/math]. The costate summarizes in one number the marginal value of expanding or contracting the state variable next turn. The marginal value is not only the gains accruing to it next turn but associated with the duration of the program. It is nice when [math]\displaystyle{ \lambda(t) }[/math] can be solved analytically, but usually, the most one can do is describe it sufficiently well that the intuition can grasp the character of the solution and an equation solver can solve numerically for the values.
Having obtained [math]\displaystyle{ \lambda(t) }[/math], the turn-t optimal value for the control can usually be solved as a differential equation conditional on knowledge of [math]\displaystyle{ \lambda(t) }[/math]. Again it is infrequent, especially in continuous-time problems, that one obtains the value of the control or the state explicitly. Usually, the strategy is to solve for thresholds and regions that characterize the optimal control and use a numerical solver to isolate the actual choice values in time.
Consider the problem of a mine owner who must decide at what rate to extract ore from their mine. They own rights to the ore from date [math]\displaystyle{ 0 }[/math] to date [math]\displaystyle{ T }[/math]. At date [math]\displaystyle{ 0 }[/math] there is [math]\displaystyle{ x_0 }[/math] ore in the ground, and the time-dependent amount of ore [math]\displaystyle{ x(t) }[/math] left in the ground declines at the rate of [math]\displaystyle{ u(t) }[/math] that the mine owner extracts it. The mine owner extracts ore at cost [math]\displaystyle{ u(t)^2/x(t) }[/math] (the cost of extraction increasing with the square of the extraction speed and the inverse of the amount of ore left) and sells ore at a constant price [math]\displaystyle{ p }[/math]. Any ore left in the ground at time [math]\displaystyle{ T }[/math] cannot be sold and has no value (there is no "scrap value"). The owner chooses the rate of extraction varying with time [math]\displaystyle{ u(t) }[/math] to maximize profits over the period of ownership with no time discounting.
The manager maximizes profit [math]\displaystyle{ \Pi }[/math]: [math]\displaystyle{ \Pi = \sum_{t=0}^{T-1} \left[ pu_t - \frac{u_t^2}{x_t} \right] }[/math] subject to the law of motion for the state variable [math]\displaystyle{ x_t }[/math] [math]\displaystyle{ x_{t+1} - x_t = - u_t }[/math]
Form the Hamiltonian and differentiate: [math]\displaystyle{ \begin{align} H &= pu_t - \frac{u_t^2}{x_t} - \lambda_{t+1} u_t \\ \frac{\partial H}{\partial u_t} &= p - \lambda_{t+1} - 2\frac{u_t}{x_t} = 0 \\ \lambda_{t+1} - \lambda_t &= -\frac{\partial H}{\partial x_t} = -\left( \frac{u_t}{x_t} \right)^2 \end{align} }[/math]
As the mine owner does not value the ore remaining at time [math]\displaystyle{ T }[/math], [math]\displaystyle{ \lambda_T = 0 }[/math]
Using the above equations, it is easy to solve for the [math]\displaystyle{ x_t }[/math] and [math]\displaystyle{ \lambda_t }[/math] series [math]\displaystyle{ \begin{align} \lambda_t &= \lambda_{t+1} + \frac{\left(p-\lambda_{t+1}\right)^2}{4} \\ x_{t+1} &= x_t \frac{2 - p + \lambda_{t+1}}{2} \end{align} }[/math]
and using the initial and turn-T conditions, the [math]\displaystyle{ x_t }[/math] series can be solved explicitly, giving [math]\displaystyle{ u_t }[/math].The manager maximizes profit [math]\displaystyle{ \Pi }[/math]: [math]\displaystyle{ \Pi = \int_0^T \left[ pu(t) - \frac{u(t)^2}{x(t)} \right] dt }[/math] where the state variable [math]\displaystyle{ x(t) }[/math] evolves as follows: [math]\displaystyle{ \dot x(t) = - u(t) }[/math]
Form the Hamiltonian and differentiate: [math]\displaystyle{ \begin{align} H &= pu(t) - \frac{u(t)^2}{x(t)} - \lambda(t) u(t) \\ \frac{\partial H}{\partial u} &= p - \lambda(t) - 2\frac{u(t)}{x(t)} = 0 \\ \dot\lambda(t) &= -\frac{\partial H}{\partial x} = -\left( \frac{u(t)}{x(t)} \right)^2 \end{align} }[/math]
As the mine owner does not value the ore remaining at time [math]\displaystyle{ T }[/math], [math]\displaystyle{ \lambda(T) = 0 }[/math]
Using the above equations, it is easy to solve for the differential equations governing [math]\displaystyle{ u(t) }[/math] and [math]\displaystyle{ \lambda(t) }[/math] [math]\displaystyle{ \begin{align} \dot\lambda(t) &= -\frac{(p-\lambda(t))^2}{4} \\ u(t) &= x(t) \frac{p- \lambda(t)}{2} \end{align} }[/math] and using the initial and turn-T conditions, the functions can be solved to yield
[math]\displaystyle{ x(t) = \frac{\left(4-pt+pT\right)^2}{\left(4+pT\right)^2} x_0 }[/math]
Original source: https://en.wikipedia.org/wiki/Optimal control.
Read more |