How to solve a cosine function raised to the 3rd power
17 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am trying to use the matlab solver to determine the roots for this trig function:
eqn = solve(1.5936==(2-3*cos(theta)+cos(theta)^3),theta)
Any ideas? I am not seeing how to do this easily.
0 件のコメント
回答 (1 件)
Maximilian Schönau
2020 年 5 月 4 日
Hi, you probably forgot to define theta as a symbolic variable. Use "sym" to do that.
syms theta
eqn = solve(1.5936==(2-3*cos(theta)+cos(theta)^3),theta)
2 件のコメント
Maximilian Schönau
2020 年 5 月 4 日
編集済み: Maximilian Schönau
2020 年 5 月 4 日
Ok, then use "vpa" to convert from symbolic to numeric result. Matlab trys to stay with symbolic variables as long as it can, wich sometimes is usefull and sometimes is not
syms theta
eqn_symbolic = solve(-0.6044==-3*cos(theta)+cos(theta)^3,theta)
eqn_numeric = vpa(eqn_symbolic)
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!