Play The purpose of this simple post is to bring to attention a view of physics which isn’t often communicated in introductory courses: the view of physics as optimization. This approach begins with a quantity called the action. If you minimize the action, you can obtain a path of least action which represents the path a physical system will take through space and time. Generally speaking, physicists use analytic tools to do this minimization. In this post, we are going to attempt something different and slightly crazy: minimizing the action with gradient descent. In this post. In order to communicate this technique as clearly and concretely as possible, we’re going to apply it to a simple toy problem: a free body in a gravitational field. Keep in mind, though, that it works just as well on larger and more complex systems such as an ideal gas – we will treat these sorts of systems in the paper and in future blog posts. Now, to put our approach in the proper context, we’re going to quickly review the standard approaches to this kind of problem. Standard approaches The analytical approach. Here you use algebra, calculus, and other mathematical tools to find a closed-form equation of motion for the system. It gives the state of the system as a function of time. For an object in free fall, the equation of motion would be: \[y(t)=-\frac{1}{2}gt^2+v_0t+y_0.\] def falling_object_analytical(x0, x1, dt, g=1, steps=100): v0 = (x1 - x0) / dt t = np.linspace(0, steps, steps+1) * dt x = -.5*g*t**2 + v0*t + x0 # the equation of motion return t, x x0, x1 = [0, 2] dt = 0.19 t_ana, x_ana = falling_object_analytical(x0, x1, dt) The numerical approach. Not all physics problems have an analytical solution. Some, like the double pendulum or the three-body problem, are deterministic but chaotic. In other words, their dynamics are predictable but we can’t know their state at some time in the future without simulating all the intervening states. These we can solve with numerical integratio...
First seen: 2025-04-29 23:25
Last seen: 2025-04-30 05:26