Calculating temperature distributions for gradient coils