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

2 次查看(过去 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()

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by