Analysis of galaxy formation with hydrodynamics