Heating during depletion

Hello! I try to get heating by height during depletion (heating for all burnup-step). But I don’t understand how to di this. I try to make it like this:
heating.py (13.5 KB)
But by this script I get wrong results. What problem it could be?
PS Difficult scheme of functions here for modeling extraction of displacers during depletion.

With regards