# Can the energy of a physical system be described as an unconstrained optimisation problem?

Sorry if this is something that is well known, not really familiar with modern physics beyond high school / introductory undergrad level. I largely work in deep learning and broadly speaking, you can think of training a deep neural network as an unconstrained optimization (minimization) problem on a loss function whose domain is the space of all parameters that need to be optimized. We now want to reach the global minimum of this loss function and that point in the domain is the model we use (very broad description).

Can I draw analogies of this to physical systems? I can think of all the independent variables of the system as the domain and the net energy of the system as the function we are optimizing over (analogous to the loss function). Since the system will try to go to its state of minimum energy (entropy has to increase and all that), can I figure out the final state of a physical system (and the path it takes), just by looking at its initial state and solving this unconstrained optimization problem? Is this common practice by any means, and if not is there any reason this does not work out or is inefficient?

If this is a valid way of going about it, then is there the problem of stopping at a local minimum? Even though in DL it's rare (statistically saddle points are far more common when you have a large number of independent variables) -- It would make sense that this is a real problem (lower num of independent variables I would imagine), since any change at a local minimum does increase the energy of the system, which is unnatural by thermodynamics. Is this a common issue that actually translates to physical systems?

PS: Apologies if this makes no sense, my idea of physics largely pertains to introductory undergrad physics. If this does make sense though and is actually common practice, would really appreciate links or lectures which tackle this idea.