Update function computedensetrajectories.