an error in new versions? triognometric function of A*t

2 ビュー (過去 30 日間)
Dingyu Xue
Dingyu Xue 2017 年 8 月 17 日
コメント済み: Dingyu Xue 2017 年 8 月 25 日
Please run the following code in MATLAB R2017a
A1=simplify(A1), A2=simplify(A2)
A=[-7,2,0,-1; 1,-4,2,1; 2,-1,-6,-1; -1,-1,0,-4];
syms t, A1=(expm(A*1j*t)-expm(-A*1j*t))/(2*1j);
A2=(expm(A*1j*t)+expm(-A*1j*t))/2;
The results are different from the ones in earlier versions such as R2008a, R2011a. The results in earlier versions are consistent with the commands funm(A*t,'sin'). Obviously the results in the new versions are wrong, or at least not simplified well.

採用された回答

Stefan Wehmeier
Stefan Wehmeier 2017 年 8 月 25 日
It is a matter of taste if you prefer results in terms of exp or sin. You could do
simplify(rewrite(A1, 'sin'))
  1 件のコメント
Dingyu Xue
Dingyu Xue 2017 年 8 月 25 日
Yes, that works, thank you! It is not really the personal taste problem of sin rather than exp in this particular example. In the exp expression, terms with complex quantities are resulted, and anybody may prefer the simpler one without complex quantities, obtainable with your rewrite command, which was also the direct solution in old versions.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!