complex conjugate problem, already assumed real

3 ビュー (過去 30 日間)
Dan Zhu
Dan Zhu 2020 年 11 月 6 日
コメント済み: Raunak Gupta 2020 年 12 月 15 日
I'm using the latest 2020b build of MATLAB. Here's part of my code:
syms nu theta H(r,theta)
assume([nu theta H(r,theta)], 'real')
simplify(sin(theta)'-sin(theta)) %This is 0.
simplify(diff(H(r,theta),theta)'-diff(H(r,theta),theta)) %This is not.
simplify(kroneckerDelta(nu)'-kroneckerDelta(nu)) %This is also not.
How to solve this?

回答 (1 件)

Raunak Gupta
Raunak Gupta 2020 年 11 月 9 日
Hi,
From the documentation of MATLAB Operators and Special Characters you can see that is used for complex conjugate transpose whereas . is used for transpose of a matrix. Since the first expression which gave zero is always real so both operators will behave same. In the other two expressions it may give complex number as output (based on the definition of nu and H(r , theta)). So, both operators are different in that case and thus you are not getting zero. If you replace the bottom two expression with the following it will give 0 as answer.
simplify(diff(H(r,theta),theta).'-diff(H(r,theta),theta))
simplify(kroneckerDelta(nu).'-kroneckerDelta(nu))
  2 件のコメント
Dan Zhu
Dan Zhu 2020 年 12 月 14 日
That doesn't solve the problem, in my original code, there are other parts that are still complex in nature. I need to use complex conjugate, but I need those elements I've already assumed real to perform normally under the ' complex conjugate operator.
Raunak Gupta
Raunak Gupta 2020 年 12 月 15 日
Hi,
For the real numbers, complex conjugate will return the same output as simple transpose. Since here you have both real and complex numbers in H(r,theta) the difference between both terms will not be an all zero matrix. For real numbers, matrix entries will be zero and for complex number it will be purely imaginary. Also make sure if diff(H(r,theta)) is a 2-D matrix it is symmetric or conjugate symmetric for the output to be zero.
Hope this clarifies!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSpecial Functions についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by