%% LyX 2.3.7 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=3cm,rmargin=3cm}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{graphicx}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
\theoremstyle{definition}
\newtheorem{xca}[thm]{\protect\exercisename}

\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{babel}

\usepackage{color}
\usepackage{xcolor}
\usepackage[normalem]{ulem}
\usepackage{amsfonts}

\makeatother

\usepackage{babel}
\providecommand{\exercisename}{Exercise}
\providecommand{\theoremname}{Theorem}

\begin{document}
\title{Exercise for Optimal control -- Week 5}
\author{Choose \textbf{one }problem to solve.}
\maketitle
\begin{xca}
Use tent method to derive the KKT condition (google it if you don't
know) for the nonlinear optimization problem:
\[
\min f(x)
\]
subject to
\begin{align*}
g_{i}(x) & \le0,\quad i=1,\cdots,m\\
h_{j}(x) & =0,\quad j=1,\cdots,l
\end{align*}
where $f$, $g_{i}$, $h_{j}$ are continuously differentiable real-valued
functions on $\mathbb{R}^{n}$. 
\end{xca}

\begin{xca}
Find a variation of inputs $u_{\epsilon}$ near $u_{*}$ that generate
the deviation vectors of the form $\sum_{i=1}^{q}k_{i}v_{i}(t_{f})$
for $k_{i}\ge0$\emph{, }where $v_{i}(t_{f})$ is generated by 
\[
u_{i,\epsilon}(t)=\begin{cases}
w_{i}, & t\in(\tau_{i}-\epsilon,\tau_{i}]\\
u_{*}(t), & \text{otherwise}
\end{cases}
\]
See lecture note.\emph{ Hint}: consider the combined needle variation
\[
u_{\varepsilon}(t)=\left\{ \begin{array}{ll}
w_{i}, & t\in(\tau_{i}-k_{i}\varepsilon,\tau_{i}]\text{ for some }i\in\{1,\cdots,q\}\\
u_{\ast}(t), & \text{otherwise}
\end{array}\right..
\]
Then find $x_{\epsilon}(t_{f})$ and $\frac{\partial x_{\epsilon}(t_{f})}{\partial t}|_{\epsilon=0+}$.
Start with $q=2$. 
\end{xca}

\begin{xca}
Consider driving a cart (a unicycle, or Dubins car) on the plane 
\begin{align*}
\dot{x} & =v\cos\theta\\
\dot{y} & =v\sin\theta\\
\dot{\theta} & =\omega
\end{align*}
where $(x,y)$ represents the position of the cart and $\theta$ the
heading angle, the driving speed is a constant $v>0$, see Figure
\ref{fig:A-unicycle.}. There is only one control: the turning rate
$\omega$, which is bounded by
\[
|\omega|\le\frac{v}{R}
\]
for some positive constant $R$. Study the time optimal control problem
of driving the cart from initial position at 
\[
(x(0),y(0),\theta(0))^{\top}=(0,0,0)^{\top}
\]
to
\[
(x(t_{f}),y(t_{f}),\theta(t_{f}))^{\top}=(x_{f},y_{f},\theta_{f})^{\top}\in\mathbb{R}^{3}
\]
What are the possible types of trajectories joining the initial and
terminal states? \emph{Note 1: there may exist singular arcs! Check
lecture note 4. Note 2: there may exist several solutions to the maximum
principle. }

\begin{figure}[h]
\begin{centering}
\includegraphics[scale=0.7]{dubinsex-cropped}
\par\end{centering}
\caption{A unicycle.\label{fig:A-unicycle.}}

\end{figure}
\end{xca}


\end{document}
