Self-similar evolution of astrophysical and laboratory jets: expansion and collimation