Follow-up Comment #18, task #7793 (project relax): It remains still to figure out how to speed up the numerical models: The problem is how to make a 3 dimensional array, which is a list which contains matrices. Each matrix is multiplied with for example a constant tcp. ############ # Loop over the time points, back calculating the R2eff values. for i in range(num_points): # This matrix is a propagator that will evolve the magnetization with the matrix R for a delay tcp. eR_tcp = matrix_exponential(R*tcp[i]) # This is the propagator for an element of [delay tcp; 180 deg pulse; 2 times delay tcp; 180 deg pulse; delay tau], i.e. for 2 times tau-180-tau. prop_2 = dot(dot(eR_tcp, matrix_exponential(cR2*tcp[i])), eR_tcp) # Now create the total propagator that will evolve the magnetization under the CPMG train, i.e. it applies the above tau-180-tau-tau-180-tau so many times as required for the CPMG frequency under consideration. prop_total = square_matrix_power(prop_2, power[i]) # Now we apply the above propagator to the initial magnetization vector - resulting in the magnetization that remains after the full CPMG pulse train. It is called M of t (t is the time after the CPMG train). Moft = dot(prop_total, M0) ########## _______________________________________________________ Reply to this item at: <http://gna.org/task/?7793> _______________________________________________ Message sent via/by Gna! http://gna.org/