roots of non linear periodic function
3 次查看(过去 30 天)
显示 更早的评论
Hi, i need to find roots of following equation (x). L and P are constants. using fzero i cant, please guid
(x*L)*tan(x*L)=P
i am attempting as follow but fails:
function C(x)
x*L*tan(x*L))=P
0 个评论
采纳的回答
Walter Roberson
2021-3-5
编辑:Walter Roberson
2021-3-5
format long g
rng(655321)
L = randn()
P = rand() * 10
C = @(x) x.*L.*tan(x*L)-P
root1 = fzero(C, pi/3)
N = 10;
nroots = zeros(1,N);
proots = zeros(1,N);
for K = 1 : N
nroots(K) = fzero(C, root1-K*pi);
proots(K) = fzero(C, root1+K*pi);
end
uniquetol([nroots, root1, proots].')
0 个评论
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!