Johan Karlsson, email: johan.karlsson@math.kth.se,

room 3550, Lindstedtsv 25, phone: 790 8440

**
Tutorial exercises:**

Michele Mascherpa,
micmas@kth.se,

room 3415,
Lindstedtsv 25.

**
Office hours:
**

Mondays 13.00-14.00 (4/9-23/10).

Room 3415, Lindstedtsvägen 25, or zoom: https://kth-se.zoom.us/j/67993457534. (Ask in the zoom to be let in.)

** Introduction **

Optimal control is the problem of
determining the control function for a dynamical system to minimize a
performance index. The subject has its roots in the calculus of
variations but it evolved to an independent branch of applied
mathematics and engineering in the 1950s. The rapid development of the
subject during this period was due to two factors. The first are two
key innovations, namely the maximum principle by L. S. Pontryagin and
the dynamic programming principle by R. Bellman. The second was the
space race and the introduction of the digital computer, which led to
the development of numerical algorithms for the solution of optimal
control problems. The field of optimal control is still very active
and it continues to find new applications in diverse areas such as
robotics, finance, economics, and biology.

** Course goals **

The goal of the course is to provide an understanding of the main
results in optimal control and how they are used in various
applications in engineering, economics, logistics, and biology. After
the course you should be able to

- describe how the dynamic programming principle works (DynP) and apply it to discrete optimal control problems over finite and infinite time horizons,
- use continuous time dynamic programming and the associated Hamilton-Jacobi-Bellman equation to solve linear quadratic control problems,
- use the Pontryagin Minimum Principle (PMP) to solve optimal control problems with control and state constraints,
- use Model Predictive Control (MPC) to solve optimal control problems with control and state constraints. You should also be able understand the difference between the explicit and implicit MPC control and explain their respective advantages,
- formulate optimal control problems on standard form from specifications on dynamics, constraints and control objective. You should also be able to explain how various control objectives affect the optimal performance,
- explain the principles behind the most standard algorithms for numerical solution of optimal control problems and use Matlab to solve fairly simple but realistic problems.

For the highest grade you should be able to integrate the tools you have learnt during the course and apply them to more complex problems. In particular you should be able to

- explain how PMP and DynP relates to each other and know their respective advantages and disadvantages. In particular, you should be able to describe the difference between feedback control versus open loop control and you should use be able to compare PMP and DynP with respect to computational complexity.
- explain the mathematical methods used to derive the results and combine them to derive the solution to variations of the problems studied in the course.

** Course material **

The required course material consists of the following lecture and
exercise notes on sale at Kårbokhandeln.
[Lecture notes],
[Exercise notes].

- Ulf Jönsson et. al.
*Optimal Control*, Lecture notes, KTH.

- Peter Ögren et. al.
*Exercise Notes on Optimal Control*, KTH. - Supplementary material will be handed out during the course.

** Prerequisites **

The student is required to have passed the course optimization SF1841/SF1811
or a course with similar content. The student should hence be familiar
with concepts and theory for optimization: linear, quadratic, and
nonlinear optimization; optimality conditions, lagrangian relaxation
and duality theory. Familiarity with systems theory and state space is
not required but recommended.

** Course requirements **

The course requirements consista of three mandatory homework sets and a final written
examination. The homework sets may also give you bonus credits in the examination.

** PhD course SF3852 **

It is possible to read this course as a PhD level course. For this, an
extra project and at least a B on the exam is required. Email the examiner to get details regarding the project.

** Homework sets **

Homework set 0: This homework set provides some review of systems theory and optimization as well as a Matlab exercise that use the toolbox CVX. I recommend that everyone does problem 2. Homework set 0 is optional and does not give bonus points to the exam, however, you can get feedback on your solutions if you hand it in before the deadline.

Each of the homework sets 1-3 are mandatory and consists of three-five problems.
The first two-three problems are methodology problems where you practice on the topics of the course and apply them to examples. Among the last two problems, one will focus on more theoretical nature and helps you to understand the mathematics behind the course. It can, for example, be to derive an extension of a result in the course or to provide an alternative proof of a result in the course. The other will focus on implementation and the student is required to make a Matlab program that solve a problem numerically.

You are required to get at least 10 points on each of the homeworks 1 and 3, and do the project in homework 2. Each successfully completed homework set handed in on time also gives you maximally 2 bonus points for the exam. The bonus is only valid during the year it is acquired. The exact requirements will be posted on each separate homework set. The homework sets will be posted on the homepage roughly two weeks before the deadline. The solutions to the homeworks should be uploaded on Canvas. Please prepare the solutions as a pdf in LaTeX or comparable software.

- Homework 0: This homework set covers some basic systems theory and optimization. (Due same day as excercise session E2). Here is the first homework set: [pdf].

- Dynamic programming (Tracking with B747). Matlab files [fRic.m,fSys.m,PtoX.m,XtoP.m,mainRic.m]
- Computational Algorithms (Shooting method for the orbit transfer problem). Matlab files [appr_dfdx.m,fh.m,main.m,newton_solver.m,plotresults.m,theta.m]

** Written exam **

You may use Beta Mathematics Handbook and the following formula sheet
(pdf) .
The exam will consist of five problems that give maximally 50
points. These problems will be similar to those in the homework
assignments and the tutorial exercises. The preliminary grade levels
are distributed according to the following rule, where the total score
is the sum of your exam score and maximally 6 bonus points from the
homework assignments (max credit is 56 points). These grade limits can
only be modified to your advantage.

Total credit (points) | Grade |
---|---|

45-56 | A |

39-44 | B |

33-38 | C |

28-32 | D |

25-27 | E |

24 | FX |

- You need to register for the exam.

** The grade FX **

If your total score (exam score + maximum 6 bonus points from the
homework assignments and the computational exercises) is 24
points then you are allowed to do an extra assignment.
The solutions should be handed in to the
examiner in written form and you must be able to defend your solutions
in an oral examination. Contact the examiner no later than three weeks
after the final exam if you want to do this.

** Course evaluation **

At the end of the course you will be asked to complete a course
evaluation form online.

**
**

**Preliminary schedule for 2023 **

Type | Date | Time | Room | Topic | Content (Preliminary) |
---|---|---|---|---|---|

L1 | 2023-08-28 | 10:15 | D41 | Introduction Discrete dynamic programming | Pages 17-23 |

L2 | 2023-08-29 | 10:15 | E51 | Discrete dynamic programming Discrete PMP | Pages 22-24 |

L3 | 2023-08-30 | 13:15 | D32 | Discrete dynamic programming Infinite time horizon | Pages 24-26 |

E1 | 2023-08-31 | 13:15 | E52 | Discrete dynamic programming Linear systems | |

L4 | 2023-09-04 | 10:15 | M33 | Model predictive control | Handout |

E2 | 2023-09-05 | 15:15 | E51 | Model predictive control | |

L5 | 2023-09-06 | 10:15 | Q22 | Dynamic programming | Pages 35-39 |

E3 | 2023-09-07 | 08:15 | E35 | Dynamic programming | |

L6 | 2023-09-11 | 10:15 | E35 | Dynamic programming and review | Pages 5-7, 39-44 |

L7 | 2023-09-12 | 15:15 | D34 | Mathematical preliminaries (ODE theory etc) | Pages 47-54 |

L8 | 2023-09-13 | 13:15 | M33 | Pontryagins minimum principle (PMP) (using small variations) | Pages 59-62 and a basic example |

E4 | 2023-09-15 | 13:15 | D34 | PMP I | |

L9 | 2023-09-18 | 10:15 | E51 | PMP (control constraints) | Examples on pages 62-63 and 74-75 |

L10 | 2023-09-19 | 13:15 | E51 | PMP (optimal control to a manifold) | Pages 71-81 |

L11 | 2023-09-22 | 10:15 | W37 | PMP
(generalizations) | Pages 81-88 |

E5 | 2023-09-25 | 10:15 | D41 | PMP II: Time optimal control | |

L12 | 2023-09-27 | 10:15 | Q17 | Numerical Methods | Pages 121-130 |

E6 | 2023-09-28 | 13:15 | Q26 | PMP III | |

L13 | 2023-10-02 | 10:15 | E52 | PMP applications | Pages 90-96 |

E7 | 2023-10-03 | 15:15 | E35 | PMP IV | |

L14 | 2023-10-05 | 13:15 | E35 | Computational methods Seminar (student presentation) | |

L15 | 2023-10-11 | 08:15 | E51 | Topics: Infinite time horizon optimal control | Pages 97-109 |

L16 | 2023-10-12 | 13:15 | E51 | Review | |

E8 | 2023-10-13 | 13:15 | D34 | Infinite time horizon optimal control and Review: old exams | |

Exam | 2023-10-25 | 08:00 | Exam | |

Some of last years exams can be found here:

2022

exam and solutions 20221027.

2021

exam and solutions 20211028.

2020

exam and solutions 20201022.

exam and solutions 20201216.

2019

exam and solutions

2018

exam and solutions

2017

exam and solutions

exam and solutions

2016

exam and solutions

exam and solutions

2015

exam and solutions