mst_end not found for the last sample
The search in 3c_periodicLoop does not find a value for mst_end of the last sample. This happens probably if the last step in the sample is not the same as t_horizon because in that case mft_lastSteps is empty and "mst_end(mSolve, s, t)${sum(f_solve, mft_lastSteps(mSolve, f_solve, t))} = yes;" noes not work. Or maybe "t_active(t)" in the loop should be replaced by a set that also includes time steps after the last interval of the last sample.