Solve equationsystem (A*V).'*B*(A*V)=C for matrix A
Show older comments
Hello all,
im asking me now a while how can i solve this equation system:
(A*V).'*B*(A*V)=C
where V, B and C are known.
V is a vector basis. B and C are symmetric square matrices. i want to find a matrix A which is initial simply a unity square matrix. The matrix A should be like a scaling matrix for a vector basis.
Is there a possibility to solve the equation system, maybe iterative, for the matrix A?
Maybe there are more than one solution. but tell me your guesses or ideas what is maybe possible (algorithms, ideas what ever).
i have to find the minimum: min((A*V).'*B*(A*V)-C=0).
Thanks in advance and i hope for some answers :)
best regards
Accepted Answer
More Answers (3)
Looks like it would just be,
A = sqrtm(B)\sqrtm(C)/V;
5 Comments
David Kriebel
on 8 Jan 2020
Matt J
on 8 Jan 2020
So, 4 equations and 100 unknowns?
David Kriebel
on 8 Jan 2020
David Kriebel
on 8 Jan 2020
for a first solution we could assume A is diagonal.
An iterative solution:
fun=@(a) objective(a,B,C,V);
a=lsqnonlin(fun, ones(length(B),1) );
A=diag(a);
function F=objective(a,B,C,V)
A=diag(a);
F=C-(A*V).'*B*(A*V);
end
8 Comments
David Kriebel
on 8 Jan 2020
Edited: David Kriebel
on 8 Jan 2020
David Kriebel
on 8 Jan 2020
Matt J
on 8 Jan 2020
That doesn't happen for me. Presumably, for your data ones(length(B))) is already almost optimal.
David Kriebel
on 8 Jan 2020
Edited: David Kriebel
on 8 Jan 2020
Matt J
on 8 Jan 2020
In the data you sent, B is not 10x10. It is 3330x3330.
David Kriebel
on 9 Jan 2020
With the modified code below, and after suitable normalization of your B,C,V data (note that this doesn't change the solutions A), I obtain a solution a that indeed is not very different from the initial guess, but it is different and measurably improves the error. As I told you, the initial guess of a=ones(N,1) was almost optimal to begin with.
First-Order Norm of
Iteration Func-count Residual optimality Lambda step
0 3331 0.000683151 0.37 0.01
1 6664 0.000681193 0.074 1 0.00211418
2 9999 0.000671141 0.0379 10000 2.57346e-05
C =
0.0042 0.0000
0.0000 227.3884
>> Error(a)
ans =
-0.0259 0.0000
0.0000 -0.0000
Modified code:
load matlab.mat
B=sparse(B/1e4);
C=C/1e14;
V=V/1e5;
Error=@(A) objective(A,B,C,V);
opts=optimoptions(@lsqnonlin,'MaxIterations',10);
a=lsqnonlin(Error, ones(length(B),1) ,[],[],opts );
function F=objective(a,B,C,V)
N=length(B);
A=spdiags(a(:),0,N,N);
F=C-(A*V).'*B*(A*V);
end
David Kriebel
on 9 Jan 2020
Edited: David Kriebel
on 9 Jan 2020
David Kriebel
on 9 Jan 2020
Edited: David Kriebel
on 9 Jan 2020
0 votes
Categories
Find more on Linear Algebra 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!