Direct and indirect methods based on effective Hamilton for electrocaloric effect of BaTiO3 nanoparticle