# Optimal Trajectory, bounded end point

1. Sep 13, 2014

### Number2Pencil

1. The problem statement, all variables and given/known data

Find the optimal trajectory x*(t) that minimizes:

$$J = \int_{0}^{1} \left( \frac{\dot{x}(t)^2}{2} + 3x(t) \dot{x}(t) + 2x^2(t) + 4x(t) \right) dt$$

with x(0) = 1 and x(1) = 4

2. Relevant equations

Euler's equation:

$$\frac{\partial g}{\partial x} - \frac{d}{dt} \left[ \frac{\partial g}{\partial \dot{x}} \right] = 0$$
where g is the portion inside the integral.

3. The attempt at a solution

Implementing Euler's equation on g:

$$-\ddot{x}(t) + 4x(t) + 4 = 0$$

In which the question becomes, how do I solve this differential equation? In other classes, I would take the laplace transform, solve for X(s), and then do an inverse laplace transform. The problem is that I need to know the initial condition of x'(0) to do this, which I wasn't provided.

I looked at my notes from class, and in a similar example problem, my professor wound up with the following diff-eq:

$$\ddddot{x}(t) = 16x(t)$$

He said he took the laplace transform and wound up with:

$$s^4 - 16 = 0$$

But where did the X(s) go, and why didn't he use the initial conditions? His next step was to solve for s:

$$s = \pm 2, \pm j2$$

Then he did some kind of generic form of the answer:

$$x^*(t) = A_1 e^{2t} + A_2 e^{-2t} + A_3 e^{j2t} + A_4 e^{-j2t}$$

at this point, he created 4 simultaneous equations using the original problem's provided points to solve for A1,A2,A3, and A4. So when I try to do the same steps on my problem:

$$-\ddot{x}(t) + 4x(t) + 4 = 0$$

I take the laplace, ignoring initial conditions:

$$-s^2X(s) + 4X(s) + \frac{4}{s} = 0$$

But right here, can I really just "drop" the X(s) term and solve for s? Is that mathematically legal?
If I just solve for X(s) as I normally would and then do an inverse laplace, the answer does not satisfy the bounded points. ...and trying to do the laplace transform without the initial x'(0) point is confusing as well.

How do I solve this?

2. Sep 13, 2014

### Ray Vickson

Solve it symbolically, with an unknown parameter $a = x'(0)$. Then figure out what value of $a$ will give you $x(1) = 4$. Alternatively, solve the DE without specified boundary conditions; the solution will contain two unknown constants. Determine the two constants from the conditions $x(0)=1, x(1)= 4$.

Last edited: Sep 13, 2014
3. Sep 13, 2014

### Number2Pencil

Thanks Ray, I did get an satisfactory answer using the symbolic variable for x'(0), and then solving at the end for x(1) = 4.

You mentioned another way to just ignore initial conditions and I will end up with 2 constants that I need to solve for. This is what I originally tried, using the laplace/partial fraction method....but I did not end up with any constants (I basically got a solution where x(0) = 0 and x'(0) = 0). Care to describe this secondary method?

4. Sep 13, 2014

### Ray Vickson

First, let $x+1 = z$ and notice that the DE is $\ddot{z} - 4z = 0$. If you use Laplace transforms, you might as well use whatever initial conditions you are given, but if you use another method you get the type of problem I mentioned above. The characteristic equation for the DE is $r^2 - 4 = 0$, or $r = \pm 2$, so the solutions will be multiples of $e^{\pm 2 t}$. That is,
$$z(t) = c_1 e^{2t} + c_2 e^{-2t}$$
for some constants $c_1,c_2$. Use the boundary conditions on $z$ to find $c_1,c_2$.

Alternatively, you can use the fact that
$${\cal L}[\ddot{z}(t)](s) = s {\cal L}[\dot{z}(t)](s) - \dot{z}(0)\\ = - \dot{z}(0) + s [ s {\cal L}[z(t)](s) - z(0)] = s^2 \tilde{z}(s) - s z(0) - \dot{z(0)},$$
where
$$\tilde{z}(s) = {\cal L}[z(t)](s)$$
is the Laplace transform of $z$. This involves two constants $z(0), \: \dot{z(0)}$.

5. Sep 13, 2014

### Number2Pencil

Thanks Ray! Just so I'm clear, was the substitution of x+1=z because of that +4 offset that was impeding you from directly obtaining a characteristic polynomial equation? After finding a solution for z(t), I can just convert back to x knowing that x = z-1

6. Sep 13, 2014

Of course.