In this segment, we'll talk more about how to find the coefficients of a minimum jerk trajectory. Recall that we can find the minimum jerk trajectory by solving the following minimization problem. By using the Euler-Lagrange equation, we find that a necessary condition for the minimum jerk trajectory is that its 6th derivative must be 0. This leads us to conclude that a minimum jerk trajectory takes the form of a 5th order polynomial, which has six unknown coefficients. Our goal is to find the values of these coefficients. To do this we define six boundary conditions. Let's write out each of these boundary conditions explicitly. The position of the trajectory is given by the function x(t). At time 0, this function evaluates to c0. According to the boundary condition, this must be equal to a. At time T this function evaluates to the following expression. According to the boundary condition, this must be equal to b. Note that in this expression, the constant T is exponentiated to various powers. However, because T is known, we can evaluate these exponentials explicitly and they become constants. The unknown coefficients are not exponentiated, therefore this expression is linear in terms of the coefficients. We can rewrite the position constraints at t = 0 in matrix form. Here, we see that we are multiplying a 1 x 6 matrix with a 6 x 1 matrix. Which will result in a 1 x 1 matrix, or simply, a constant. Further, if we carry out the matrix multiplication, c0 will multiplied by 1 and all the other coefficients will be multiplied by 0. Thus this matrix expression is equivalent to the constraint c0 = a. We can similarly represent the position constraint at time T in matrix form. Again, because T is known beforehand, the matrix on the left contains only constants. We see that the second matrix term on the left-hand side, which contains our unknown coefficients, is the same as a second matrix term of the left-hand side of the position constraint at t = 0. Next, we consider the velocity constraints. We can find the function for the structure's velocity by differentiating the position function x(t). The condition at t = = and t = T give us the following constraints. As before, we can write the constraints in matrix form. We can write the constraint at t = 0 in the following way. We can do the same for the constraint at t = T. Again, we see that the matrix contain the unknown coefficients remains the same in both of these constraints. Finally, we can repeat this process for the acceleration constraints. We can differentiate the velocity function to get the acceleration function. From this, we can write the conditions at t = 0 and T. We could then write these constraints in matrix form. As you probably expected, these expressions also contain the same matrix of unknown coefficients we saw earlier. Because all six constraints can be written as a 1 x 6 matrix multiplied by the same 6 x 1 matrix, we can combine them into a single matrix expression. Here, each row of the 6 x 6 matrix on the left-hand side, in conjunction with the corresponding row of the 6 x 1 matrix on the right-hand side, represents one of the boundary conditions. Again, because t, a, and b are known beforehand the only unknown variables up here in the matrix of coefficients. We can now use one of the many techniques to solve for this matrix of unknown coefficients. Let's consider an example. Here, T = 1, a = 0, and b = 5. We can substitute these values into the expression from the last slide to get the following matrix problem. If we denote the 6 x 6 matrix on the left-hand side as A, and the 6 x 1 matrix on the right-hand side as b, we have a problem in the form Ax equals b. Where x is the matrix of unknown coefficients. We can find x by inverting A and multiplying it by b. This will give us the following matrix for x, which contains the values of the unknown coefficients in the order that we designated. This means that the minimum jerk trajectory for this problem is x(t) = 30t to the 5th- 75 t to the 4th + 50t cubed. We can verify that this trajectory does, in fact, satisfy all boundary conditions. Evaluating the function x(t) at 0 and 1, gives us a value of 0 and 5 respectively, as we specified in the boundary conditions. We can differentiate x(t) to get the velocity function x dot of t. This function is 0 at both 0 and 1. Finally, we can differentiate once more to get the acceleration function. This function is also zero at both 0 and 1. It is important to notice that when transforming the condition expressions into matrix form, the order in which we place the unknown coefficients matters. We must be sure that all coefficients are matched up with the right constants. For example, in our example the matrix expression for the position constraint at t = T was this. If we reverse the order of the unknown coefficients in the second matrix term on the left-hand side, we must also reverse the order of the terms in the first matrix term. We can change the order of the unknown coefficients in the second matrix term however we want, as long as we make sure the corresponding coefficient in the first matrix term match up. When solving the complete problem it is important that we order the unknown coefficient in the second matrix term in the same manner for all constraints.