An analysis of perpendicular magnetic recording by a newly developed 2D-FEM combined with medium magnetization model