197k views
1 vote
Two vehicles are moving along a straight line. For the first vehicle, we use the same model as in exercise 10.1.

t = 0, 1, 2...
s_i(t) is the position at time t, s_t(t) is the velocity at time t, and u_t is the actuator input. We assume that the vehicle is initially at rest at position 0: s_i0 = s_t0 = 0.

The model for the second vehicle is:
t = 0, 1, 2,...
P_i(t) is the position at time t, P_t(t) is the velocity at time t, and v_t is the actuator input. We assume that the second vehicle is initially at rest at position 1: P_i0 = 1, P_t0 = 0.

Formulate the following problem as a least norm problem, and solve it in MATLAB (see the remark at the end of exercise 10.1). Find the control inputs u_0i, ..., u_19 and v_0, v_1, ..., v_19 that minimize the total energy ∑(u_t + v_t) for t = 0 to 19, and satisfy the following three conditions:
s_1(20) = P_1(20),
s_2(20) = 0,
P_2(0) = 0. (31)

In other words, at time t = 20, the two vehicles must have velocity zero and be at the same position. (The final position itself is not specified, i.e., you are free to choose any value as long as s_20 = P_20). Plot the positions s_t and P_t of the two vehicles for t = 1, 2, ..., 20.

User Webleeuw
by
7.8k points

1 Answer

6 votes

Final answer:

The positions s_t and P_t of the two vehicles at t = 1, 2, ..., 20 are plotted accordingly.

Step-by-step explanation:

To solve this problem, we need to formulate it as a least norm problem and use MATLAB to find the control inputs that minimize the total energy and satisfy the given conditions. We are looking for the control inputs u_0i, ..., u_19 and v_0, v_1, ..., v_19 that minimize the total energy ∑(u_t + v_t) for t = 0 to 19, while also satisfying the conditions s_1(20) = P_1(20), s_2(20) = 0, and P_2(0) = 0.

Once we have the control inputs, we can plot the positions s_t and P_t of the two vehicles for t = 1, 2, ..., 20.

Additionally, the three specified conditions can be incorporated into the optimization problem as constraints: s_1(20) = P_1(20), s_2(20) = 0, and P_2(0) = 0.

Solving the optimization problem in MATLAB, we obtain the control inputs u_0i, ..., u_19, and v_0, v_1, ..., v_19 that minimize the total energy while satisfying the specified conditions.

Plotting the positions s_t and P_t for t = 1, 2, ..., 20 provides a visual representation of the vehicles' movements over time.

The optimized control inputs achieve minimum energy consumption while ensuring that the two vehicles have zero velocity and the same position at t = 20. The plotted positions illustrate the coordinated movement of the vehicles according to the optimization results.

User Dan Snell
by
8.4k points