MATLAB Answers

Help: Faster way to calculate inverse for series of slightly different matrices.

1 view (last 30 days)
Dushyant on 3 Oct 2013
Edited: Dushyant on 3 Oct 2013
I have a matrix which is 6x6 and a vector 6x1. I calculate C2 = -(A^-1)*B;
Please have a look at the structure of my matrix and vector:
A = [[-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, “A” 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 C2 faster for series Del = DelVec(i). In future, the size of matrix A would be become large, as I would start processing multiple voxel at one go.
Since the solution for two successive values of Del, say DelVec(10) and DelVec(11), would not be too different, I would like to use previous solution as a first guess for next value of “Del”.
I tried using "Conjugate gradients squared method": cgs; but, it's 5-10 times slower than if I calculate C2 = -pinv(A)*B; directly
Regards, DK


Sign in to comment.

Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!