Fast solution of quadratic matrix equation

12 views (last 30 days)
Hi everyone,
I have a quadratic matrix equation of the form XCX+X+D=0. Currently I am solving it using the code kindly provided at https://www.mathworks.com/matlabcentral/fileexchange/26956-solve-bilateral-matrix-quadratic-equation . Since I have to perform this operation repetitively, my code (which involves multiple calls to this function) takes around an hour to run. I'm running a parallel pool but I'm limited by the number of cores.
I was wondering if there is any faster way of solving the equation?
Thanks
  5 Comments
Jan
Jan on 30 Dec 2017
@Umer: Can you provide a working version with some test input? I tried it with sylvester, but it did not converge.
Umer Abdullah
Umer Abdullah on 31 Dec 2017
@Jan Thanks for the help in this. I'm attaching the code, a sample input set is as follows
Amat=[0.0100,0;0,0.0100];
Bmat=[0,0;0,0];
Cmat=[0.0312,0.0129;0.0129,0.0054];
Dmat=[-0.0015,-0.0036;0.0036,-0.0090];
result=Solve_BQMEv4(Amat,Bmat,Cmat,Dmat);

Sign in to comment.

Accepted Answer

David Goodmanson
David Goodmanson on 30 Dec 2017
Hi Umer,
If matrix C is well behaved enough, meaning not too large a condition number, then the following might work
[v lambda] = eig(D*C,'vector');
r = (-1 + sqrt(1-4*lambda))/2;
x = (v*diag(r))/(C*v);
For 5 million calls, all 50x50, this would take about 4 hours on my pc, but I only have the one processor.
For an NxN matrix there are lots of solutions, since for the + sign in front of the sqrt you have an independent choice of +- for each element of lambda, so 2^N in all.
  1 Comment
Umer Abdullah
Umer Abdullah on 31 Dec 2017
Hi David,
Thanks a lot for this. Indeed a closed form solution seems more elegant.

Sign in to comment.

More Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!