This is a simulation of a particle in a box with adjustable hardness
walls. The idea here is to think about the behavior of the the particle as
it enters the wall regions. The particle starts with starts with an
initial velocity. As it enters the wall regions, the model makes use of a
decelerating force, not unlike that of a rocket fired in order to
decelerate. Here, the decelerating force brings the particle to a stop, it
makes turn around, accelerates it, and brings it back to its original but
opposite velocity, thus concerving energy. This model is made possible by
solving Newton's law in differential form: d^{2}x(x)/dt^{2}
=F(x) with boundary conditions such that F(x)= {-a1 if x >= L, or a1 if x
<=0), where a1 is a constant and L is the size of the box. The model
conserves energy as can be seen, since its kinetic energy (E=(1/2)*m*v^{
2}) remains constant. This is easily seen also by noticing that the
particle's speed inside the box is constant as well. The equation is
solved by a Runge-Kutta solver using EJS.