Using solve to solve a complex trigonometric equation

16 ビュー (過去 30 日間)
Junha Kim
Junha Kim 2020 年 4 月 28 日
コメント済み: Junha Kim 2020 年 4 月 28 日
i want to solve the trigonometric equation, but actual answers and the answers matlab gives me are different,,, please help me to get correct answers,,
here's my code
syms x;
assume(x>=0 & x<=2*pi);
f(x) = cos(x) * (1 - sin(x));
Y = solve( f(x) == 0);
Y
Y =
pi/2
actually, there should be one more.. 1.5pi,,, please help me :(

採用された回答

Mrutyunjaya Hiremath
Mrutyunjaya Hiremath 2020 年 4 月 28 日
Hello Junha Kim,
syms x;
assume(x>=0 & x<=2*pi);
eqn = cos(x)*(1-sin(x)) == 0;
[solx, parameters, conditions] = solve(eqn, x, 'ReturnConditions',true);
assume(conditions);
restrictions = [x>=0, x<=2*pi];
solk = solve(restrictions, parameters);
valx = subs(solx, solk)
for more information, refer here
  1 件のコメント
Junha Kim
Junha Kim 2020 年 4 月 28 日
I really appreciate for your help. Thank You.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by