Code for Master thesis 'Competitive sorption to functional nanoparticles"