Numerical modeling of cosmic rays in the heliosphere: Analysis of proton data from AMS-02 and PAMELA