Computational and analytical mathematical techniques for modeling heterogeneity