complex root of single variable nonlinear equation
1 view (last 30 days)
Show older comments
I am solving the following single variable nonlinear equation.
syms x
p=0; % Require all roots for p=0 to p=25 with 0.1 interval
S=sqrt((p+sqrt(p^2+4*x^2))/2);
U=sqrt((-p+sqrt(p^2+4*x^2))/2);
Eq=S*U^5+S^5*U+2*S^3*U^3*cos(S)*cosh(U)+S^2*U^2*(S^2-U^2)*sin(S)*sinh(U);
ht = matlabFunction(Eq);
x0=2.4674; % Initial guess for p=0
x = fzero(ht,x0);
For p=0 to 20.5, the roots are real but for p>20.5 the roots are complex (this is not a problem made by me, it is a text book problem of stability). As fzero gives only real solutions, there is no problem in solving till p=20.5, but for p=20.6 to 25 it gives some furthest (suddenly jumping to larger value) real root. My question is, how to get those complex roots. Can anyone please help me ?
0 Comments
Accepted Answer
John D'Errico
on 9 Mar 2017
Edited: John D'Errico
on 9 Mar 2017
Easy enough.
syms x
p = 21;
S=sqrt((p+sqrt(p^2+4*x^2))/2);
U=sqrt((-p+sqrt(p^2+4*x^2))/2);
Eq=S*U^5+S^5*U+2*S^3*U^3*cos(S)*cosh(U)+S^2*U^2*(S^2-U^2)*sin(S)*sinh(U);
So solve, forcing vpasolve to look in the complex plane, and in a reasonable area.
r1 = vpasolve(Eq == 0,x,10+i)
r1 =
10.93735156115395089653090093632 + 2.1249406184976881586789820769267i
It appears the other root will be a complex conjugate of the first. But just to see if that is true, we can use a root killer:
vpasolve(Eq/(x-r1) == 0,x,10+i)
ans =
10.93735156115395089653090093632 - 2.1249406184976881586789820769267i
which finds the other root in that area. Did it work?
subs(Eq,x,r1)
ans =
0.00000000000000000000000000000099393633311179516308994541658166 + 0.00000000000000000000000000000062779071961032320818382550999783i
subs(Eq,x,r1')
ans =
0.00000000000000000000000000000099393633311179516308994541658166 - 0.00000000000000000000000000000062779071961032320818382550999783i
Yep.
More Answers (1)
See Also
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!