Using N-body/hydrodynamical simulations which include prescriptions for sta
r formation, feed-back and chemical evolution, we explore the interaction b
etween baryons and dark matter (DM) at a galactic scale. The N-body simulat
ions we performed using a Tree-SPH code that follows the evolution of indiv
idual DM halos inside which stars form from cooling gas, and evolve, delive
ring in the interstellar medium (LSM) mass, both metals and energy. We exam
ine the formation and evolution of a giant and a dwarf elliptical galaxy of
total masses 10(12)M. and 10(9)M., respectively. Starting from an initial
density profile like the universal Navarro et al. (1996) profile in the inn
er region, baryons sink towards the center due to cooling energy losses. At
the end of the collapse, the innermost part (similar or equal to 1/20 of t
he halo size) of the galaxy is baryon-dominated, whereas the outer regions
are DM dominated. The star formation proceeds at a much faster speed in the
giant galaxy where a spheroid of 8 x 10(10)M. is formed in 2 Gyr, with res
pect to the dwarf galaxy where the spheroid of 2 x 10(7)M. is formed in 4 G
yr. For the two objects the final distributions of stars are well fitted by
a Hernquist profile with effective radii of r(e) = 30 kpc and 2.8 kpc, res
pectively. The dark-to-luminous transition radius r(IBD) occurs roughly at
1 r(e), as in real ellipticals. The DM halo density evolution is non-adiaba
tic and does not lead to a core radius.