Simulation of Sun-Earth system in MATLAB