Can the weighting matrices in LQR be a function of the states instead of time

calculus-of-variationsdynamic programmingdynamical systemsoptimal controloptimization

In LQR, the cost has the following form:
$$ J = x(t_f)^T Q(t_f)x(t_f) + \int_0^{t_f} \big( x(\tau)^TQ(\tau)x(\tau) + u(\tau)^T R(\tau)u(\tau) \big) d\tau$$

where $x$ is the state vector and $u$ is the input or control vector. Also, $Q$ and $R$ may also be constants in many cases. Instead, can we consider weighting matrices varying with the states i.e., $Q(x(t))$ and $R(x(t))$ instead of $Q(t)$ and $R(t)$?

Best Answer

The Q for quadratic in LQR represent that the function inside the integral of the cost function should be quadratic in $x(t)$ and $u(t)$ (the terminal cost should as well). However, as stated by Cesareo, your optimal control problem might not have a quadratic function inside the integral of the cost function and thus the problem would not be called LQR anymore.

You could still define an optimal control problem using $Q(x(t))$ and $R(x(t))$. However, you can't solve it in the same way one can solve such LQR problem. Namely, the finite horizon LQR problem can be solved using the following Riccati differential equation

$$ \dot{P}(t) = P(t)\,B(t)\,R^{-1}(t)\,B^\top(t)\,P(t) - A^\top(t)\,P(t) - P(t)\,A(t) - Q(t), \tag{1} $$

with $P(t_f) = Q(t_f)$ and $\dot{x}(t) = A(t)\,x(t) + B(t)\,u(t)$, such that the optimal policy is obtained using $u(t) = R^{-1}(t)\,B^\top(t)\,P(t)\,x(t)$. So in order to find $P(t)$ you have to solve $(1)$ backwards in time. Thus if you would use $Q(x(t))$ and $R(x(t))$ it would be required that you already know $x(t)$ from $t=0$ to $t=t_f$.

You could solve your problem using Pontryagin's maximum principle. Though, in general this only gives you the optimal $u(t)$ given some initial condition and not the optimal policy, such as $u(t) = -K(t)\,x(t)$. Furthermore, Pontryagin's maximum principle might not give you an analytical solution, since you need to find the initial conditions for the co-states.

Related Question