Explain what the teacher did - system of ode, control theory.

78 Views Asked by At

There are a few things I'm not clear about in her solution and would appreciate a short explanation.

We are given the system $\dot{x}=-ax+bu$. with an initial value $x(0)=x_0$.

We want to find a controller $u$ such that $x(T)=10$ and the cost function $J(0)=\frac{1}{2}\int_{0}^{T}u^2(t)dt$ is minimal.

Her solution:

The Hamiltonian will be $H(x,u,\lambda)=\frac{u^2}{2}+\lambda (-ax+bu)$.

The derivatives will be $H_\lambda =-ax+bu=\dot{x}$, $H_x=-a\lambda=-\dot{\lambda}$ and $H_u=u+\lambda b$.

For our controller to be optimal, we need $H_u$ to be zero, so $u+\lambda b=0$, or $u = -\lambda b$.

Questions so far:

I get that we need $H_u=0$, but don't we need $H_x=H_\lambda =0 $ as well? and also, why did we decide that $\dot{\lambda} = a\lambda$? How can we know that? or is that just the definition of $\lambda$ in these questions.

Moving on...

since $u = -\lambda b$ and $-ax+bu=\dot{x}$, we know that $\dot{x} = -ax-b^2\lambda$. So overall we have $\dot{x}=-ax-b^2\lambda$ (I understand why) and $\dot{\lambda}=a\lambda$ (No idea why).

Solving $\dot{\lambda}=a\lambda$ yields $\lambda(t)=e^{-a(T-t)}\lambda (T)$ and so our equation for $\dot{x}$ is $\dot{x}=-ax-b^2e^{-a(T-t)}\lambda (T)$

So far so good

After laplace transform, we get $X(s)=\frac{x(0)}{s+a}-\frac{b^2}{a}\lambda (T) e^{-aT}(\frac{-0.5}{s+a}+\frac{0.5}{s-a})$, and with a reverse transform we get $x(t)=x(0)e^{-at}-\frac{b^2}{a}\lambda (T) e^{-aT}\sinh (at)$.

Now put $X(T)=10$ to find $\lambda$, and then calculate $u=-\lambda b$.

Questions so far:

I didn't completely understand how the laplace transform was calculated. I get a different result.

Would appreciate any help.

1

There are 1 best solutions below

0
On BEST ANSWER

Are you familiar with the Hamilton-Jacobi equations? In optimal control case they are

$$ \dot{x} = \frac{\partial H}{\partial \lambda}, \dot{\lambda} = -\frac{\partial H}{\partial x}, \frac{\partial H}{\partial u} = 0 $$

So, what is done is finding $x, \lambda, u$ functions that satisfy the above equations. That is where $\dot{\lambda} = a \lambda$ comes from.

For the Laplace Transform

$$\begin{align} \mathcal{L} \{ \dot{x} \} &= \mathcal{L} \{ -ax-b^2e^{-a(T-t)}\lambda (T) \} \\ s X(s) - x(0) &= -a X(s) -b^2 e^{-aT} \lambda (T) \mathcal{L} \{ e^{at} \} \\ (s+a) X(s) &= x(0) -b^2 e^{-aT} \lambda (T) \frac{1}{s - a} \\ X(s) &=\frac{x(0)}{s+a}-\frac{b^2}{a}\lambda (T) e^{-aT} \left(\frac{-0.5}{s+a}+\frac{0.5}{s-a} \right) \end{align}$$

because of the fact that

$$ \frac{a}{(s-a)(s+a)} = \frac{-0.5}{s+a}+\frac{0.5}{s-a} $$