isn=1.5;
h=5e-6;
x=2*pi*3e14;
%
fzero(@(y)(tan(sqrt(x.^2.*n^2/const('c')^2-y.^2)*h/2)-sqrt(y.^2-x.^2/const('c')^2./sqrt(x.^2*n^2/const('c')^2-y.^2))))
Fzero is unable to find the root

댓글 수: 5

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 12월 5일
what means const('c') for you?
Walter Roberson
Walter Roberson 2019년 12월 5일
And what is n ?
dpb
dpb 2019년 12월 5일
And
x=2*pi*3e14
? Really????!!!!
Dunno what Matlab actually does regarding argument reduction, but there's some real precision issues likely to arise there...
Walter Roberson
Walter Roberson 2019년 12월 5일
MATLAB does not do argument reduction for computations like that.
2*3e14 would be exactly representable as a double, by the way.
dpb
dpb 2019년 12월 5일
Yeah, but moving just a tad to find a solution...??? Altho as formulated, I guess it is just a constant so maybe it itself isn't a problem. What is range of y expected to be, I wonder, though?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Problem-Based Optimization Setup에 대해 자세히 알아보기

태그

질문:

2019년 12월 5일

댓글:

dpb
2019년 12월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by