Getting an error, fsolve stopped because it exceeded the function evaluation limit, options.Ma​xFunctionE​valuations = 200 (the selected value). I tried increasing the value to 400, then 2000 but still it shows this error. please help.

my code is -
function F = myfun(z)
a = 3*10^-6;
lambda = 632*10^-9;
n1 = 1.455;
n2 = 1.45;
k0 = 2*pi/lambda;
k1 = 2*pi*n1/lambda;
k2 = 2*pi*n2/lambda;
F(1) = (((1/2.*besselj(0,z(2))-besselj(2,z(2)))./(z(2)/a).*(besselj(1,z(2))))) +(((1/2.*besselk(0,z(1))-besselk(2,z(1))))./((z(1)/a).*(besselk(1,z(1))))).*(((k1^2).*(((1/2.*besselj(0,z(2))-besselj(2,z(2))))./((z(2)/a).*(besselj(1,z(2))))) + ((k2^2).*(((1/2.*besselk(0,z(1))-besselk(2,z(1))))./((z(1)/a).*(besselk(1,z(1))))))));
F(2) = (((((k0^2*n1^2-(z(2)/a)^2))*1/(a^2))).*((z(2)/a).^-2+(z(1)/a).^-2).^2);
end

Answers (0)

This question is closed.

Asked:

on 5 Aug 2016

Closed:

on 5 Aug 2016

Community Treasure Hunt

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

Start Hunting!