bib_files/MAP_refs1.bib \addbibresourcebib_files/MohammadRafi.bib \addbibresourcebib_files/naveed_references.bib \AtEveryBibitem\clearfieldissn \clearfielddoi \clearfieldurl \clearfieldeditor \DeclareFieldFormat*year \renewbibmacroin:
On the Feedback Law in Stochastic Optimal Nonlinear Control
Abstract
We consider the problem of nonlinear stochastic optimal control. This problem is thought to be fundamentally intractable owing to Bellman’s “curse of dimensionality”. We present a result that shows that repeatedly solving an open-loop deterministic problem from the current state with progressively shorter horizons, similar to Model Predictive Control (MPC), results in a feedback policy that is near to the true global stochastic optimal policy, where is a perturbation parameter modulating the noise. We show that the optimal deterministic feedback problem has a perturbation structure in that higher-order terms of the feedback law do not affect lower-order terms, and that this structure is lost in the optimal stochastic feedback problem. Consequently, solving the Stochastic Dynamic Programming problem is highly susceptible to noise, even when tractable, and in practice, the MPC-type feedback law offers superior performance even for stochastic systems.
Index Terms:
Stochastic Optimal Control, Nonlinear Systems, Model Predictive Control.I INTRODUCTION
In this paper, we consider the problem of finite-time nonlinear stochastic optimal control, specifically the stochastic dynamical system:
where is a Wiener process, is perturbation parameter modulating the noise, and the cost to be optimized is , where the incremental cost has the form , is the terminal cost, is a control policy and the cost is minimized over all possible such policies. We present a result that establishes that repeatedly solving a deterministic optimal control, or open-loop problem, from the current state, shown to be equivalent to applying the deterministic feedback policy to the system, results in a feedback policy that is near-optimal to the optimal stochastic feedback policy, in terms of the small noise parameter . Our analysis shows that under the relatively mild conditions of affine in control dynamics and quadratic in control cost, the open-loop solution obtained by satisfying the Minimum Principle [bryson] is globally optimum. Further, the deterministic feedback law has a perturbation structure in the sense that the higher-order feedback terms do not affect the lower-order terms, and that this structure is lost for the optimal stochastic problem. We obtain the equations that need to be satisfied by the linear and higher-order feedback terms in the optimal feedback law. Although near-optimal, empirical evidence shows that this replanning based Model Predictive Control (MPC)-type policy is the best we can do in practice, in the sense that albeit the optimal stochastic law should, in theory, have better performance, solving the stochastic problem is highly susceptible to noise owing to its lack of the perturbation structure, and in practice, the MPC-type law gives better performance. Thus, this result resolves the trade-off between tractability and optimality in stochastic feedback control problems, showing that, in practice, “what is tractable is also optimal”. In this paper, we consider the case where an analytical model is available for the control synthesis, we consider the case of data-based control in a companion paper [wang2022search]. A final note here is that the system considered in this work is not the most general, and our goal is not to analyze the most general case, rather, we show that even in the simplest case considered here, the stochastic problem is fundamentally intractable, and the best we can do in practice is use the deterministic feedback law, which is implemented by re-planning the open-loop as necessary.
A large majority of sequential decision making problems under uncertainty can be posed as a nonlinear stochastic optimal control problem that requires the solution of an associated Dynamic Programming (DP) problem, however, as the state dimension increases, the computational complexity grows exponentially in the state dimension [bertsekas1]: the manifestation of the so-called Bellman’s “curse of dimensionality (CoD)” [bellman]. Approximate DP (ADP), or alternatively, in Reinforcement Learning (RL), simulations of the process under a policy, is used to get an approximation of the cost-to-go function by sampling the domain [parr3, bertsekas1]. But, as the dimension increases, the number of samples required for evaluation goes up exponentially. There has been recent success using the Deep RL paradigm where deep neural networks are used as nonlinear function approximators to keep the parametrization tractable [RLHD1, haarnoja2018soft, fujimoto2018addressing, RLHD4, RLHD5], however, the training times required for these approaches, and the variance of the solutions, is still prohibitive. Hence, the primary problem with ADP/ RL techniques is the CoD inherent in the complex representation of the cost-to-go function, and the exponentially large number of evaluations required for its estimation resulting in high solution variance which makes them unreliable and inaccurate.
In the case of continuous state, control, and observation space problems, the Model Predictive Control [Mayne_1, Mayne_2] approach has been used with a lot of success in the control system and robotics community. For deterministic systems, the process results in solving the original DP problem in a recursive online fashion. However, stochastic control problems, and the control of uncertain systems in general, is still an unresolved problem in MPC. As succinctly noted in [Mayne_1], the problem arises due to the fact that in stochastic control problems, the MPC optimization at every time step cannot be over deterministic control sequences, but rather has to be over feedback policies, which is, in general, difficult to accomplish since a tractable parameterization of such policies to perform the optimization over, is, in general, unavailable. Thus, the tube-based MPC approach, and its stochastic counterparts, typically consider linear systems [T-MPC1, T-MPC2, T-MPC3] for which a linear parametrization of the feedback policy suffices but the methods become intractable when dealing with nonlinear systems [Mayne_3]. In more recent work, event-triggered MPC [ETMPC1, ETMPC2] keeps the online planning computationally efficient by triggering replanning in an event driven fashion rather than at every time step. We note that event-triggered MPC inherits the same issues mentioned above with respect to the stochastic control problem, and consequently, the techniques are intractable for nonlinear systems. There has been recent work showing the near-optimality of MPC with a perturbation analysis [bounded_regret_mpc, bounded_regret_ltv, superconvergence_mpc], but this work considers a deterministic problem setting with unknown model parameters in the system dynamics, and the regret bound provided is with respect to the controller that has perfect knowledge of the model, in contrast, we show the near-optimality of the deterministic feedback to the optimal stochastic law.
The fundamental problem is that, albeit solving the open-loop problem via the Minimum Principle (MP) is much easier, solving for the optimal feedback control under uncertainty requires the solution of the DP equation, which is intractable. Moreover, this also begs the question, since all systems are subject to uncertainty, what is the utility of deterministic optimal control?
Contributions: In this work, we establish that the basic MPC-type approach of solving the deterministic open-loop problem (with progressively shorter horizons) at every time step results in a near-optimal policy, to , for a nonlinear stochastic system. The result uses a perturbation expansion of the cost-to-go function in terms of a perturbation parameter . We show the global optimality of the open-loop solution obtained by satisfying the Minimum Principle [bryson] using the classical Method of Characteristics [Courant-Hilbert] thereby establishing that the MPC feedback law is indeed the optimal deterministic feedback law. Further, we show that the deterministic feedback law has a perturbation structure that is lost in the stochastic problem. We obtain the true linear and higher order feedback gain equations of the optimal deterministic policy as a by-product, which is very different from the Riccati equation governing a typical LQR perturbation feedback design [bryson].
Finally, albeit the MPC law is only “near-optimum”, our empirical evidence shows that this deterministic law has better performance than the stochastic law, obtained by solving the stochastic DP problem computationally, showing the susceptibility of the stochastic DP problem to noise owing to the loss of the perturbation structure, quite apart from the usual curse of dimensionality. Thus, in practice, the MPC law is the best one can do.
In contrast to [parunandi2019TPFC], we show fourth order near-optimality to the optimal stochastic solution, the global optimality of the open-loop solution and the perturbation structure of the deterministic feedback law, without which MPC is heuristic, and analytical as well as empirical evidence regarding the superiority of MPC to stochastic DP even when the DP problem is not subject to the curse of dimensionality. The current manuscript expands on our previously published conference paper [mohamed2022acc]. In particular, we provide detailed proofs of all our developments, explain the loss of perturbation structure in the stochastic problem, and provide a comprehensive empirical evaluation of the theory proposed in this manuscript.
The rest of the document is organized as follows: Section II states the problem, Section III presents three fundamental results that represent the three legs of the stool that supports the fact that the MPC feedback law is near-optimal, which is established in Section IV. We illustrate our results numerically in Section V using a simple 1-dimensional example for which the stochastic DP problem can be solved, and more practical examples from nonlinear robotic planning.
II PRELIMINARIES
The following outlines the finite time stochastic optimal control problem formulation, and the associated deterministic problem, along with the associated Dynamic Programming (DP) problems that we shall study in this work.
System Model
For a dynamical system, we denote the state and control vectors by and respectively. The dynamics of the system is governed by the stochastic differential equation (SDE):
(1) |
where is a Wiener process with covariance , and is a small parameter modulating the noise amplitude to the system and affects the signal-to-noise ratio.
1-Dimensional/ Scalar case: For the sake of simplicity in presenting the results, we will consider the scalar or 1-dimensional version of the problem, i.e., . The final results for the vector case will also be provided. The dynamics of the system for the scalar case is denoted by the following SDE:
(2) |
where and are the 1-dimensional equivalent of and , respectively.
Stochastic optimal control problem
The stochastic optimal control problem for an initial state is defined as:
(3) |
subject to the SDE (1), where the optimization is over a family of time-varying feedback policies }; is the cost function on applying the optimal policy ; is the incremental cost function; and is the terminal cost function; where is the “finite time horizon” of the problem.
Assumptions
We shall make the following assumptions in the rest of the paper, and unless otherwise stated, all results assume the following.
Assumption 1
(A1) Cost Structure. We assume that the incremental cost is quadratic in the control variable, i.e., , with positive definite. The matrix will be replaced by for the scalar case.
Assumption 2
(A2) Smoothness. We shall also assume that all the involved functions: ( for the scalar case), are five times continuously differentiable () in their arguments.
II-A Stochastic Dynamic Programming
The continuous time DP or the stochastic Hamilton-Jacobi-Bellman (HJB) equation for the system in Eq. (1) is given by [OPT_todorov]
(4) |
where, , is the terminal condition, is the Hamiltonian of the system, and is the intensity of the vector Wiener process.
Let denote the corresponding optimal policy.
Then, it is sufficient that the optimal control satisfies the first-order necessary condition (since the Hamiltonian is strictly quadratic in ):
(5) |
II-B The Deterministic Problem
Let us now consider the deterministic problem, i.e., Eq. (1) with and the same cost as in (3), except there is no expectation due to the lack of stochasticity. Utilizing essentially identical arguments as for the stochastic case, the optimal cost-to-go of the deterministic system, , satisfies the deterministic HJB equation:
(6) |
where the terminal condition , and the Hamiltonian is the exact same as that in the stochastic problem and the only difference is the missing diffusion term . Finally, identical to the stochastic case, the optimal control in the deterministic case is given by:
(7) |
III A PERTURBATION ANALYSIS OF OPTIMAL FEEDBACK CONTROL
In the following four subsections, we establish four basic results that we shall use to establish the near optimality of the MPC law in Section IV. In Section III-A, we characterize the performance of any given feedback policy as a perturbation (series) expansion in the parameter . We establish that the term depends only on the nominal action, while the depends only on the linear part of the feedback law. In Section III-B, we find the differential equations satisfied by these different perturbation costs using the HJB equation and show that the stochastic and deterministic optimal feedback laws share the same nominal and first order costs. In Section III-C, we analyze the nominal/ open-loop problem using the Method of Characteristics and show that the open-loop optimal control has a unique global minimum. Also, we show that the deterministic optimal feedback control problem has a perturbation structure in that the higher order terms do not affect the lower order terms in a Taylor expansion of the optimal feedback law, and obtain the equations governing the optimal linear feedback term in the nonlinear problem, which is shown to be different from a traditional LQR design [bryson]. In Section III-D, we show that this perturbation structure is lost for the stochastic problem leading to a fundamental computational intractability, quite apart from the usual curse of dimensionality.
III-A Characterizing the Performance of a Feedback Policy
In order to derive the results in this section, we first discretize the SDE in Eq. (1) via a Forward Euler approximation [kloedon_numerical_sde, Ch.9] with discretization time :
(8) |
where is a perturbation parameter, is a white noise sequence with covariance , , where , and as . At the end of this Section, we will obtain the continuous time result by letting . For notational convenience, we shall not explicitly write the term in the following.
Let us also consider a noiseless version of the system dynamics given by (8), obtained by setting for all : , where we denote the “nominal” state trajectory as and the “nominal” control as , with , where is a discretization of a given continuous-time control policy . In the following, to simplify notation, we shall drop the explicit reference to the discretization time while denoting the discretized policy as .
Assuming that and are sufficiently smooth (assumption A2), we can expand the dynamics about the nominal trajectory using a Taylor series. Denoting , we can express,
(9) | ||||
(10) |
where ,
, , and are second and higher order terms in the respective expansions.
Using (9) and (10), we can write the closed-loop dynamics of the trajectory as,
(11) |
where represents the linear part of the closed-loop system and the term represents the second and higher order terms in the closed-loop system.
Similarly, we can expand the instantaneous cost about the nominal values as,
(12) | ||||
(13) |
where , , and and are second and higher order terms in the respective expansions. The closed-loop incremental cost given in (12) can be expressed as
where are the second and higher order terms. Therefore, the cumulative cost of any given closed-loop trajectory can be expressed as, , which can be written in the following form:
(14) |
where .
We first show the following critical result. Note: The proofs for the results shown here are given in the appendix.
Lemma 1
Given any sample path, the state perturbation equation given in (III-A) can be equivalently characterized as
(15) |
where is an function that depends on the entire noise history and evolves according to the linear closed-loop system. Furthermore, , where , , and represents the Hessian matrix corresponding to the Taylor series expansion of the function .
Next, we have the following result for the expansion of the cost-to-go function .
Lemma 2
Given any sample path, the cost-to-go under a policy can be expanded about the nominal as:
where denotes the second order coefficient of the Taylor expansion of .
Finally, we have the following result characterizing the cost of the policy as the discretization time .
Proposition 1
Under A2, and given that the closed loop system under the policy has a solution over the interval , the mean of the cost-to-go function obeys: , for some constants , , where is , i.e., . Furthermore, the term arises solely from the nominal control sequence while is solely dependent on the nominal control and the linear part of the perturbation closed-loop.
Remark 1
The interpretation of the result above is as follows: it shows that the term, , in the cost, stems from the nominal action of the control policy, the term, , stems from the linear feedback action of the closed-loop, while the higher order terms stem from the higher order terms in the feedback law. In the next section, we use the HJB equation to find the equations satisfied by these terms.
Remark 2
In the above development, we have derived the expression for the cost-to-go of a policy from the initial state at the initial time , i.e., the above expressions are for , however, such an expression is also valid for any pair simply by repeating the above development starting at time from state , i.e., any .
III-B A Closeness Result for Optimal Stochastic and Deterministic Control
Recall the stochastic and deterministic HJB equations (4), (6) from Section II, and the associated optimal control policies (5) and (7). For simplicity, we consider the scalar case here, the vector case is detailed in the Appendix. Let denote the cost-to-go of the deterministic policy when applied to the stochastic system, i.e., applied to Eq. (2). Note that the cost-to-go of the deterministic policy applied to the stochastic system, , is different from the deterministic cost-to-go , and satisfies a policy evaluation equation [bertsekas1]. Similar to the stochastic HJB, the continuous time policy evaluation equation for can be written as:
(16) |
where .
Then, we have the following key result. An analogous version of the following result was originally proved in a seminal paper [fleming1971stochastic] for first passage problems. We provide a simple derivation of the result for a finite time final value problem below.
Proposition 2
The cost function of the optimal stochastic policy, , and the cost function of the “deterministic policy applied to the stochastic system”, , satisfy: , and . Furthermore, , and , for all .
Proof:
We show a sketch here for the case of a scalar state, please refer to the appendix for the complete proof.
Due to Proposition 1, the optimal cost function satisfies:
. Next, we substitute the above equation into the HJB equation (4), along with the minimizing control (5) to obtain a perturbation expansion of the optimal cost function as a power series in . Equating the and terms on both sides results in governing equations for the and terms.
We also know that the cost function of the deterministic policy when applied to the stochastic system satisfies . Similar to above, we substitute this expression into the policy evaluation equation (16), along with the deterministic optimal control expression , to obtain the governing equations for and . These equations, when compared with those for and , are seen to be identical with the same terminal conditions thereby proving the result.
∎
Remark 3
Near-Optimality of Linear Perturbation Feedback. According to Proposition 1, we know that the term in the perturbation expansion above stems from the linear feedback term for any policy, and thus, the same is true for the deterministic policy. Given an initial state , let denote the optimal nominal trajectory under the deterministic feedback law and let denote the linear feedback corresponding to the expansion of the feedback law about this nominal trajectory. Therefore, it follows that if one applies the perturbation linear feedback law , where the feedback acts on the perturbation from the nominal, , starting at the initial state , then the performance of this linear feedback policy is also within of the optimal stochastic policy.
III-C A Perturbation Expansion of Deterministic Optimal Feedback Control: the Method of Characteristics (MOC)
In this section, we will use the classical Method of Characteristics [Courant-Hilbert] to derive results regarding the deterministic optimal control problem. In particular, we will show that satisfying the Minimum Principle is sufficient to assure us of a global optimum for the open-loop problem. Perhaps most importantly, we shall show that the deterministic cost-to-go function has a perturbation structure in that the higher-order terms do not affect the lower-order terms in a Taylor expansion of the optimal feedback law. We also obtain the equations governing the linear and higher-order feedback terms, and show that the linear feedback gain is different from the standard LQR design. Again, for simplicity, we derive the following for the case of a scalar state, please see the Appendix for the vector case.
Let us recall the Hamilton-Jacobi-Bellman (HJB) equation in continuous-time under the same assumptions as above, i.e., quadratic in control cost , and affine in control dynamics [bryson]:
(17) |
where , and the equation is integrated back in time with terminal condition . Define , then the HJB can be written as , where . One can now write the Lagrange-Charpit equations [Courant-Hilbert] for the HJB as:
(18) | ||||
(19) |
with the terminal conditions , where , , , , and .
Given a terminal condition , the equations above can be integrated back in time to yield a characteristic curve of the HJB PDE. Now, we show how one can use these equations to get a perturbation solution of the HJB, and in particular, the linear feedback gain corresponding to the optimal policy. The development also shows that the solution has a perturbation structure in that higher order terms do not affect the lower order terms.
Suppose now that one is given an optimal nominal trajectory , for a given initial condition , from solving the open-loop optimal control problem. Let the nominal terminal state be . We now expand the HJB solution around this nominal optimal solution. To this purpose, let , for . Then, expanding the optimal cost function around the nominal yields: where , . Then, the co-state .
For simplicity, we assume that (this is relaxed but at the expense of a rather tedious derivation detailed in the Appendix). Hence,
where . Expanding in powers of the perturbation variable , the equation above can be written as (after noting that due to the nominal trajectory satisfying the characteristic equation):
(20) |
Next, we have:
(21) |
where . Using , , and substituting for from (20), and expanding the two sides above in powers of yields:
Equating the first three powers of yields:
(22) | |||
(23) | |||
(24) |
Using the first-order necessary condition , the optimal feedback law is given by:
(25) | ||||
Thus, we see that the optimal feedback law has a perturbation structure in that the second-order terms do not affect the first-order terms , and the third and higher-order terms, etc., do not affect the second-order term and so on for the third and higher order terms.
Now, we provide the final result for the general vector case with a state-dependent control influence matrix (please see the Appendix for details). We ignore the and higher-order terms in the feedback law purely for notational convenience.
Definition 1
Let the control influence matrix be given as: , i.e., represents the control influence vector corresponding to the input. Let , where represents the optimal nominal trajectory. Further, let denote the drift of the system. Let , and , denote the optimal nominal co-state and control vectors respectively. Let the Jacobian and Hessian of our system matrices be defined as:
(26) |
Similarly , for the vector function . Finally, define , , and .
Proposition 3
Under A1, and given the above definitions, the following result holds for the evolution of the co-state/ gradient vector , and the Hessian matrix , of the optimal cost function , evaluated on the optimal nominal trajectory :
(27) | ||||
(28) | ||||
(29) |
with terminal conditions , and and the control input with the optimal linear feedback is given by .
Remark 4
Not standard LQR. The co-state equation (27) above is identical to the co-state equation in the Minimum Principle [bryson, Pontryagin]. However, the Hessian equation (28) is Riccati-like with some important differences: note the extra second order terms due to and in the second line stemming from the nonlinear drift and input influence vectors and an extra term in the gain equation (29) coming from the state dependent influence matrix. These terms are not present in the LQR Riccati equation, and thus, it is clear that this cannot be a traditional perturbation feedback design [bryson, Ch. 6]. If the input influence matrix is independent of the state, the first term in the second line remains, and hence, it is still different from the LQR case.
Remark 5
Convexity and Global Minimum. Recall the Lagrange-Charpit equations for solving the HJB (18), (19). Given an unconstrained control, under standard smoothness assumptions on the involved functions, the characteristic curves governed by the equations in space are unique, and do not intersect. Therefore, the open-loop optimal trajectory, found by satisfying the Minimum Principle is also the unique global minimum even though the open-loop problem is non-convex. This observation is formalized in the following result.
Proposition 4
Global Optimality of open-loop solution. Let the cost functions , , the drift and the input influence function be , i.e., twice continuously differentiable, and let a solution to (18)-(19) exist in for any terminal condition . Under A1, an optimal trajectory that satisfies the Minimum Principle from a given initial state , is the unique global minimum of the open-loop problem starting at the initial state .
III-D Loss of Perturbation Structure in Stochastic Control
Finally, we outline the loss of the perturbation structure in the stochastic problem. For the sake of simplicity, we only consider the scalar case in continuous time, however, even this case brings out the difficulty associated with stochastic control while the generalization to the vector case is relatively straightforward, albeit somewhat tedious.
Recall the stochastic HJB:
(30) |
where is the Hamiltonian of the system, and the equation is integrated backwards from a terminal condition . For simplicity, we assume that is not state dependent in the following derivation and we also assume the noise variance , which otherwise would appear in the diffusion term in Eq. (30). Suppose now that we are given the optimal policy and suppose that the nominal trajectory of the system (without noise) starting at some is given by under the nominal control . As was done previously, let us now expand the solution of the equation above in terms of the perturbations from this nominal trajectory, . Then, given the optimal nominal control , we can solve the minimization of the Hamiltonian as:
(31) | ||||
which leads to the necessary condition for a minimum:
(32) |
which is also sufficient for a minimum since leading to being strictly quadratic in the variable . From Eq. (32), the optimizing perturbation control is given by .
Now, let us expand the dynamics and the optimal cost function in the HJB in terms of their perturbations from the nominal trajectory: , , where the represent the Taylor coefficients of the series expansion of these functions. Therefore, , . Noting that the variable , i.e., the space variable has an explicit time dependence via the nominal trajectory, it follows that:
(33) |
where, , are total derivatives with respect to , since they only depend on the time.
Then, using the above expressions, one can express the minimum value of the Hamiltonian in terms of the state perturbations as:
(34) |
Next, noting that , we obtain the following equations for the evolution of the Taylor co-efficient of the optimal cost function by equating the different powers of on both sides of the stochastic HJB (Eq. (30)) given in Eq. (III-D) and (III-D).
(35) | ||||
(36) | ||||
(37) |
where we have expanded the first three terms of the expansion in the equations above, and similar expansions may be done for the higher order terms as well.
At this point, we make the following remarks regarding the perturbation expansion above.
Remark 6
Computational Intractability of the Stochastic Problem. The equations above show that the lower order terms in the stochastic problem are affected by the higher order terms unlike in the deterministic case. Thus, in order to compute the stochastic law, we have to approximate to a high enough order to ensure accuracy in the solution, which in turn implies that the solution of the stochastic problem is very prone to errors. To see this, note that if we were to expand the solution to the order, the Taylor co-efficient would be affected by the coefficients and , and therefore these higher order coefficients would need to be sufficiently small for the resulting solution to be accurate. However, if one approximates to a very high order , quite apart from the obvious curse of dimensionality issue, the resulting system of equations becomes severely ill-conditioned, and consequently, highly sensitive to small errors in the data. Please see our related paper [RL_conv] for the relevant details on this aspect.
Remark 7
The Deterministic Problem. The expressions above also allow us to find the perturbation expansions for the deterministic problem. It is key to note that if the problem considered is deterministic then due to the minimum principle and since in the deterministic problem, we obtain the expressions that we derived via the Method of Characteristics in the previous section. The Method of Characteristics is still necessary since it allows us to establish the uniqueness of the optimal nominal trajectory . Thus, the above development can be thought of as an alternative way to derive the perturbation expansion result. Furthermore, we can see that if we are required to derive the cost-to-go of the deterministic policy when applied to the stochastic system, albeit due to optimality, nonetheless, there is coupling from the higher order terms due to stochasticity arising from the terms above, and thus, even this case is intractable to compute. However, since we are interested only in the deterministic feedback law, such a computation is unnecessary.
IV THE OPTIMALITY OF SHRINKING HORIZON MODEL PREDICTIVE CONTROL
In our developments till this point, we have shown that the deterministic feedback law is near-optimal with respect to the optimal stochastic law and that it has a perturbation structure that is lost in the stochastic problem. However, solving the deterministic DP problem is also subject to the Curse of Dimensionality. Nonetheless, owing to the perturbation structure, one can solve the deterministic problem locally (up to the linear feedback term), and then replan at fixed decision time epochs, assuming that the time between the decision epochs is small enough that the local feedback law remains valid in between the epochs. Thus, consider a Model Predictive type approach to solving the stochastic control problem. We outline the algorithmic procedure in Algorithm 1 to highlight that our advocated procedure is slightly different from the traditional MPC approach studied in the literature [Mayne_1, Mayne_2].
-
41.
Solve the open-loop (noise free) optimal control problem for initial state , along with the
Apply the perturbation feedback law till
set , .
Remark 8
In traditional MPC [Mayne_1, Mayne_2], the horizon to solve the open-loop problem is fixed. The setting is deterministic, and the necessity of replanning for the problem stems from the assumption that the actual problem horizon is infinite, and therefore, computationally intractable. In lieu, our problem horizon is finite, the repeated replanning takes place over progressively shorter horizons, and the need for replanning arises from the stochasticity of the problem. In particular, note that if the system were really deterministic, there would be no need for replanning.
Theorem 1
Near-Optimality of MPC-SH. The MPC feedback policy obtained from the application of the Shrinking Horizon MPC algorithm is near-optimal to to the optimal stochastic feedback policy for the stochastic system (2).
Proof:
We know that , and from Proposition 2, for all . Owing to the uniqueness and global optimality of the open-loop from Proposition 4, it follows that the nominal control sequence, and the associated linear perturbation feedback law, found by the MPC procedure outlined above coincides locally with the optimal deterministic feedback law given any state and any time . Therefore, the result follows.
∎
Note that the proof above also shows that the MPC-SH procedure furnishes the optimal deterministic feedback law which is stated in the following corollary.
Corollary 1
The MPC-SH algorithm furnishes the optimal deterministic feedback law given any initial condition.
The result above establishes that repeatedly solving the deterministic optimal control problem from the current state at the decision making epochs results in a near-optimal stochastic policy. We examine two particularly important consequences in the following.
Stochastic MPC
A major computational bottleneck with stochastic MPC [Mayne_1], is that the MPC search needs to be over (time-varying) feedback policies rather than control sequences owing to the stochasticity of the problem, which leads to an intractable optimization for nonlinear systems. Because of this intractability, most of the work in stochastic MPC deal with linear systems using stochastic tube approach [smpc_mesbah2016, smpc_heirung2018], and some more recent work using generalized polynomial chaos (gPC) [kim2013generalised, FISHER2009polychaos]. Nonlinear stochastic MPC using gPC also typically solves over control sequences instead of feedback policies for traceability. However, as our results demonstrate, the MPC feedback law we propose (MPC-SH) is near-optimal to the fourth order. Further, as we have shown analytically in Section III-D and as will be seen from our simulation results in Section V, in practice, the solution of the stochastic DP problem is highly sensitive to noise, quite apart from the usual issue of dimensionality, and MPC-SH gives much better performance than the solution of the stochastic DP problem. A further important practical consequence of Theorem 1 is that we can get performance comparable to MPC, by wrap** the optimal linear feedback law around the nominal control sequence (), and replanning the nominal sequence only when the deviation is large enough, similar to the event driven MPC philosophy [ETMPC1, ETMPC2].
Reinforcement Learning
The problems considered in reinforcement learning can be construed as one of finding the optimal feedback policy for a stochastic nonlinear dynamical system [bertsekas1]. Typically, this is done via simulations or rollouts of the dynamical system of interest, which allied with a suitable function approximator such as a (deep) neural net, yields a nonlinear feedback policy. However, these methods tend to be highly data intensive, slow to converge, and suffer from extremely high variance in the solution since they try to solve the DP equation [RL_conv]. This is a manifestation of the inherent curse of dimensionality in trying to solve the stochastic DP problem. Thus, in our opinion, albeit the DP equation is an excellent analytical tool to study the structure of the feedback problem, nonetheless, it is not the correct synthesis tool. In fact, it is much easier to repeatedly solve the open-loop problem as prescribed by MPC, i.e., solve for the characteristic curves of the DP problem. Of course, there remains the problem of whether we can solve the open-loop problem online. In our opinion, this is feasible today, when allied with efficient computational algorithms like iLQR [ILQG_tassa2012synthesis] that exploit the causal structure of optimal control problems, suitable high performance computing (HPC) modifications, and suitable randomization of the computations via rollouts that can help us very efficiently estimate the system parameters involved. In fact, this is the subject of the second part of this paper on data-based control [wang2022search].
V Simulation Results
This section will show evidence for theoretical results derived previously through simulations. In subsection V-A, the inaccuracy of the stochastic solution, as discussed in Remark 6, will be shown for a simple 1-D problem in comparison with the deterministic solution. The near-optimality of MPC-SH, which was theoretically shown to be the optimal deterministic solution in Theorem 1, will also be compared with the stochastic solution in a nonlinear problem. Further, we will show why it is intractable to solve the stochastic HJB accurately. In Subsection V-B, the performance of using the optimal linear perturbation feedback derived in Section III-C will be compared with MPC-SH on nonlinear robotic problems. The experiments shown in this section are carried out over 500 Monte Carlo simulations, and the performance statistics are computed from these simulations .
V-A Deterministic vs. Stochastic policy
In this section, we aim to show through simulations, that computing the optimal stochastic feedback law is subject to errors, as explained by the theory discussed previously in Sec. III-D. We show this by comparing the performance of the deterministic solution applied to the stochastic problem and the stochastic solution in a nonlinear problem. We consider the following problem:
(38a) | |||
(38b) |
The solution to the above problem is calculated by solving the HJB equation (written for the scalar case):
(39) |
where, is the expected cost-to-go from state at time , with terminal condition . The minimizing optimal control and we take , and . The noise added to the system in stochastic cases is zero mean Gaussian white noise, with standard deviation being the maximum value of the control input obtained from the nominal trajectory by solving the deterministic problem - . The HJB equation in Eq. (39) is solved by the finite difference (FD) method in a fixed domain since it is the standard method for solving advection-diffusion PDEs, which Eq. (39) is, in the computation fluid dynamics community [FD_CFD]. The parameters used in FD are shown in Table I. The time and space discretization was chosen to satisfy the Courant–Friedrichs–Lewy (CFL) conditions [CFL]. We consider only a 1-D problem for the sake of easy illustration since Eq. (39) becomes computationally intractable to solve for high-dimensional problems; nevertheless, these simple low dimensional problems clearly illustrate the issues with solving the HJB equation.
Domain | |||
---|---|---|---|
1 |
Nonlinear case
We consider the nonlinear system with initial condition . As discussed in Sec. IV, MPC-SH feedback law is the optimal feedback law for the deterministic problem and the cost is near-optimal to the stochastic cost. The algorithm for MPC-SH is given in Algorithm 1. To solve the open-loop optimization problem in MPC-SH, the iterative linear quadratic regulator (ILQR) algorithm is used [ILQG_tassa2012synthesis]. ILQR is used specifically since the converged optimal solution satisfies the necessary conditions of the minimum principle given in Eqs. (18), (19). As discussed in Proposition 4, the deterministic open-loop problem has a unique minimum for our case, and ILQR will guarantee convergence to it [wang2022search].
In our experiment, we solve the HJB equation in (39) for a particular value of in the domain . We use the obtained feedback policy , and apply it to the nonlinear system using the same value the HJB was solved for, to regulate the noise acting on the system. The system is simulated under this feedback policy for a time interval of . We do Monte Carlo simulations of the system for different noise samples of and obtain the mean and standard deviation of the cost incurred by the system over these experiments. The open-loop optimization in MPC-SH is solved using ILQR as discussed above for the specific initial condition and tested on the stochastic nonlinear system for a value of . The experiment is repeated for different noise levels by varying . The decision epoch time chosen for MPC-SH was , approximately the used in FD. The mean and standard deviation of the cost incurred in these experiments are tabulated in Fig. 1. Fig. 1 shows that the MPC-SH feedback law has comparable performance with the stochastic HJB-FD solution. MPC-SH is also computationally more efficient to solve, as HJB-FD requires very fine time discretization to solve without numerical issues even for the 1-D case owing to the CFL conditions (see table I). Also, MPC-SH finds an optimal trajectory for a single initial condition as opposed to HJB-FD which finds all solutions over the entire domain, which is computationally expensive.
Even when the deterministic solution, which MPC-SH is, is applied to the stochastic case, the performance is almost equivalent, due to the near-optimality of the deterministic solution to the stochastic. Moreover, the stochastic policy has higher variance than the deterministic MPC-SH policy at , and fails after that - another case that shows that the calculated stochastic policy is inaccurate. To illustrate the inaccuracy in the HJB-FD solution, we compare the expected cost-to-go value calculated by solving the HJB with the true cost of operation in Fig. 2a. It can be seen that the cost-to-go becomes inaccurate after . The reason for the inaccuracy of the stochastic HJB-FD solution is illustrated in Fig. 2c and 2d. The plots show the trajectories taken by the system under the HJB-FD feedback policy for different values of . When the value parametrizing the strength of the noise becomes large, it can be seen that the trajectories leave the domain on which the solution is obtained, due to the noise acting on the system. Since the cost-to-go solution is unavailable outside the domain, one has to approximate the cost of these trajectories with the cost at the boundary. To get an accurate solution, the domain one has to solve needs to expand with time. Since most computational methods do a fixed domain approximation, the stochastic solution obtained will inherently be inaccurate because the states inside the boundary need the cost-to-go values of states outside the domain as the noise intensity increases. Expanding the domain makes the problem more computationally expensive and trajectories will still leave the domain in high noise cases. In contrast, MPC-SH does not face the issue of computational inaccuracy when a trajectory exits the boundary since it can compute a new trajectory from any given state without worrying about the boundary and the boundary conditions as required by HJB-FD. In particular, this may be construed as the primary computational benefit of using the MPC-SH approach. In the deterministic case, owing to the absence of noise, the control takes the system towards the origin and not outside the domain. So, the deterministic cost-to-go and feedback policy is always accurate. Furthermore, note that when the stochastic HJB solution is accurate, the system does not leave the domain owing to the control dominating the effect of the noise.
V-B Comparison between MPC-SH and Optimal Linear feedback
In this section, we will show the comparison in performance of two different deterministic feedback laws: the optimal linear feedback and the MPC-SH feedback law. In Remark 3, it was shown that the optimal linear feedback controller given by Eqs. (27)-(29), designed around the optimal open-loop nominal trajectory is also near-optimal to the order of to the stochastic system. This design is referred to as the trajectory-optimized perturbation feedback controller (T-PFC) [parunandi2019TPFC]. The difference between T-PFC and MPC-SH is that, T-PFC plans the nominal trajectory only once, from the initial state, and uses the linear feedback to correct for errors during its execution. While, MPC-SH replans the nominal trajectory from the current state continuously and uses the linear feedback only for a short interval between the replans. The advantage of using T-PFC is that the open-loop optimization has to be carried out only once (preferably offline), and the precomputed linear feedback gains can be used to correct for deviations due to uncertainty online. In a stochastic setting, this optimal nominal trajectory generated initially is only optimal if the system stays close to the nominal. If it deviates, the trajectory has to be replanned from the current state as done by MPC-SH to maintain optimal performance. We will examine how the performance of T-PFC compares with MPC-SH in nonlinear robotics problems, namely the car-like robot and cart-pole system, for different noise levels in Fig. 3.
In Fig. 3, we see that T-PFC shows comparable performance to MPC-SH for low values of . As noise increases, the trajectory deviates from the nominal computed initially, and the feedback policy is no longer optimal, necessitating the need for a replanned nominal trajectory from the current state. Hence, the performance of T-PFC deteriorates for high noise levels. Nevertheless, there is value for T-PFC-like deterministic feedback laws in applications that wish to minimize onboard computing and act in low-noise settings.
V-C Discussion
The primary takeaway from Section V-A and V-B is that deterministic policies are not only near-optimal but also accurate, scalable, and repeatable. It is not possible to compute the stochastic policy accurately, as shown in Sec. V-A. Note that the inaccuracy is not a limitation of the finite difference method used. Galerkin Finite Element and Collocation methods like Chebyshev polynomial-based methods are also solved on a bounded domain, and consequently, not immune to the errors observed in FD. As discussed in Sec. IV, random sampling-based methods like approximate dynamic programming, and reinforcement learning are dependent on their samples to explore the domain and inherently have the same issue in the stochastic case. In high dimensions problems, one needs a prohibitively large number of samples to explore the domain. An inefficient sampling of the domain will lead to inaccurate policies as the cost-to-go is not accurately captured by the samples. Due to this issue, there is an inherent variance in the solution obtained by such methods [RL_conv]. We have done an exhaustive investigation comparing the deterministic feedback approach with other RL methods in the companion paper [wang2022search], where we report the accuracy, scalability, efficiency, and repeatability of the deterministic policy that the stochastic RL methods lack. To summarize, as shown in Fig. 2, the regime where the stochastic solutions can be computed accurately is the one of low noise where the deterministic solution gives near-identical performance, and consequently, in practice, the deterministic feedback is sufficient.
VI Conclusion
In this paper, we have considered the problem of stochastic nonlinear control. We have shown that recursively solving the deterministic optimal control problem from the current state, à la MPC, results in a near-optimum policy to fourth order in a small noise parameter, and in practice, empirical evidence shows that the MPC law performs better than the law obtained by computationally solving the stochastic DP problem owing to the perturbation structure of the deterministic optimal control problem. An important limitation currently is the smoothness of the nominal trajectory such that suitable Taylor expansions are possible, this breaks down when trajectories are non-smooth such as in hybrid systems like legged robots, or maneuvers have kinks for car-like robots such as in a tight parking application. It remains to be seen as to if, and how, one may extend the result to such applications that are piecewise smooth in the dynamics. Also, a further careful investigation into the relative merits and demerits of the shrinking horizon approach to MPC when compared to the traditional fixed horizon approach is required, as is the generalization to the more practical and important partially observed problem.
Appendix A DETAILED PROOFS OF RESULTS
A-A Proof of Lemma 1
Proof:
We proceed by induction. The first general instance of the recursion occurs at . It can be shown that:
Noting that and are second and higher order terms, it follows that is .
Suppose now that where is . Then:
Noting that is and that is by assumption, the result follows that is .
Now, let us take a closer look at the term and again proceed by induction. It is clear that . Next, it can be seen that , which shows the recursion is valid for given it is so for .
Suppose that it is true for . Then:
where the last line follows because , and is the second order term of . This completes the induction and the proof.
∎
A-B Proof of Lemma 2
Proof:
We have that: , where the last line of the equation above follows from an application of Lemma 1. ∎
A-C Proof of Proposition 1
In order to prove this result, we first need the following preparatory result. Consider the following deterministic continuous time system:
where is a given continuous time input.
We rewrite the above policy evaluation equation in state-space form as follows:
where the above equations can now be expressed in a time-invariant state space form as: , and , where , , and .
Given that the component functions are five times continuously differentiable () in their arguments (assumption A2), the output can be expressed in terms of the inputs as the unique Volterra series (Theorem 2.5 in [Volterra_Krener]) where we have suppressed the dependence on for notational convenience:
(40) |
where the Volterra kernels are unique and continuous in their arguments, and is an function.
Proof:
We show the result for a scalar input, the generalization to a vector input is straightforward. We first write the sample path cost in an input-output fashion in the discrete time case. Let be a given input sequence, and given a discretization time such that , let , denote a piecewise constant approximation of the input. Under A2, the cost of any sample path from a given initial state can be expanded as follows in discrete time (where we have suppressed the explicit dependence of the different terms on for simplifying notation): where represents the nominal/ zero input cost and
where represent the piecewise constant discretized kernels corresponding to the Volterra kernels defined in (40).
Further, the remainder function is an function.
Let denote the cost of the trajectory under the continuous time input . Then it follows that as , regardless of the input sequence . Therefore, it follows that the discretized piecewise constant kernels in the sense as .
If the inputs were a discretized Wiener sequence , where is a Gaussian white noise sequence, we can write the cost of a sample path as:
,
where is the zero noise cost and
Moreover, due to the whiteness of the noise sequence , it follows that , and , since these terms are made of odd valued products of the noise sequences, while are both finite owing to the finiteness of the moments of the noise values. Next as we take the limit of the terms above as , we obtain:
where the first equality above follows from the convergence of the discretized kernels for , while the integrals are finite owing to the continuity of the functions and as established in (40).
Further , i.e., is .
Therefore, taking expectations on both sides, we obtain:
where ,
which proves the first part of the result.
Next, from Lemma 2, as we take the limit , it is clear that stems solely from the continuous-time nominal trajectory, and that is dependent on the continuous-time nominal and the linear closed-loop feedback. Therefore, the result follows.
∎
A-D Proof of Proposition 2
Proof:
Using Proposition 1, we know that any cost function, and hence, the optimal cost-to-go function can be expanded as:
(41) |
Consider the HJB in Eq. (4) and substitute the minimizing control (Eq. (5)). This gives the PDE
(42) |
with terminal condition Also, , , and is the trace operator. Substituting Eq. (41) into Eq. (A-D) we obtain that:
(43) |
Now, we equate the , terms on both sides to obtain perturbation equations for the cost functions .
First, let us consider the term. Utilizing Eq. (43) above, we obtain:
(44) |
with the terminal condition .
Similarly, one can obtain the equations by equating the terms in Eq. (43), which after regrou** and cancelling some of the terms yields:
(45) |
with terminal boundary condition . Note the perturbation structure of Eqs. (A-D) and (45), can be solved without knowledge of etc., while requires knowledge only of , and so on. In other words, the equations can be solved sequentially rather than simultaneously.
Now, let us consider the deterministic HJB equation in Eq. (6). Recall, represents the optimal cost-to-go of the deterministic problem, and is the deterministic policy, analogous to the stochastic case. Substituting in Eq. (6) gives
(46) |
with terminal condition
Next, let denote the cost-to-go of the deterministic policy when applied to the stochastic system, i.e., Eq. (1) with . Then, the cost-to-go of the deterministic policy, when applied to the stochastic system, satisfies:
(47) |
with terminal condition . From Proposition 1, we know . Substituting this in Eq. (A-D) gives
(48) |
As before, if we gather the terms for , , etc., on both sides of the above equation, we shall get the equations governing , etc. First, looking at the term in Eq. (48), we obtain:
(49) |
with the terminal condition .
The result above has used the fact that the noise sequence is white. However, this is not necessary to show that for all .
A-E Proof of Proposition 3
Proof:
Let the system model be given as
where, the system matrices, its Jacobians, and Hessians are defined as in Definition 1.
Using indicial notation, the Lagrange-Charpit equations are (the subscript is ignored for the sake of simplicity):
(51) | ||||
(52) |
Performing a perturbation expansion of around a nominal trajectory gives
(53) |
Expanding the co-states about the nominal gives
(54) | ||||
(55) |
Substituting Eq. (54) and (55) in Eq. (53), we get
(56) |
Let Differentiating Eq. (54) and using Eq. (56), we get
(57) | ||||
(58) |
Expanding Eq. (52) upto 1st order about a nominal trajectory and substituting Eq. (54),
(59) |
Comparing the terms up to 1st order in in Eq. (58) and Eq. (59) with appropriate change in indices, we get
(60) | |||
(61) |
Substituting and changing indices to group terms, Eq. (60) can be written as whose vector form is Eq. (27). Similarly, can be substituted in Eq. (61) and can be written as
(62) | ||||
(63) |
Eq. (28) and Eq. (29) are the vector form of Eq. (62) and Eq. (63) respectively. ∎
A-F Proof of Proposition 4
Proof:
We show the scalar case, the vector case is a straightforward extension. We need the function to be in all its arguments for unique characteristic curves, i.e., characteristic curves that do not intersect, since then the functions and are , and therefore Lipschitz continuous. From the existence and uniqueness results of ODEs [nonlinear_systems_khalil, Ch. 3.1], it follows that the Lagrange-Charpit characteristic ODEs , , are Lipschitz continuous in their right hand side functions, and therefore, have unique solutions in the interval . Moreover, the state and co-state vary continuously with respect to the terminal condition at any time . Let us denote . Thus, is a function of , i.e., is uniquely determined by the value of .
Next, we show that under the Lagrange-Charpit equations, the function remains a function, i.e., we can write , for some suitable smooth function , for any . In order to show this, suppose that this is not the case for some . Then, it is necessary that there exist such that , or equivalently that (see Fig. 4). This in turn implies that there exists a terminal condition such that , where the terminal state maps to the state under the Lagrange-Charpit equations. We will now show that this is not feasible. Owing to the uniqueness of the solutions of the Lagrange-charpit equations: the Jacobian , for any . Thus, for , substituting into the above equation implies that:
(64) |
for any terminal state , where represents the derivative of the function. Consider now the state , owing to the fact that , we obtain that:
(65) |
where the partial derivatives are taken at . The above implies that , however, by definition: , which means that . Owing to Eq. (64), this means that . However, using the second equality in Eq. (65), this implies that , which contradicts the assumption that . Thus, it follows that , for some smooth function , for any .
Next, note that if a characteristic curve flows through the initial state , then it means that we have found a terminal state , along with the terminal co-state , that satisfies the Lagrange-Charpit equations. However, this is, by definition, a solution that is found by satisfying the Minimum Principle. Therefore, owing to the development above, the co-state is uniquely determined by the initial state , and a solution that satisfies the minimum principle is necessarily unique. Moreover, since this solution is the unique characteristic curve of the HJB flowing through , it is also the global optimum.
The arguments made above can be generalized to the vector case where the function in the vector case is defined as
and the equivalent Lagrange-Charpit characteristic ODEs are:
∎
Appendix B Acknowledgment
This work was supported by the NSF under grants ECCS-1637889, CDSE 1802867, and the AFOSR DDIP program under grant FA9550-17-1-0068. The simulations were conducted with the advanced computing resources provided by Texas A&M High Performance Research Computing.
Author biography:
Mohamed Naveed Gul Mohamed
is pursuing his Ph.D. in Aerospace Engineering at Texas A&M University, College Station. He holds a bachelor’s degree in Instrumentation and Control Engineering from NIT Trichy, India. His research interests are on optimal control of nonlinear dynamical systems, focusing on overcoming challenges such as stochasticity, partial observation, unknown models, and stability concerns.
|
Suman Chakravorty
is a Professor of Aerospace Engineering at Texas A&M University.
He holds a Ph.D. in Aerospace
Engineering from the University
of Michigan, Ann Arbor. His research interests broadly lie in Estimation and Stochastic Optimal Control Theory with application to Robotic Control and Situational Awareness Problems.
|
Raman Goyal earned his Ph.D. in Aerospace Engineering from Texas A&M University, College Station and his B.Tech. degree in Mechanical Engineering from IIT Roorkee, India. Raman is interested in intelligent learning approaches for optimal control of stochastic nonlinear systems. He has also worked on modeling, design, control, and security of various cyber-physical systems.
|
Ran Wang received his Ph.D. in Aerospace Engineering from Texas A&M University, College Station and his bachelor’s degree in Mechanical Engineering from Huazhong University of Science and Technology. Ran’s research interests include optimal control and reinforcement learning of soft-body robots. |