필터 지우기
필터 지우기

Can the Symbolic Math Toolbox Be Used to Prove Matrix Identities?

조회 수: 2 (최근 30일)
Paul
Paul 2023년 9월 30일
댓글: Walter Roberson 2023년 10월 1일
With the following defintions
syms s
A = symmatrix('A',3);
B = symmatrix('B',[3 1]);
C = symmatrix('C',[1 3]);
L = symmatrix('L',[3 1]);
I = sym(eye(3));
LHS = inv(s*I - A + L*C)*B + inv(s*I - A + L*C)*L*C*inv(s*I - A)*B;
RHS = inv(s*I - A)*B;
I'd like to prove the following identity
ident = LHS == RHS
ident = 
Is there any other way to have the software verify that ident is always true besides subbing in symbolic values for the matrix elements?
isAlways(symmatrix2sym(ident))
ans = 3×1 logical array
1 1 1

채택된 답변

Walter Roberson
Walter Roberson 2023년 9월 30일
No.
  댓글 수: 5
Walter Roberson
Walter Roberson 2023년 10월 1일
Although children does not appear to be defined for symmatrix you can work around that using internal calls that are deliberately no longer documented.
syms s
A = symmatrix('A',3);
B = symmatrix('B',[3 1]);
C = symmatrix('C',[1 3]);
L = symmatrix('L',[3 1]);
I = sym(eye(3));
LHS = inv(s*I - A + L*C)*B + inv(s*I - A + L*C)*L*C*inv(s*I - A)*B;
RHS = inv(s*I - A)*B;
ident = LHS == RHS
ident = 
feval(symengine, 'op', LHS, 0)
ans = 
feval(symengine, 'op', LHS).'
ans = 
feval(symengine, 'op', RHS, 0)
ans = 
feval(symengine, 'op', RHS).'
ans = 
whos
Name Size Bytes Class Attributes A 3x3 8 symmatrix B 3x1 8 symmatrix C 1x3 8 symmatrix I 3x3 8 sym L 3x1 8 symmatrix LHS 3x1 8 symmatrix RHS 3x1 8 symmatrix ans 2x1 8 sym cmdout 1x33 66 char ident 3x1 8 symmatrix s 1x1 8 sym
Walter Roberson
Walter Roberson 2023년 10월 1일
syms s
A = symmatrix('A',3);
B = symmatrix('B',[3 1]);
C = symmatrix('C',[1 3]);
L = symmatrix('L',[3 1]);
I = sym(eye(3));
LHS = inv(s*I - A + L*C)*B + inv(s*I - A + L*C)*L*C*inv(s*I - A)*B;
RHS = inv(s*I - A)*B;
ident = LHS == RHS
ident = 
feval(symengine, 'coerce', ident, 'DOM_STRING')
ans = 
"Dom::SymbolicMatrix("L", 3, 1)*Dom::SymbolicMatrix("C", 1, 3) + Dom::SymbolicMatrix("s", 1, 1)*Dom::SymbolicMatrix::eye(3) - Dom::SymbolicMatrix("A", 3, 3)^-1*Dom::SymbolicMatrix("L", 3, 1)*Dom::SymbolicMatrix("C", 1, 3)*Dom::SymbolicMatrix("s", 1, 1)*Dom::SymbolicMatrix::eye(3) - Dom::SymbolicMatrix("A", 3, 3)^-1*Dom::SymbolicMatrix("B", 3, 1) + Dom::SymbolicMatrix("L", 3, 1)*Dom::SymbolicMatrix("C", 1, 3) + Dom::SymbolicMatrix("s", 1, 1)*Dom::SymbolicMatrix::eye(3) - Dom::SymbolicMatrix("A", 3, 3)^-1*Dom::SymbolicMatrix("B", 3, 1) == Dom::SymbolicMatrix("s", 1, 1)*Dom::SymbolicMatrix::eye(3) - Dom::SymbolicMatrix("A", 3, 3)^-1*Dom::SymbolicMatrix("B", 3, 1)"

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Conversion Between Symbolic and Numeric에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by