Optical spectroscopy and density functional calculations of chromium(V) doped in YVO4 and YPO4: influence of the second coordination sphere