I have a matrix which is 6x6 and a vector 6x1. I calculate C1 = expm(Aoff*Tau); and C2 = -pinv(Aoff)*B;
Please have a look at the structure of my matrix and vector:
Aoff = [[-r_2s k_ws (Del-Del_s) 0 0 0];...
[k_sw -r_2w 0 (Del) 0 0];...
[-(Del-Del_s) 0 -r_2s k_ws Om1 0];...
[0 -(Del) k_sw -r_2w 0 Om1];...
[0 0 -Om1 0 -r_1s k_ws];...
[0 0 0 -Om1 k_sw -r_1w]];
B = [0, 0, 0, 0, M_s0/T_1s, M_w0/T_1w]';
As you can see, Aoff is a function of Del which appears four time @(1,3), (2,4), (3,1), (4,2). I usually calculate C1 and C2 for a series of Del with close points.
DelVec = (-7:0.25:7)* 773.7; %Convert from ppm
Del_s = 2.0*773.7; %Convert from ppm
I am wondering if there is a way to calculate C1 and C2 faster for series. For instance I think of doing something like this for C1:
C1 = expm(Aoff*Tau) = expm((A0+Del_A0)*Tau) = expm(A0*Tau)+ expm(Del_A0*Tau)
where A0 = Aoff with term involving Del removed
and Del_A0 = Aoff with only term involving Del; other terms removed
I believe that I have to calculate expm(A0*Tau) only once and calculation of expm(Del_A0*Tau) will be cheap. Am I right?
Can I also do similar trick with C2?
In future, the matrix Aoff would become much bigger as I incorporate multivoxel data. So, faster calculation is a must.
Any guidance will be appreciated.