Empty Sym: 0-by-1 for Solve

2 次查看(过去 30 天)
Tom Field
Tom Field 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.

类别

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