Empty Sym: 0-by-1 for Solve
조회 수: 2 (최근 30일)
이전 댓글 표시
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)
Any advice would be greatly appreciated.
댓글 수: 0
답변 (1개)
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!