Effacer les filtres
Effacer les filtres

Empty Sym: 0-by-1 for Solve

2 vues (au cours des 30 derniers jours)
Tom Field
Tom Field le 24 Oct 2023
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.

Réponses (1)

Walter Roberson
Walter Roberson le 24 Oct 2023
Modifié(e) : Walter Roberson le 24 Oct 2023
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 commentaire
Tom Field
Tom Field le 24 Oct 2023
Hmm, interesting. Thank you very much

Connectez-vous pour commenter.

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by