Help with calculus of variations question Chiang

36 Views Asked by At

I am trying to solve the following problem from Chiang's Fundamental Methods of Dynamic Optimisation: $$ V \left[y \right] = \int_{0}^{2} \left( 2ye^t + y^2 +y'^2\right) dt $$

with boundary conditions, $y(0) = 2$ and $y(2) = 2e^2+e^{-2}$

I can get to the general solution, but the definitive solution escapes me. The general solution (I think) is as follows:

Using Euler's equation $$ F_{y'y'} y''(t) + F_{yy'}y'(t)+F_{ty'}-F_y = 0 $$

We have

$$ 2y''(t) -(2e^t+2y) =0 \\ y''(t) =e^t+y $$

Integrating with respect to time twice gives the general solution

$$ y{*}(t) = e^t +\frac{1}{2}yt^2 +c_1t +c_2 $$

Solving for the constants $c1$ and $c2$ using the boundary conditions yeilds

$$ y(t=0) = e^{(0)} + \frac{1}{2}y(0)^2+c_1(0)+c_2 = 2 \\ c_2 = 2-1 - 0-0 \\ c_2 = 1 $$

And

$$ y(t=2) = e^{(2)} + \frac{1}{2}y(2)^2+c_1(2)+c_2 = 2e^2+e^{-2} \\ $$

Substituting $c_2 = 2$ $$ y(t=2) = e^{2} + 2y+2c_1+2 = 2e^2+e^{-2} \\ y(t=2) = 2c_1 = 2e^2-e^{2}+e^{-2}-2y-2 \\ y(t=2) = 2c_1 = e^2+e^{-2}-2y-2 \\ y(t=2) = c_1 = \frac{1}{2}(e^2+e^{-2})-y-1 \\ $$

Substituting these back into the general solution

$$ y^{*}(t) = e^t +\frac{1}{2}yt^2 +(\frac{1}{2}(e^2+e^{-2})-y-1)t +2 $$

Which I don't think is correct. The answer given in the solutions appendix is which I am miles away from and can't see how to get there

$$ y*(t) = e^t +e^{-t}+\frac{1}{2}te^t $$

2

There are 2 best solutions below

0
On BEST ANSWER

Your Lagrangian is $$L(t,y,y')= 2y{\rm e}^t + y^2 + (y')^2,$$so the Euler-Lagrange equation $$\frac{\partial L}{\partial y} -\frac{{\rm d}}{{\rm d}t}\frac{\partial L}{\partial y'}=0$$becomes $$2{\rm e}^t + 2y -2y''=0,$$which can be rearranged to $$y''-y = {\rm e}^t.$$The general solution is $$y(t)=A{\rm e}^t+B{\rm e}^{-t}+\frac{t{\rm e}^t}{2}.$$Since $y(0)=2$, we have $A+B=2$. And $y(2)=2{\rm e}^2+{\rm e}^{-2}$ becomes $$A{\rm e}^2 +B{\rm e}^{-2} +{\rm e}^2 =2{\rm e}^2+{\rm e}^{-2},$$so $A=B=1$ fits the bill. The solution you're looking for is $$y(t)={\rm e}^t+{\rm e}^{-t}+\frac{t{\rm e}^t}{2}=2\cosh t + \frac{t{\rm e}^t}{2}.$$

0
On

You want to express $y$ purely in terms of $t$ to substitute the boundary conditions. Since $y$ depends on $t$, you cannot integrate with respect time twice without finding an explicit expression for $y(t)$ first. So use the method of undetermined coefficients.

We have $$y''-y=e^t$$ which is a second order inhomogeneous differential equation. Trying a complementary function of the form $y=e^{kt}$, we obtain the auxiliary equation $k^2=1$ and the roots $k=\pm 1$. Thus the complementary function is $y_{c}(x)=Ae^{t}+Be^{-t}.$ Then for the particular solution we try $y_{p}(x)=cte^{t}$ and substituting gives $c=\frac{1}{2}$.

Thus the general solution is $$y(t)=y_{c}(x)+y_p(x)=Ae^{t}+Be^{-t}+\frac{1}{2}te^t.$$

Now substitute the boundary conditions to find $A$ and $B$.