Dynamics of the galactic system in the vicinity of the Sun