How to solve matrix equation for variable inside a summation? Analytical or numerical.

6 次查看(过去 30 天)
Hello together
is there a chance to solve the following matrix equation for X?
where all Ai and D are known. X is of course constant over iteration, but unknown. All are 6x6 matrices.
I would be happy on any hint of any analytical, numerical, or what so ever solution.
Thank you!

采纳的回答

infinity
infinity 2019-7-19
Hello,
There are several ways that you can apply. Here, I just show you an example how to solve this problem by using solve function in matlab
clear
A = [1 2; 3 4]
syms x1 x2 x3 x4
X = [x1 x2; x3 x4]
B = A*X*A'
D = [1 0; -2 3]
sol = solve(B==D)
sol.x1
sol.x2
sol.x3
sol.x4
In this case, I assume that "n = 1", A, X, D are 4x4 matrices, but you can extend for 6x6 or larger and different n.
Hope it could help you.

更多回答(1 个)

Pablo Noever
Pablo Noever 2019-7-19
Hey,
thanks for the fast answer. Worked out for me!
I have transfered that to my problem just in case anyone looks for a similar solution:
n = 10;
A = rand(6,6,n);
% Reference Result
X_ref = rand(6);
RES_ref=zeros(6);
for i = 1:n
RES_ref = RES_ref + A(:,:,i) * X_ref * A(:,:,i)';
end
% Calculation
X_sym = sym('x%d%d', [6 6]);
RES_sym = zeros(6);
for i = 1:n
RES_sym = RES_sym + A(:,:,i) * X_sym * A(:,:,i)';
end
% Solution
S = solve(RES_sym == RES_ref);
% Result
X_sol = zeros(6);
for j = 1:6
for k = 1:6
X_sol(j,k) = double(S.(sprintf('x%d%d',j,k)));
end
end
% Should give zero
Check = sum(sum(X_sol - X_ref));
Cheers!
Pablo

类别

Help CenterFile Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by