how to calculate the value from function define
1 view (last 30 days)
Show older comments
la0 = 650; k0 = 2*%pi/la0; ef = 1; ec = -19.6224-0.443*%i; es=ec;
pc = ef/ec; ps = ef/es;
bcinf = sqrt(ec*ef/(ec+ef));
tol = 1e-12;
acut = -real(1/pc/sqrt(ef-ec))/k0;
wc = 2*acut;
nc = sqrt(ef);
w = 5:10:3500; //% thickness range for TM0
w1 = 1.001*wc:10:3500; //% thickness range for TM1
function be=f(la0, ef, ec, w, bcinf, m, tol);
for j=1:length(w)
be(j) = f(la0,ef,ec,w(j),bcinf,0,tol);
end
for j=1:length(w1)
be1(j) = f(la0,ef,ec,w1(j),bcinf,1,tol);
end
neff0 = real(be0); L0 = -1/2./imag(be0)/k0/1000; //% TM0 index & distance
neff1 = real(be1); L1 = -1/2./imag(be1)/k0/1000;// % TM1 index & distance
w2=1000; a = w2/2;// % specific solutions
b = f(la0,ef,ec,a,bcinf,0,tol);// % TM0
p = f(la0,ef,ec,a,bcinf,1,tol);// % TM1
neff02 = real(be02); L02 = -1/2/imag(be02)/k0/1000;
end
disp(be,b,p)
pl help to solve the problem to disp(be,b,p)
1 Comment
Walter Roberson
on 16 Feb 2022
Your function f calls itself multiple times, and does so unconditionally. That is an infinite loop.
Answers (0)
See Also
Categories
Find more on Stress and Strain in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!