Arranging of variable submatrices into main matrix results in forming cos(conj(theta))

1 回表示 (過去 30 日間)
In my script, i formed matrices G_ss, G_sr, Grs, Grr(all are 3*3) in terms of theta.
i am doing differentiation operation w.r.t theta for all matrices then i am getting Gd_ss, Gd_sr, Gd_rs, Gd_rr matrices after differentiation.
Finally i am forming single matrix G = [Gd_ss Gd_sr; Gd_rs Gd_rr]
I have to get G matrix interms of theta. But in the result it is showing cos(conj(theta)), sin(conj(theta))......etc, terms instead of cos(theta), sin(theta).
Where it went wrong i dont know.
Even after differentiation operation, Gd_ss, Gd_sr, Gd_rs, Gd_rr matrices are in theta only not like conj(theta).
After forming G only it is showing conj(theta). How to rectify this??

採用された回答

Walter Roberson
Walter Roberson 2021 年 9 月 8 日
Somewhere in your calculation, you have the ' (conjegate transpose) operator instead of the .' (non-conjugate transpose) operator.
If you are doing linear algebra, expecially with some kinds of physics, it is not uncommon that using ' (conjugate transpose) operator is mathematically correct. For example, you might have
W'*X*W
and if so then mathematically the conjugate transpose is typically the appropriate operator there.
Now, if you happen to be working with a system in which you are certain that none of the values can be complex-valued, then you can avoid the difficulty of seeing conj() by telling MATLAB that your symbolic variables are real-valued, such as
syms theta real
I recommend that you routinely tell MATLAB that symbolc variables are real-valued if you know that to be true: when MATLAB can reason that a value is surely real-valued then it will remove the conj()
  3 件のコメント
Walter Roberson
Walter Roberson 2021 年 9 月 8 日
Right, syms theta real will help.
Note that if you have any acos() or asin() then MATLAB might not be able to prove that the argument is strictly in the range -1 to +1 so you might still see a conj()
Bathala Teja
Bathala Teja 2021 年 9 月 8 日
"syms theta real" worked.
Thank you very much

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by