roots of non linear periodic function

3 visualizaciones (últimos 30 días)
Mohsin Iqbal
Mohsin Iqbal el 5 de Mzo. de 2021
Editada: Walter Roberson el 5 de Mzo. de 2021
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

Respuesta aceptada

Walter Roberson
Walter Roberson el 5 de Mzo. de 2021
Editada: Walter Roberson el 5 de Mzo. de 2021
format long g
rng(655321)
L = randn()
L =
-0.486212438021384
P = rand() * 10
P =
3.86360763118074
C = @(x) x.*L.*tan(x*L)-P
C = function_handle with value:
@(x)x.*L.*tan(x*L)-P
root1 = fzero(C, pi/3)
root1 =
2.58404586473783
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].')
ans = 19×1
-29.0761112543409 -26.445774714587 -22.6147531978207 -20.1564225125044 -16.1533951413005 -13.9854187445272 -9.6920370847803 -8.06185601128258 -3.2306790282601 2.58404586473783

Más respuestas (1)

KSSV
KSSV el 5 de Mzo. de 2021
syms x
p = pi/4 ;
L = 2 ;
eqn = x*L*tan(x*L)-p==0 ;
s = vpasolve(eqn,x)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by