get several answers with solve

1 回表示 (過去 30 日間)
pejhan stiff
pejhan stiff 2021 年 1 月 10 日
回答済み: John D'Errico 2021 年 1 月 10 日
hi i want to have several answers for this eq: cos(x)*cosh(x)+1=0
but when i use this code :
solve('cos(x)*cosh(x)+1=0')
i just get one answers

回答 (1 件)

John D'Errico
John D'Errico 2021 年 1 月 10 日
There is no analytical solution.
syms x
solve(cos(x)*cosh(x)+1==0)
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
> In sym/solve (line 304)
ans =
-212.05750411731104359622842837137
So solve tells you that it used a numerical solver. That you want it to find all solutions is not that mathematically relavant, unless you are good with a magic wand.
You can use a numerical solver, starting from different start points, then collect all solutions found. But wanting the impossible only makes you a dreamer.

カテゴリ

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