simplify symbolic expression with complex, square, sqrt. & Assume commutation in Matlab

조회 수: 9 (최근 30일)
Hi team
I find some symbolic expression can't be simplified by the simplified by matlab function.
Like this, the long symbolic expression (A ^2)^{1/2} is actually A squared then sqrt. When sqrt operates on the outside, it should return A.
But it didn't simplify this part.
Is it because of A*B \=B*A? Should we assume commutation between symbols?
How could we assume the commutation? Any example would help a lot! Thanks in advance.
Screen Shot 2019-05-13 at 10.47.35 PM.png

채택된 답변

Walter Roberson
Walter Roberson 2019년 5월 14일
(A ^2)^{1/2} Should not return A.
For real values it could return abs(A)
For complex values, A^2 might be a different branch. For example -2i squared is -4 and square root of that is 2i.
  댓글 수: 3
Walter Roberson
Walter Roberson 2019년 5월 14일
syms Areal real
syms Apositive positive
>> simplify(sqrt(Areal^2))
ans =
abs(Areal)
>> simplify(sqrt(Apositive^2))
ans =
Apositive
>> sqrt((-1-i)^2)
ans =
1 + 1i
>> syms Areal Aimag positive
>> simplify(sqrt((Areal+1i*Aimag)^2))
ans =
Areal + Aimag*1i
simplify() does what it can taking into account assumptions. If you had an assumption that A was positive then it would have resolved the sqrt.
Lingling Fan
Lingling Fan 2019년 5월 14일
Thank you for your answer.
So what would be the symbolic command for commutator of multiplication? Thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by