Why the speed changes
Gravity continuously pulls the planet toward the Sun. In an elliptical orbit, that pull converts gravitational potential energy into kinetic energy as the planet approaches the Sun, then converts it back as the planet recedes. Angular momentum is also conserved, producing equal swept areas in equal times.
The model uses Kepler’s equation to place the planet on the exact ellipse and advances time uniformly in mean anomaly.