Thanks for hints so far, i am especially searching for a way to get rid of the t loop. Making a NxMxM Matrix is quite memory inefficient in my case (N > M). On way would be just use cython, but i think this problem common enough to have a solution into scipy. (Solution of a simple compartment model.) thanks, Till