Processing math: 100%

 

 

 

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) vx,i+1=vx,ih4π2r3ixi, xi+1=xi+hvx,i, vy,i+1=vy,ih4π2r3iyi, yi+1=yi+hvy,i,