Skip to main content
Log in
Čeština ‎(cs)‎ English ‎(en)‎
Documentation
Čeština ‎(cs)‎ English ‎(en)‎

Optimal and Robust Control

BE3M35ORR + B3M35ORR + BE3M35ORC
  1. Home
  2. Courses
  3. BE3M35ORR, B3M35ORR, BE3M35ORC - B232
  4. 1 April - 7 April
  5. Homework problem assignment #7
This course is part of an already archived semester and is therefore read-only.

Homework problem assignment #7

Completion requirements
Opened: Wednesday, 3 April 2024, 8:58 PM
Due: Wednesday, 10 April 2024, 8:58 PM

Get a boat as far as possible

Find the optimal control policy getting a boat in a river stream as far as possible. The equations of motion of the boat in the river stream are

\(
\begin{array}{rl}
\dot{x} &= \cos\theta + y, \\
\dot{y} &= \sin\theta.
\end{array}
\)

The boat is at time \(t=0\) located on a river bank (i.e. \([x(0),y(0)]=[0,0]\)). The only way how you can influence the motion of the boat is via commanding the angle \(\theta\).  

Your goal is to get the boat as far possible along the x-axis during a fixed time interval [0,5].

Proceed as follows:

  1. Formulate the optimal control problem: design the final-time cost function \(\phi(\mathbf{x}(t_f), t_f)\) and the running cost function \(L(\mathbf{x}(t), \mathbf{u}(t), t)\). Both should be as simple as possble and yet they have to describe what you need to achieve. (Hint: you do not need both cost functions and a linear function will do.) 
  2. Formulate the Hamiltonian.
  3. Calculate the first-order necessary conditions.
  4. Express the optimal control input from the stationarity condition. In this particular case, the optimal control input should be a function of costates only.
  5. Formulate the Two-point Boundary Value Problem (TP-BVP). This time, the boundary conditions are given by the initial condition for the state and final-time condition for the costate (have a look at the cheatsheet).
  6. If you choose wisely the cost function, the differential costate equation can be solved analytically. Otherwise, you can use a numerical solver for the TP-BVP.
  7. Substitute the costates to the optimal control input and simulate the system response.

Implement your solution as a function with the header of the following form:

function [ t_star, x_star, u_star ] = hw7_cvutID()

where cvutID is your KOS username, t_star is the time vector of the trajectory, x_star is the state trajectory and u_star is the control trajectory. You are free to choose the sampling of the time interval [0, 5]; in other words, time samples in t_star can be arbitrarily spaced.

You can submit only one m-file. If you need more functions, you can use nested functions (for details, see this).

◄ M-files for the exercise - solution
Learning goals ►
ORR
Optimal and Robust Control
B232 B232 - Summer 23/24
B162 - Summer 16/17 B172 - Summer 17/18 B182 - Summer 18/19 B192 - Summer 19/20 B202 - Summer 20/21 B212 - Summer 21/22 B222 - Summer 22/23 B242 - Summer 24/25

Grades Teachers Participants
 Contact us  Reset user tour on this page
© 2025 Center for Knowledge Management
Useful links
Faculty website Calendar Study department FELSight Moodle API
Navigation
Log in
CTU logo