Complex roots of sin(2*x)-2*x=0
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How can i use fsolve to obtain the complex roots of the equation: sin(2*x)-2*x=0?
1 Commento
Risposta accettata
Star Strider
il 7 Ago 2021
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 Commenti
Star Strider
il 7 Ago 2021
True.
However the request was to how to return a complex root. We know nothing more about the intended problem.
.
Matt J
il 7 Ago 2021
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.
Più risposte (1)
Matt J
il 7 Ago 2021
Modificato: Matt J
il 7 Ago 2021
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 Commenti
Vedere anche
Categorie
Scopri di più su Systems of Nonlinear Equations in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!