How to find the roots of a trigonometric equation?
Show older comments
Hi, I want to determine the roots of a trigonometric equation :
I try with 3 methods:
by Method 1, I got logarithmic answer. In Method 2, I got only one answer while I need more (I expended the length of the domain but nothing happend). and by Method 3 which Star Strider helped me alot, when I check the calculation and substitute the roots in equation I got nonzero answer (in that problem I did not have this error). I really appreciate any help.
L=1e-3;
f=-35;
e=sqrt(2/L-f^2);
pp=20;
l1=fplot(@(gammaL)e*sin(gammaL),[-pp,pp],'c');
hold on
l2=fplot(@(gammaL)-f*cos(gammaL));
figure
l3=fplot(@(gammaL)(e*sin(gammaL)+f*cos(gammaL)),[-pp,pp]);
zxi = find(diff(sign(l3.YData)));
for k = 1:numel(zxi)
idxrng = (-1:1)+zxi(k); % Index Range For Interpolation
if idxrng~=0
gammaL(k,:) = interp1(l3.YData(idxrng), l3.XData(idxrng), 0);
end
end
Thanks in advance
2 Comments
David Goodmanson
on 10 Jan 2022
Edited: David Goodmanson
on 10 Jan 2022
Hi raha,
is this the correct equation? The solution is simply gammaL= atan( -theta_c /e ) + n*pi, where n is any integer.
raha ahmadi
on 10 Jan 2022
Accepted Answer
More Answers (1)
VIGNESH B S
on 10 Jan 2022
syms e x t_c
eqn = e.*cos(x) + t_c.*cos(x) == 0;
solve(eqn,x)
here gamma*L = x
t_c - theta c
solve(equation , varaiable) and variable here is x = gamma*L.
1 Comment
raha ahmadi
on 10 Jan 2022
Categories
Find more on MATLAB 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!