  We present the results of a Monte Carlo simulation of the ground state and
magnetic relaxation of a model of a thin film consisting on a two-dimensional
square lattice of Heisenberg spins with perpendicular anisotropy K, exchange J
and long-range dipolar interactions g. We have studied the ground state
configurations of this system for a wide range of the interaction parameters
J/g, K/g by means of the simulated annealing procedure, showing that the model
is able to reproduce the different magnetic configurations found in real
samples. We have found the existence of a certain range of K/g, J/g values for
which in-plane and out-of-plane configurations are quasi-degenerated in energy.
We show that when a system in this region of parameters is perturbed by an
external force that is subsequently removed different kinds of ordering may be
induced depending on the followed procedure. In particular, simulations of
relaxations from saturation under an a.c. demagnetizing field or in zero field
are in qualitative agreement with recent experiments on epitaxial and granular
alloy thin films, which show a wide variety of magnetic patterns depending on
their magnetic history.
