I've been trying to wrap my head around the principle of least action, and have come across a conceptual snag.
The classic example that is often given is of a mass's vertical position as a function of time, in a gravitational field. The parabola is the correct path, but other imaginary paths are shown on the same graph as a means of illustration.
The next idea is that action, S, is defined as the definite time integral, between two time points, of the kinetic energy, KE, minus the potential energy, PE, and that the path that is actually taken is the path that minimizes S.
Next, calculus of variations is used to find the path that minimizes S.
I am going to study calculus of variations so I can better follow the relevant ideas, but suppose you wanted to approximate a solution to this problem the hard way, and generate millions of arbitrary paths, and solve for S in each one.
My question is this:
How would you know what KE and PE of the system are, at each point in time?
Is the answer as simple as taking the time derivative of the path to calculate velocity (which will allow a calculation of KE), and obtaining PE using mgh?
But that doesn't seem reasonable, since conservation of energy can easily be violated here (for example, if one imaginary path had a bunch of minima at different heights, then the total energy would be different at each minima, since KE is 0 at these points, but PE is different.
More generally, given that these imaginary paths could not occur under the actual laws of physics, how do we know which laws apply when calculating the action at each point?