Path: blob/master/material/least_action_minimization.ipynb
934 views
Least Action with least squares minimization
Load modules
Geometry interpretation
Following the geometry theory developed here, we will try to define something called the Action for one small segment of the free fall movement in one-dimension.
For that we need the experimental data consisting on the height of an object of mass in free fall, and the height , for each time . We take the origin of the coordinates at ground level. For each segment we can calculate an average kinetic energy, , and an averge potential energy, , in the limit of small. From the figure
We can then reformulate the problem of the free fall in the following terms. From all the possible curves that can interpolate the points and , which is the correct one?.
The answer obtained by Leonhard Euler [1] can be obtained from the definition of the function "Lagrangian"
With this, we can build the "Action", by integrating the Lagrangian function between the points and as
which give us a numerical result with units of energy multiplied by time (Js). What is worth noticing is that if we relax the definition of and allows for any , but keeping the initial and final points fixed, we can calculate many Action values. This is illustrated in the figure for blue dotted (), solid () and dashed ()lines. But only the height, , associated with the real physical path, has a minimum value for the Action, !
In fact, for one segment of the action between , and , with sufficiently small such that can be considered constant, we have that corresponds to Eq. (11) of Am. J. Phys, Vol. 72(2004)478: http://www.eftaylor.com/pub/Symmetries&ConsLaws.pdf
Least Action method: The least action method consist in the following steps illustrated in the figure
Fix the initial and final point of the movement. Example the initial time and the height from which a body is launched upwards, , and the final time and height .
Divide the problem in small segments of .
Build many paths with the initial and final point fixed and calculates the Action in each segment, , for all the paths
Choose the minimal Action for each segment, , and rebuild the full path which minimizes the Action in each segment. This is the physical trajectory!
Code implementation
The Action
We define the Action such of an object of mass throw vertically upward from , such that seconds later the object return to a height , as where
We implement the code by using linear algebra abstractions. Consider the vector of positions in meters We can define the vector of initial (final) positions of components as such that, for example
Therefore:
Example: For the vector , implement the , as a linear algebra abstraction in Python
:
The clear advantage of the linear algebra abstractions is that we avoid the use of the very slow for
loops of Python. We can now define the Action by using this kind of abstractions in a very compact way
Function
Program
As code
In this way, for a non-physical trajectory, we have for example
Least Action calculation
Problem: Let an object of mass Kg throw vertically updward and returning back to the same hand after 3 s. Find the function of distance versus time of least Action.
If we denote the height at time as , we can calculate the action for any set of points with the inititial and final points fixed at m.
Example: By using the previous definition, calculates the Action for 21 steps in time from at s for an object that does not move at all
Solution:
Activity: Brute force approach
Open the Activity notebook in CoCalc!
calculates the Action for 21 steps in time from at s, for an object that at a random position in each time between zero and m, but with the initial and final positions set to zero. Make the plot for the random curve.
Let us divide the intervals in 21 parts:
Check again the Acion, , value for xmin
Find the set of interpolation Lagrange polinomial that a set a points as smooth as possible
Assign a time, to each point in xmin
Complete the set of interpolation Lagrange polynomials: Change pe
to the high value that allows for on smooth curve, and uncomment the next code and repeat as many times as required
Built a step function for the full range each of the interpolation Lagrangian polynomial in each range
Build a step function with
interpolate.interp1d
Fit the points with a polynomial of degree 2
Compare the Action for
xmin
, somex
obtained from the full range function obtained from the interpolation Lagrange polynomials, and somexP
obtained from the degree 2 polynomial
Which one is the one with the least action and why?
Minimization
Function to find the least Action by using scipy.optimize.fmin_powell
. It start from and find the least action
Plot
Check the equation of motion:
Dynamics of the least action solution
Velocity
Aceleration
Energy
Action
The Action is minimal in each interval!
References
[1] L. Euler, M´emoires de l'Acad´emie des Sciences de Berlin 4, 1898 (1748), republished in Ref.2, p. 38-63; L. Euler, M´emoires de l'Acad´emie des Sciences de Berlin 7, 169 (1751), republished in Ref. 2, p. 152. For a recent historical review see: Dias, Penha Maria Cardozo. (2017). Leonhard Euler's “principle of mechanics” (an essay on the foundations of the equations of motion). Revista Brasileira de Ensino de Física, 39(4), e4601. Epub May 22, 2017.https://doi.org/10.1590/1806-9126-rbef-2017-0057
[2] Leonhardi Euleri Opera Omnia, serie secunda, v. V, edited by J.O. Fleckenstein (Societatis Scientiarum Naturalium Helveticæ, Geneva,1957)