Dynamics of dark energy in collapsing halo of dark matter