Building a code for the solar system, discretized equations
The four coupled differential equations can then be discretized using Euler's method as (with step length h )
v_{x,i+1}=v_{x,i}-h\frac{4\pi^2}{r_i^3}x_i,
x_{i+1}=x_i+hv_{x,i},
v_{y,i+1}=v_{y,i}-h\frac{4\pi^2}{r_i^3}y_i,
y_{i+1}=y_i+hv_{y,i},