how to solve tan(2x)=-5x

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?

Réponses (2)

John D'Errico
John D'Errico le 12 Mai 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
Andrei Bobrov le 12 Mai 2017

0 votes

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);

Catégories

En savoir plus sur 수학 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!