Would anybody be able to share a Mathematica/Matlab/other script for calculating Onsager's exact solution for the magnetisation of the 2d Ising model?  I would be most grateful of one in order to test my MC simulations of the system.