Spectral Energy Distribution Modeling of Markarian 501 through a non-linear least square minimization