An introduction to statistical physics