Complex roots of sin(2*x)-2*x=0
조회 수: 2 (최근 30일)
이전 댓글 표시
How can i use fsolve to obtain the complex roots of the equation: sin(2*x)-2*x=0?
댓글 수: 1
채택된 답변
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)
.
댓글 수: 3
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
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
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);
x=complex(p(1), p(2)),
sin(2*x)-2*x
function F=eqnfun(p)
x=complex(p(1), p(2));
y=sin(2*x)-2*x;
F=[real(y); imag(y)];
end
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!