Monday 17 November 2014

lagrangian formalism - Least action principle — numerical simulation strangeness


I'm trying to get some experience with the least action principle, and for this I chose a simple 1-dimensional problem of a particle moving in some field. The least action principle would then look like:


$$\int_{t_1}^{t_2}(T(v)-U(x))dt=\min$$


So I discretize time into some points and try to minimize the sum:



$$\sum_{i=1}^n (T(v_i)-U(x_i))\Delta t.$$


But I get into some strange results: first, if I don't constrain the system, the sum appears unbounded from below. Well, it's understandable because there can be multiple solutions corresponding to different initial/boundary conditions. OK, I choose some values for $x_1$ and $x_n$ as constraints. But even the sum appears unbounded. Well, I then choose to reduce possible range of $x_i$, and the sum finally can be minimized...


But the result appears complete nonsense. Here's the result for $n=10$, $t_1=0$, $t_2=1$, $|x_i|<5$:


Positions


enter image description here


Velocities


enter image description here


Here velocities don't seem to reflect change in positions.


What am I missing here? Should I add some other constraints, or have I done some simple mistake?



Answer




As said in this answer, velocity and position are not varied independently. Indeed, when deriving Euler-Lagrange equations, we explicitly use the fact that $\delta v=\frac d{dt}\delta x$.


So, when I add the constraint $v_i=\frac{x_{i+1}-x_i}{\Delta t}$, specifying $x_1$ and $x_n$ remains the only additional thing to converge to the solution. For example, setting $U=x^4-4x^3+4.5x^2$, $x_1=0$, $x_n=2.651$ and $n=51$, I get:


Positions:


enter image description here


Velocities:


enter image description here


Here the last point of velocity is wrong, but it's an artifact of the constraint: I've used a right-hand finite difference derivative, which can't be done for $v_n$. This can be fixed by choosing some other difference scheme, but for the purposes of this answer it's an unimportant implementation detail.


What's more important, is that if we choose $x_n>2.651$ in this example, the action appears unbounded from below even with the correct constraints. I believe this is no longer a problem in the implementation, but rather a result from the fact that the action just has to be stationary, but not minimal, so minimization is not a good enough procedure to obtain a true trajectory.


No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...