We present a hydrodynamical code based on the smoothed particle hydrod
ynamics (SPH) technique implemented in an AP3M code that is aimed at s
olving the hydrodynamical and gravitational equations in a cosmologica
l frame. We analyse the ability of the code to reproduce standard test
s and perform numerical simulations to study the formation of galaxies
in a typical region of a cold dark matter (CDM) model. These numerica
l simulations include gas and dark matter particles and take into acco
unt physical processes such as shock waves, radiative cooling and a si
mplified model of star formation. We analyse the astrophysical propert
ies of the galactic objects in different models.