How can i get the envelope to cover the first maxima at x=0. Here is the code.
fluxQuantum = 2.06783383E-15; lambda = 90E-9; L = 500E-9; w = 500E-9; d = 10E-9; N = 500; k = 2*pi*(2*lambda+d)/fluxQuantum; J0 = 1E7; theta=0 pulse = @(t,a)(heaviside(t+a) - heaviside(t-a)); J1 = @(x,y) J0*pulse(x,L/2)*pulse(y,w/2); Bwidth=0.15; N=500; n=91; B = linspace(-1,Bwidth,N); Ic_max = zeros(size(B)); Bwidth = 0.15; c = cosd(theta); s = sind(theta); B = linspace(0,Bwidth,N); By = c*B; Bx = s*B; kx = k*By; ky = k*Bx; for i=1:N % Ix(i) = integral(@(y)(J1(xvec(i),y)*exp(-1j*ky(i)*y)),-w/2,w/2,'ArrayValued',true);
f = @(x)integral(@(y)(J1(x,y).*exp(-1j*ky(i)*y)),-w/2,w/2,'ArrayValued',true); Ic_max(i) = abs(integral(@(x)f(x).*exp(1j*kx(i)*x),-L/2,L/2));%,'ArrayValued',true);
end[up,lo]= envelope(Ic_max,10,'peak');plot(up)hold onplot(Ic_max)
Best Answer