how to solve tan(2x)=-5x
Show older comments
this question don't have unique value. but using "solve(tan(2*x)+5*x == 0)" then answer is only '0'. how to find another answer?
Answers (2)
John D'Errico
on 12 May 2017
0 votes
Using vpasolve instead of solve, you can provide a starting value. Since there will be no analytical solution anyway, when solve realizes that, it will just use vpasolve. But you need to force it to choose a different root with a starting value different from zero.
Or, you could have used fzero instead, which will insist on a starting value, and which prefers a starting bracket that surrounds a root.
Andrei Bobrov
on 12 May 2017
example for interval -10*pi:10*pi
f = @(x,w)tan(w*x)+5*x
w = 2; % in your case
x = -10*pi+pi/(2*w):pi/w:10*pi-pi/(2*w);
s = eps(100);
out = arrayfun(@(t,k)fzero(@(x)f(x,w),[t,k]),s+x(1:end-1),x(2:end)-s);
Categories
Find more on 수학 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!