Date: 1/18/2025
By: Sialoi Taa
Note
Markdown file might look different on GitHub as the environment used in writing the latex equations are in a different environment as GitHub's rendering method. It is highly encouraged to clone the repo or relevant files to your local machine and look at the markdown files through a text editor such as VS Code.
-
What are Model Predictive Control (MPC) techniques?
Model Predictive Control (MPC) is a control strategy that uses a mathematical model of a system to predict its future behavior and optimize its performance over a defined time horizon.MPC relies on a model of the system (e.g., physics-based or data-driven models) to predict the system's future state over a finite prediction horizon. The model describes how inputs affect the system's state and outputs. -
What does this work hope to solve?
"There's a chicken-and-egg problem for autonomous racing research at the handling limit: to safely achieve higher speed levels requires more vehicle dynamics data; but to acquire highspeed data requires the controller to achieve higher speed levels in the first place."
This means that the problem at hand was to achieve a way to create a controller that can safely handle highspeeds, however to create that controller, higher speeds had to have been achieved already and vehicle dynamic data had to have already of been recorded during times of highspeed. This creates a problem of what comes first the scarcity of data at highspeeds or the absence of a model that can obtain data safely at highspeeds. -
What was the solution proposed?
"Therefore, the motivation of this work is to break the circular problem mentioned earlier by performing incremental and safety-aware exploration toward the limit of handling and iterative learning of the vehicle dynamics in high-speed domains."
The solution proposed was to incrementally record data, update the model and repeat until the limit of the model's system is reached and cannot keep up with the high velocity of the vehicle anymore. The reason why this is great is because this solution provides a way of tuning parameters that compensates the context of the scarcity of high speed data and corrects the problem of having a model that can take the vehicle to higher speeds to obtain that information to update the model. The iterative process of learning and testing the limit of handling as the speed is increased is how the solution fixes the circular problem.
-
Using a state vector
$\mathbf{x} = [v_x, v_y, \omega_z, e_\psi, s, e_y]^\top$ and input vector$\mathbf{u} = [a, \delta]^\top$ , they start to build their model:-
$v_x$ : Longitudinal velocity of the vehicle at the center of gravity. -
$v_y$ : Lateral velocity of the vehicle at the center of gravity. -
$\omega_z$ : Yaw rate (angular velocity about the vertical axis) at the center of gravity. -
$e_\psi$ : Heading error, the difference between the vehicle's orientation and the orientation of the path tangent at the closest point. -
$s$ : Path progress, the arc-length of the closest point on the reference path. -
$e_y$ : Lateral deviation from the path, the shortest distance between the vehicle and the reference path.
-
-
Input vector:
-
$a$ : Acceleration input (longitudinal control). -
$\delta$ : Steering angle input (lateral control).
-
-
$\tau$ describes the circuit path and maps a range$[0, L]$ onto the$R^2$ space. With$s ∈ [0, L]$ , we can use$s$ as input parameters into$\tau$ to map arc length progression into global position such as$(x, y)$ .$s ∈ [0, L]$ $\tau : [0, L] \rarr R^2$
-
$\overline{\tau} = \tau(mod(s, L))$ for $s ≥ 0 $ is the definition for the closed circuit that the kart will be driving on. The reason why this is necessary is because after the first lap,$s$ will continue to grow. Since the arc is a closed circuit of length$L$ , we can reset the progression of growth after$s=L$ . This will simplify the calculations as we can provide a definite amount of space that we know will be traveresed. -
If the global position of the vehicle is
$p = (x, y)$ , then the we can model the progression of the vehicle through$s(p) = arg min_s\space||\tau(s)-p||_2$ . The point of this equation is to take every value of$s$ inside the range$[0, L]$ and return the point$s$ that is closest to$p$ . -
Next to calculate the lateral deviation from the path we use
$e_y(p) = min_s\space||\tau(s)-p||_2$ . What this equation is going to do is look for the point$s$ that is closest to the point$p$ and return the distance between global position of point$s$ , ($\tau(s)$), and point$p$ . This is important because we need to know how to calculate the current state of the vehicle from the nominal path. Nominal path is the reference path or ideal path that will be the base for the cost function and the kart will try to mimic the most. -
The last variable to calculate for the state vector
$x$ is$e_\psi$ . To calculate this we use this formula:$e_\psi(p, \psi) = \psi - arctan(\tau'(s(p)))$ .$s(p)$ will calculate the point$s$ on the arc that is closest to the vehicle position$p$ .$\tau'$ is the derivative of$\tau$ , and since$\tau$ is the formula that will turn the arc length position$s$ into a global position,$\tau'$ will calculate the tangent line at arc length$s$ . Now finding the$arctan(\tau')$ will give the orientation of the tangent line. If$\psi$ represents the orientation of the vehicle, finding the difference between the orientation of the vehicle and the tangent line will be the error in orientation ($e_\psi$ ). -
We write the discretize nonlinear dynamics as:
-
This will model the prediction of a future state as a function of a present state and input vector. The following are the constraints placed on the system's state vectors and the input vectors.
$\mathcal{X} = {x\space\space|\space −W/2 ≤ e_y ≤ W/2}$
$\mathcal{U} = {u\space\space|\space u_l ≤ u ≤ u_u}$ -
The paper then moves onto the cost function:
where
- This indicator function will add 1 to the lap time T that we will focus on minimizing. However, this still doesn't solve the infinite horizon problem which is that the time for a lap to complete could be infinite and lead to optimization becoming impossible. There's also a possibility that the vehicle model function in (2c) could be vastly different from the true vehicle dynamics and lead to disastrous effects, especially at high speeds where the vehicle is at the limits of operation.
- The solution proposed was to create a finite-horizon convex approximation of (2), which uses state and input trajectories from prior laps to synthesize a convex terminal cost-to-go function and target set.
- Convex terminal cost-to-go function is a function that penalizes the difference of the end state of the system to the goal state at the end of the lap for the defined finite horizon.
- Convex target set means that the set is convex, i.e., for any two points in the set, the line segment joining them is also within the set.
- The main idea of LMPC is to use the data from iterations 1 to j − 1 to synthesize a finite-horizon local convex approximation of (2) for iteration j, which is then solved in a receding horizon manner.
- The LMPC creates a control policy that will look at a desired state trajectory and create a list of control inputs
$u$ that will get to that desired state. - Let's talk about how we could create that local convex approximation. Let's say that for iteration
$j$ we have a dataset$\mathcal{D}^j\space =\space (\text{x}^j, \text{u}^j)\space \cup \space\mathcal{D}^{j-1} $ , where$\text{x}^j = {x^j_0, x^j_1, ..., x^j_{T^j}}$ and$\text{u}^j = {u^j_0, u^j_1, ..., u^j_{T^j}}$ are the closed-loop state and input sequence for iteration$j$ and$T^j$ denotes the time step at which the lap was completed for iteration$j$ , i.e., the first time step where$\mathcal{1_F}(x_k) = 0$ . This means that for the current iteration or lap$j$ , the dataset of input controls$\text{u}^j$ and state vectors$\text{x}^j$ are combined with the datasets of the previous iterations or laps. - Dataset
$\mathcal{D}^0$ can be intialized with human driven laps.
- As the closed-loop trajectories stored in
$D^j$ are from the actual vehicle, it is straightforward to see that if we can control the vehicle to any state in$D^j$ , then there exists a known feasible control sequence which can be used to complete the lap from that state. - Now we talk about how to construct convex terminal sets that are local about a given state
$x$ . Using$K$ -Nearest Neighbors, we look at the past$P$ laps and choose$K$ number of states that are closest to the current state. This is done because it reduces the computational complexity and responds more favorably for fast online control. We choose the target state through evaluating the weighted euclidean distance over the relevant states:
where P and D ⪰ 0 which means that matrix P and D are positive semidefinite.
- Then we let
$\mathbf{X}^j(x;\mathcal{D}^j) \in \mathbb{R}^{n\times KP}$ denote the matrix formed by the$KP$ states closest to$x$ . We then define the target set as the convex hull of these states:
-
The equation is saying the matrix
$\mathcal{X}$ for iteration$j$ and for the finite horizon with$N$ steps uses state$x$ and dataset$\mathcal{D}^j$ for lap$j$ to create state vectors$\overline{x}$ that live inside the space$\mathbb{R}^n$ . To find an$\overline{x}$ state vector, we need to find a$\lambda$ that exists in$\mathbb{R}^{KP}$ . This lambda vector$\lambda$ has to have elements between 0 and 1, including 0 and 1 too, and no matter what each element is between 0 and 1, all elements must sum up to 1. Once we find such a$\lambda$ , we will multiply it with the matrix$\mathbf{X}^j(x;\mathcal{D}^j)$ which will look like$\mathbf{X}^j(x;\mathcal{D}^j)\lambda$ . Remember that$\mathbf{X}^j(x;\mathcal{D}^j) \in \mathbb{R}^{n\times KP}$ and represents the matrix of all of the$K$ -Nearest Neighbor states from the previous$P$ laps close to the current state$x$ . The product of this will create$\overline{x}$ which lives in$\mathbb{R}^n$ and is a linear combination of the$KP$ number of states closest to$x$ and the vector$\lambda$ , with$\lambda$ linearly scaling the$KP$ number of states to create a target set. -
The matrix
$\mathbf{X}^j(x; \mathcal{D}^j)$ represents$K$ nearest-neighbor states from the previous$P$ laps that are closest to the current state$x$ . This matrix is in$\mathbb{R}^{n \times KP}$ , meaning it contains$KP$ state vectors, each in$\mathbb{R}^n$ . -
To construct a target state
$\overline{x} \in \mathbb{R}^n$ , we must find a weight vector$\lambda \in \mathbb{R}^{KP}$ that satisfies:- Each element of
$\lambda$ is between$0$ and$1$ . - The sum of all elements in
$\lambda$ equals$1$ (convex combination condition).
- Each element of
-
Once such a
$\lambda$ is found, we compute$\overline{x} = \mathbf{X}^j(x; \mathcal{D}^j) \lambda$ . This means$\overline{x}$ is a weighted sum of the nearest-neighbor states, forming a convex hull of those states.
Note
We find the
Note
Look into Quadratic Programming (QP) solvers. They're more efficient than gradient descent approach when considering a cost function is quadratic with linear constraints (quadratic functions with linear constraints are convex).
- The form of a quadratic programming problem is:
- But must have the constraints of the form:
- The cost-to-go for any state
$x^i_k$ (the$k\text{-th}$ state on lap$i$ ) is calculated through$T^i-k$ where$T^i$ is the number of states needed to complete lap$i$ .$T^i-k$ represents the time left to complete the lap from the current state$x$ . - Now we're going to calculate the separate cost-to-go values for each state that's inside
$\mathbf{X}^j(x; \mathcal{D}^j)$ , the nearest neighbors found closest to current state$x$ . We'll place the values inside a vector and name that$J^j_N(x;\mathcal{D}^j) \in \mathbb{R}^{KP}$ . - After finding that cost-to-go vector, we can define a minimum cost-to-go function for any
$\overline{x}\in\mathcal{X}^j_N(x;\mathcal{D}^j)$ as:
- Notice how the same
$\lambda$ for finding the optimal$\overline{x}$ is used in the cost function? This is a good way of using previously experienced costs, combine the costs in a way to find a minimum. - Once the
$\lambda$ used to find the min is found, we can imply that the vectors used to create that list of costs can be linearly combined in the same way to create a feasible state$\overline{x}$ . - When calculating that cost-to-go of that
$\overline{x}$ , it'll create that minimum cost-to-go calculated in$Q^j_N\text{.}$ - By only taking the
$KP$ nearest states to the current state, we'll reduce computation loads significantly as the dataset grows because we'll only be taking the most relevant states. If we collect all KP states inside a matrix and we're trying to make a feasible state from them, we know that whatever$\overline{x}$ is created it'll span the columns of the matrix$\mathcal{X}^j_N$ .
Note
Terminal Cost-To-Go function is a cost function used at the final time step of an MPC horizon to encourage desirable long-term behavior. It helps account for the cost beyond the finite predicted horizon and helps ensure stability. It is typically a Lyapunov function, meaning it decreases over time, ensuring convergence. Often derived from a value function of an infinite-horizon optimal control problem. The value function for this paper would be equation (2). It helps to approximate the optimal cost-to-go beyond the finite LMPC horizon.
Note
Terminal Target Set (
Note
A control-invariant set is a set of states where, for every state inside the set, there always exists a feasible control input that keeps the system inside the set. What does this mean for LMPC? If your vehicle reaches this set, you can always generate feasible control inputs that keep the vehicle stable and on track. The control-invariant set ensures that the MPC doesn't steer the vehicle into an unrecoverable position.
-
Why Do We Need a Terminal Target Set? Since the LMPC only plans a few steps ahead (e.g., 10 or 20 states), we need a way to ensure that at the end of the planning horizon, the system is in a state that allows future motion without instability. The terminal target set forces the LMPC to steer toward a "safe" region that ensures the vehicle will remain feasible beyond the planning horizon.
-
If we try to optimize for the lambda and get the optimal weighted vector in order to get to the optimal next state
$\overline{x}$ , how do we get the finite horizon that will give us a predicted trajectory? The answer is to recursively find the input optimal input $\overline{u}$ that is used to go from current state $x$ to optimal next state $\overline{x}$ using the $f(x_k, u_k) = x_{k+1}$. So if we have to find the trajectory 10 steps ahead, we'll have to repeatedly find $\overline{x}$ and plug in $\overline{u}$ and then use that $\overline{x}$ to find the next optimal state $\overline{x}{k+1}$ until we're at $\overline{x}{k+9}$, or $x_{k+10}$.
- Using what we learned previously in the above sections, we can finally construct our LMPC control policy:
$$\begin{align*} J^j_k (&x_k, u_{k-1}, \mathbf{\overline{z}}_k; \mathcal{D}^{j-1}) = \
&\min_{x,u,\lambda} \sum^{N-1}_{t=0} \mathbb{1}_{\mathcal{F}}(x_t) + c_u|| u_t ||^2_2 + c_{\Delta u}|| u_t - u_{t-1} ||^2_2 \\
&\quad\quad\quad\quad + J^{j-1}_N(\overline{x}_{k+N};\mathcal{D}^{j-1})^\top\lambda \tag{4a} \\
\text{subject to }& x_0=x_k, u_{-1}=u_{k-1} \tag{4b} \\
&x_{t+1} = A(\overline{z}_{k+t};\mathcal{D}^{j-1})x_t + B(\overline{z}_{k+t};\mathcal{D}^{j-1})u_t \\
&\quad + C(\overline{z}_{k+t};\mathcal{D}^{j-1}), t \in \{0, ..., N-1\}, \tag{4c} \\
&x_t \in \mathcal{X}, u_t \in \mathcal{U}, t \in \{0, ..., N \} \tag{4d} \\
&\mathbf{X}^{j-1}(\overline{x}_{k+N};\mathcal{D}^{j-1})\lambda = x_N, \tag{4e} \\
& 0 \le \lambda_i \le 1, \mathbb{1}^\top\lambda = 1 \tag{4f} \\
\end{align*}$$
where
- $J^j_k (x_k, u_{k-1}, \mathbf{\overline{z}}k; \mathcal{D}^{j-1})$ is read as the cost-to-go of state $x_k$ during iteration $j$, using state $x_k$, previous control input $u{k-1}$, optimal set of states and inputs
$\overline{\mathbf{z}}_k$ for the current finite horizon, and the previous iteration dataset$\mathcal{D}^{j-1}$ . - Let's dissect this. The LMPC policy has 2 parts, the summation and the cost-to-go function for the last predicted state of the optimized finite horizon. We'll go through the summation first and then the cost-to-go for the last predicted state and why they're present.
- The summation has 5 parts to examine and we'll say what they represent. Here they are:
-
$\mathbb{1}_{\mathcal{F}}(x_t)$ : This is the indicator function that was defined in part (2). The purpose of this function is to keep adding 1 if state$x_t$ is before the lap is completed and add 0 if the state is has progressed past the finish line. -
$c_u$ : This is a cost coefficent for penalizing the magnitude of control input$u_t$ . We want this here because the last thing we want is to have a control input that has a high steering or high acceleration value. Either one will only lead the vehicle to violate the track boundaries or cause instability in the vehicle's controlling algorithm. In any case, having the vehicle accelerate or deccelerate too quickly will result in instability and cause the predefined vehicle dynamics model to fail. Same for steering, if the vehicle is going too fast and we steer too aggressively we'll make the vehicle skid and lose control. -
$||u_t||^2_2$ : This is taking the squared L2 norm of the control input$u_t$ . This will further penalize large magnitudes and encourage smaller parameters for inputting control parameters such as steering and acceleration. -
$c_{\Delta u}$ : This is the cost coefficient for the change of control inputs from last state$u_{k-1}$ to current state$u_{k}$ . The coefficient is used for penalizing if there's a major difference between sequential control inputs one after the other. -
$|| u_t - u_{t-1} ||^2_2$ : This is the squared L2 norm of the difference between the current control input$u_t$ and the last control input$u_{t-1}$ . This will give us the difference of the 2 vectors, get the L2 norm of that, and then square it. This is useful because we want to the change in inputs to be as small as possible from one state to the next. The reason why this is needed is because we don't want the vehicle to jerk and respond irratically. If we had an$u_{t-1}$ that was steering the vehicle left and a$u_t$ that steers the vehicle right, that shift will violently shake the chassis and possibly drive the vehicle into a skidding state. To prevent situations like that, this term makes it less likely that the control inputs will cause the vehicle to become unstable.
-
- Here's the second part of the function:
- $J^{j-1}N(\overline{x}{k+N};\mathcal{D}^{j-1})$ is the cost-to-go of the last predicted state. This is saying that it will use the final predicted stated $\overline{x}{k+N}$ where N is the number of steps ahead we want to predict from $k$. This is taking the state $\overline{x}{k+N}$, finding the matrix
$X$ that has the$KP$ states nearest to it using the dataset$\mathcal{D}^{j-1}$ , and finding the cost-to-go vector of all of the states in$X$ , or $J^{j-1}N(\overline{x}{k+N};\mathcal{D}^{j-1})$. -
$\lambda$ is the weighted vector multiplied to $J^{j-1}N(\overline{x}{k+N};\mathcal{D}^{j-1})$ to calculate the cost-to-go.
- $J^{j-1}N(\overline{x}{k+N};\mathcal{D}^{j-1})$ is the cost-to-go of the last predicted state. This is saying that it will use the final predicted stated $\overline{x}{k+N}$ where N is the number of steps ahead we want to predict from $k$. This is taking the state $\overline{x}{k+N}$, finding the matrix
- In this section we'll get to see how the vehicle dynamics model is learned.
- We start with assuming how to model the true dynamics of the system and we do that with the following
where
- Next we define the prediction of the nominal model as
$\hat{x}^+ = f(x, u)$ where x and u are the given state and input.
Note
Linearizing a error dynamics is an essential topic to understand in optimization for robotics. Finding the true error dynamics of a system is often hard and almost impossible to find, so we try a local approximation through linearization. Remember that error is the difference between the current state
- They try to linearize the error dynamics by using a reference state and input
$\bar{z}$ as follows:
where
- Think of the jacobians as sensitivity maps for the state and input. Remember that
$A^e$ and$B^e$ are calculated using$\bar{z}$ from the pervious dataset$\mathcal{D}^{j-1}$ of the current iteration$\mathcal{D}^{j}$ . For example, if you're using$x_k^j$ and$u_k^j$ for as$x$ and$u$ for (6), then we would use$x_k^{j-1}$ and$u_k^{j-1}$ for$\bar{x}$ and$\bar{u}$ . - So rewriting the above equation, we would have something like this:
-
Notice what we have at the end of the simplification:
-
$e(\bar{x}, \bar{u})$ : The error of the optimal state$\bar{x}$ and optimal input$\bar{u}$ from last iteration$j-1$ at step$k$ , -
$A^e(x - \bar{x})$ : A mapping of the state error vector$(x - \bar{x})$ onto the sensitivity map or jacobian of$e$ evaluated$\bar{x}$ and$\bar{u}$ . This term scales the affects of the difference between the nominal state and the current state on the system's dynamics. -
$B^e(u - \bar{u})$ : A mapping of the input error vector$(u - \bar{u})$ onto the sensitivity map or jacobian of$e$ evaluated$\bar{x}$ and$\bar{u}$ . This term scales the affects of the difference between the nominal input and the current input on the system's dynamics.
-
-
At the end of this simplification, we get an error vector for the next state based on the current state and input.
-
We find the
$M$ nearest neighbors in$\mathcal{D}^{j-1}$ to obtain$\mathbf{z} = {z_1, ..., z_M}$ of$\bar{z}$ and their corresponding state evolutions$\mathbf{x}^+ = {x^+_1, ..., x^+_M}$ .- $\mathbf{x}^+ = {x^+_1, ..., x^+M}$ : For every $x^+{i}$, it is the state that came after the state inside the
$z_i$ . So an example is$z_1$ holds$(x_1, u_1)$ and the state that came after$x_1$ inside dataset$\mathcal{D}^{j-1}$ is$x^+_1$ .
- $\mathbf{x}^+ = {x^+_1, ..., x^+M}$ : For every $x^+{i}$, it is the state that came after the state inside the
-
We then use the state and input pairs in
$\mathbf{z}$ to predict the states that they would have using our current model to find$\hat{\mathbf{x}}^+ = {\hat{x}^+_1, ..., \hat{x}^+_M}$ .-
$\hat{\mathbf{x}}^+ = {\hat{x}^+_1, ..., \hat{x}^+_M}$ : To get$\hat{x}^+_i$ , we use our model function (1) to make the predictions using the state and input pair$z_i$ which could be replaced as$(x_i, u_i)$ .
-
-
So keep in mind that
$\mathbf{z}$ has the$M$ nearest neighbors to$\bar{z}$ that are state and input pairs from dataset$\mathcal{D}^{j-1}$ . Next,$\mathbf{x}^+$ holds the states that each$z$ in$\mathbf{z}$ progressed next unto in the previous iteration. Lastly,$\hat{\mathbf{x}}^+$ holds the predicted outputs using the state and input pairs$z$ found in$\mathbf{z}$ . -
Now we're mainly interested in learning only the error dynamics associated with the velocity components of the state
$x$ . -
We'll define the residual error of the velocity components as below:
where
Note
Confused on why
-
Let's breakdown each error dynamic line:
-
$v_{x, m}^+ - \hat{v}{x, m}^+$ : Using the collection $\mathbf{x}$, we can use a specific state evolution that was recorded in the previous iteration. Then using the collection $\hat{\mathbf{x}}$, we can obtain the corresponding prediction that we used the current model to attain. Now if we find the difference between the recorded state evolution and current state prediction, we can see the difference between parameters. In this case it's the difference of the $v{x, m}$. This expression is describing the residual error found between predictions of the previous and current model used in finding states when inputted state and input pairs.
-
$v_{y, m}^+ - \hat{v}{y, m}^+$ : Using the collection $\mathbf{x}$, we can use a specific state evolution that was recorded in the previous iteration. Then using the collection $\hat{\mathbf{x}}$, we can obtain the corresponding prediction that we used the current model to attain. Now if we find the difference between the recorded state evolution and current state prediction, we can see the difference between parameters. In this case it's the difference of the $v{y, m}$. This expression is describing the residual error found between predictions of the previous and current model used in finding states when inputted state and input pairs.
-
$\omega_{z, m}^+ - \hat{\omega}{z, m}^+$ : Using the collection $\mathbf{x}$, we can use a specific state evolution that was recorded in the previous iteration. Then using the collection $\hat{\mathbf{x}}$, we can obtain the corresponding prediction that we used the current model to attain. Now if we find the difference between the recorded state evolution and current state prediction, we can see the difference between parameters. In this case it's the difference of the $\omega{z, m}$. This expression is describing the residual error found between predictions of the previous and current model used in finding states when inputted state and input pairs.
-
-
Let's use those 3 equations and create 3 regression vectors:
$$ \Gamma_{v_x} = \begin{bmatrix} A^e[11:13] \ B^e[11] \ C^e[1] \end{bmatrix},
\Gamma_{v_y} = \begin{bmatrix} A^e[21:23] \ B^e[22] \ C^e[2] \end{bmatrix},
\Gamma_{\omega_z} = \begin{bmatrix} A^e[31:33] \ B^e[32] \ C^e[3] \end{bmatrix}. $$
Note
What are regression vectors? Regression vectors are often denoted as
- We're close to solving the regression problem but we have to define a function that will weigh data point
$m$ with greater importance than others. This is done using the Epanechnikov kernel function with bandwidth$h$ :
-
This function
$K$ of$u$ will take in a value$u$ and will see if its magnitude is smaller than$h$ . If it's smaller, then the function$K$ will output a number between$\frac{3}{4}$ and$0$ . If magnitude of$u$ is greater than$h$ , then the function will output$0$ . The reason why this helps out so much is that if you were to place the L2 norm between 2 data points in here, then we can weigh the importance of that point. The closer the data point$z_m$ is to$\bar{z}$ , the more important and relevant the data$z_m$ is which is why it should be weighed heavier than points that are far away from$\bar{z}$ . -
To combine everything we've learned so far, we define a weighted least squares problem with
$l = {v_x, v_y, \omega_z}$ :
where
- Think of
$(8)$ as a weighted ridge regression problem and rely on that knowledge to solve$\Gamma^\star_l$ .
Note
Why do we want a function to find the smallest
- Lastly we can construct the matrices
$A^e$ ,$B^e$ , and$C^e$ from$\Gamma^\star_l$ as follows:
$$ A^e = \begin{bmatrix} \Gamma^\star_{v_x}[1:3] \ \Gamma^\star_{v_y}[1:3] \ \Gamma^\star_{\omega_z}[1:3] & \mathbf{0}{6 \times 3} \ \mathbf{0}{3 \times 3} \end{bmatrix},
B^e = \begin{bmatrix} \Gamma^\star_{v_x}[4] & 0 \ 0 & \Gamma^\star_{v_y}[4] \ 0 & \Gamma^\star_{\omega_z}[4] \ \mathbf{0}_{3 \times 2} \end{bmatrix}, \
C^e = \begin{bmatrix} \Gamma^\star_{v_x}[5] & \Gamma^\star_{v_y}[5] & \Gamma^\star_{\omega_z}[5] & \mathbf{0}_{1 \times 3} \end{bmatrix}^\top. $$
- Remember equation
$(4c)$ ?
- We're going to make explain how to get $A(\overline{z}{k+t};\mathcal{D}^{j-1})$, $B(\overline{z}{k+t};\mathcal{D}^{j-1})$, and
$C(\overline{z}_{k+t};\mathcal{D}^{j-1})$ . - Each term is the system dynamics mapping of how each parameter affects the next state.
- $A(\overline{z}{k+t};\mathcal{D}^{j-1})$ term is a matrix that holds how each parameter in $x_t$ affects the state $x{t+1}$.
- $B(\overline{z}{k+t};\mathcal{D}^{j-1})$ term is a matrix that holds how each parameter in $u_t$ affects the state $x{t+1}$.
-
$C(\overline{z}_{k+t};\mathcal{D}^{j-1})$ term is a matrix that holds the true system dynamics of the environment, which is unaffected and unrelated to the current state$x_t$ and current input$u_t$ .
where
Note
Why does
$$\begin{align*}
f(\overline{x}, \overline{u}) &= A^f\overline{x} + B^f\overline{u} + C^f \
C^f &= f(\overline{x}, \overline{u}) - A^f\overline{x} - B^f\overline{u} \
&= (A^f\overline{x} + B^f\overline{u} + C^f) - A^f\overline{x} - B^f\overline{u} \
&= C^f + A^f\overline{x} - A^f\overline{x} + B^f\overline{u} - B^f\overline{u} \
&= C^f
\end{align*}$$