Complex roots of sin(2*x)-2*x=0

2 ビュー (過去 30 日間)
Saeid
Saeid 2021 年 8 月 7 日
編集済み: Saeid 2021 年 8 月 8 日
How can i use fsolve to obtain the complex roots of the equation: sin(2*x)-2*x=0?
  1 件のコメント
Matt J
Matt J 2021 年 8 月 7 日
Well, you definitely can't find more than one. fsolve is a numerical solver.

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

採用された回答

Star Strider
Star Strider 2021 年 8 月 7 日
Providing fsolve with a complex initial estimate encourages it to find complex roots —
f = @(x) sin(2*x)-2*x;
xrts = fsolve(f, 1+1i)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
xrts = 0.0320 + 0.0197i
.
  3 件のコメント
Star Strider
Star Strider 2021 年 8 月 7 日
True.
However the request was to how to return a complex root. We know nothing more about the intended problem.
.
Matt J
Matt J 2021 年 8 月 7 日
Providing fsolve with a complex initial estimate encourages it to find complex roots
Only if the objective is analytic, see
It's not clear to me whether that is true or not for sin(2*x)-2*x.

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

その他の回答 (1 件)

Matt J
Matt J 2021 年 8 月 7 日
編集済み: Matt J 2021 年 8 月 7 日
This seems to find a non-trivial complex root:
opts=optimoptions('fsolve','StepTol',1e-14,'FunctionTol',1e-14,'OptimalityTol',1e-14);
[p,fval]=fsolve(@eqnfun,[3,3],opts);
Equation solved, inaccuracy possible. The vector of function values is near zero, as measured by the value of the function tolerance. However, the last step was ineffective.
x=complex(p(1), p(2)),
x = 3.7488 + 1.3843i
sin(2*x)-2*x
ans = 0.0000e+00 + 2.2204e-15i
function F=eqnfun(p)
x=complex(p(1), p(2));
y=sin(2*x)-2*x;
F=[real(y); imag(y)];
end
  2 件のコメント
Matt J
Matt J 2021 年 8 月 7 日
There is obviously also a solution at x = -3.7488 - 1.3843i
Saeid
Saeid 2021 年 8 月 8 日
編集済み: Saeid 2021 年 8 月 8 日
Thanks Matt. Just in case you have asked yourselves how an equation like this occurs: in solving certain biharmonic equations the solution at some point requires obtaining the eigenvalues (pN) that are complex roots of this equation:
sin(2pN)=2pN
So, not only is there a complex solution to this equation, but there is apparently an infinite number of solutions

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

カテゴリ

Help Center および File ExchangeSystems of Nonlinear Equations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by