0
$\begingroup$

I'm new to computer science, but I've studied physics for a while. I'm just curious, if one wanted to make a simulation of the law of conservation of energy, on a large scale, how would it be done? Most simulations take shortcuts for objects off screen, or may even skip them entirely during iterations. The objects may be frozen in place of screen, or grouped together if not interacting. Can these tricks be applied when simulating conservation of energy, without violating the law? Thanks.

$\endgroup$
2
  • 1
    $\begingroup$ I'm not sure what you mean by "a simulation of the law of conservation of energy". Energy is conserved in physical processes, and we can simulate those processes. But how would you simulate the law in the abstract? That seems like asking how one would simulate height, for example. If I tell you that I want to simulate height, the first thing you'll ask is "Height of what?" $\endgroup$ Commented Jul 18, 2019 at 17:17
  • $\begingroup$ @David Richervy I'm talking more so about a large simulation, like of a star system. Not all objects would be in view at once, some simulations freeze objects in place once out of view. Would these type of computer power saving tricks work in a simulation that needs energy to be conserved? $\endgroup$ Commented Jul 18, 2019 at 19:31

1 Answer 1

1
$\begingroup$

I'm having a lot of trouble understanding the question as posed, but I think it's worth making a few general comments about conservation laws and how they are used in physical simulation.

Conservation laws happen because of Noether's theorem. When you are investigating how some physical system evolves over time, it's usually the case that the exact moment when $t=0$ is an arbitrary choice; you could start it 10 seconds later and the system would evolve the same. This is known as time translation symmetry. Any physical system which is time translation invariant is a system where energy is conserved.

Let's take as an example the problem of simulating a gas, where viscosity can be ignored, in one dimension.

We denote $\rho(x,t)$ as the density of the gas at a time and place, $v(x,t)$ is the velocity, $E(x,t)$ is the energy, and $p(x,t)$ is the pressure.

Then the equations we are solving are the Euler equations:

$$\frac{\partial}{\partial t} \rho + \frac{\partial}{\partial x} \rho v = 0$$ $$\frac{\partial}{\partial t} \rho v + \frac{\partial}{\partial x} \left( \rho v^2 + p \right) = 0$$ $$\frac{\partial}{\partial t} E + \frac{\partial}{\partial x} v\left(E + p\right) = 0$$

The pressure is defined in terms of the other variables, called the "equation of state". If we assume an ideal gas, $E = \frac{p}{\gamma - 1} + \frac{1}{2} \rho v^2$ where $\gamma$ is the heat capacity ratio, which is different for different gases.

The Euler equations are, respectively, conservation of mass, conservation of momentum (note that $\rho v$ is momentum), and conservation of energy. The equations state that a local change of (say) energy in time is balanced exactly by a change in space. So those three conservation laws are, in a deep sense, exactly the system that you are trying to simulate.

So I think that it's misleading to think of conservation of energy as something to exploit in simulating some physical system. Conservation of energy is a central part of the system that you're trying to simulate.

One last thing: Physical simulation, especially of thermodynamic systems, suffers from a phenomenon known as "numerical dissipation" or "numerical dispersion". The fact that you are using discrete time steps to simulate a continuous system means that something has to give, and depending on the numerical methods that you are using, this sometimes translates as unwanted diffusion of some quantity that should be locally conserved. Like energy.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.