Step() and ClearForces()

I encoutered the following code lines in a Box 2d Project.

box2DWorld.Step(TIME_STEP, VELOCITY_ITERATIONS, POSITION_ITERATIONS);
Manual => Take a time step. This performs collision detection, integration, and constraint solution.

box2DWorld.ClearForces();
Manual => Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps.

I was able to read the manual, and got some hints ( written above), but still not fully able to understand what Step function is used for. And why is it necessary to call ClearForces just afterwards ?

Help appreciated
V.
The Step function is really the update to all of the physics bodies for that frame/iteration. Forces and impulses (among many other things) are calculated when calling the Step function.

The ClearForces function is needed to clear all of the forces that were added before or during the Step function. If the ClearForces function is not called, whatever forces that were done in the last iteration will be carried over to the next iteration (and will continue to compound if ClearForces is never called).

The reason why this function is not called inside the Step function is due to the case where the Step function needs to be called twice before the ClearForces function is called. Most of the time, you only need to call the Step function once, but I have seen cases where Step function is called twice (with different values for the timestep, velocity iterations, and position iterations).

Original thread: https://box2d.org/forum/viewtopic.php?t=8984