Mathematica based Macrosimulation