필터 지우기
필터 지우기

Empty Sym: 0-by-1 for Solve

조회 수: 2 (최근 30일)
Tom Field
Tom Field 2023년 10월 24일
편집: Walter Roberson 2023년 10월 24일
Hi there,
I'm not sure why my code returns an empty Sym:
syms beta
beta = sym('beta', 'real');
%Constants
d = 2e-6;
n_s = 1.5;
n_c = 1;
es = n_s^2;
ec = n_c^2;
c = 3e8;
lambda = 1.5e-6;
f = c/lambda;
w = 2*pi*f;
kappa = sqrt((n_s^2*w^2/c^2)-beta^2);
gamma = sqrt(beta^2-(n_s^2*w^2/c^2));
eqn = tan(kappa*d) == -kappa/gamma;
S = vpasolve(eqn, beta)
S = Empty sym: 0-by-1
Any advice would be greatly appreciated.

답변 (1개)

Walter Roberson
Walter Roberson 2023년 10월 24일
편집: Walter Roberson 2023년 10월 24일
kappa = sqrt((n_s^2*w^2/c^2)-beta^2);
gamma = sqrt(beta^2-(n_s^2*w^2/c^2));
the expressions within the sqrt() are the negative of each other
eqn = tan(kappa*d) == -kappa/gamma;
When beta^2 > (n_s^2*w^2/c^2) then -kappa/gamma --> -1i . When beta^2 < (n_s^2*w^2/c^2) then -kappa/gamma --> 1i . When beta^2 == (n_s^2*w^2/c^2) then you have a singularity.
So you are attempting to find a beta such that tan(kappa*d) = 1i or tan(kappa*d) = -1i depending on the range of beta.
If you proceed by way of taking arctan of both sides, then providing you stay within the primary range, you get
kappa*d == atan(-1i)
%or
kappa*d == atan(1i)
but the arctan of 1i and -1i are complex infinities.
The only way to get a complex infinity out of kappa is for beta to be infinite. However, if you substitute everything in then for the left hand side, tan(kappa*d) for infinite beta, you get 1i and for the right hand side of -kappa/gamma you get -1i .
Therefore there is no solution.
  댓글 수: 1
Tom Field
Tom Field 2023년 10월 24일
Hmm, interesting. Thank you very much

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

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by