MATLAB: I want to solve an equation which is complex in nature as well as complex in structure. I wrote a simple code which is not working. I have no idea how to solve that equation. I am attaching the code that i wrote and equation image

complexequationMATLAB

I have attached the equatin and the code that i was trying to solve the equatin.

Best Answer

eps1=1.5^2;
eps2=-13+0.53*1I;
eps3=2.25+0*1I;
lambda=0.633e-6;
k0=2*pi/lambda;
a=1/k0;
t=1/k0;
p1=@(epse)k0*sqrt(epse-eps1);
p2=@(epse)k0*sqrt(epse-eps2);
p3=@(epse)k0*sqrt(epse-eps3);
part1=@(epse)(eps1/sqrt(epse-eps1))*(besseli(1,p1(epse)*a)/besseli(0,p1(epse)*a));
part2=@(epse)(eps2/sqrt(epse-eps2))*(besseli(1,p2(epse)*a)/besseli(0,p2(epse)*a));
part3=@(epse)(eps2/sqrt(epse-eps2))*(besselk(1,p2(epse)*(a+t))/besselk(0,p2(epse)*a));
part4=@(epse)(eps3/sqrt(epse-eps3))*(besselk(0,p2(epse)*(a+t))/besselk(0,p2(epse)*a))*(besselk(1,p3(epse)*(a+t))/besselk(0,p3(epse)*(a+t)));
part1r=@(epse)(eps1/sqrt(epse-eps1))*(besseli(1,p1(epse)*a)/besseli(0,p1(epse)*a));
part2r=@(epse)(eps2/sqrt(epse-eps2))*(besselk(1,p2(epse)*a)/besselk(0,p2(epse)*a));
part3r=@(epse)(eps2/sqrt(epse-eps2))*(besseli(1,p2(epse)*(a+t))/besseli(0,p2(epse)*a));
part4r=@(epse)(eps3/sqrt(epse-eps3))*(besseli(0,p2(epse)*(a+t))/besseli(0,p2(epse)*a))*(besselk(1,p3(epse)*(a+t))/besselk(0,p3(epse)*(a+t)));
eqn=@(epse)((part1(epse)-part2(epse))*(part3(epse) -part4(epse)))+((part1(epse)+part2(epse))*(part3(epse) +part4(epse)));
epse0 = 1.0+1I;
sol=fsolve(eqn,epse0)