x = [0:0.001:1]; d = sqrt([0.01,0.1,1.0,10,100]'); B = cosh((1+i) * x ./ d)./cosh((1+i) * ones(size(x)) ./ d); X = [-fliplr(x),x]; for(j = 1:5) for(t = 0:0.01:1) clf; hold on H = cos(2*pi*t); HX = H * ones(size(X)); BX = real([fliplr(B(j,:)),B(j,:)] * exp(2*pi*i*t)); MX = BX - HX; plot(X, BX,'r',"LineWidth",2) area([X,fliplr(X)], [HX , BX], "FaceColor", [0.5,1.0,0.5], "EdgeColor", "none") plot([-1.2, 1.2], sum(MX, 2)/length(X) * [1,1], 'b',"LineWidth",2); legend("B(x)", "M(x)", "< M >", "location","southeast") plot([-1.2, -1], H * [1,1], 'r',"LineWidth",2) plot([ 1, 1.2], H * [1,1], 'r',"LineWidth",2) plot([-1.2,1.2], 0 * [1,1], ':k',"LineWidth",2) axis([-1.2 1.2 -1.2 1.2]) xlabel("x"); ylabel("B"); pause(0.01) print(sprintf("d%05.2f_t%.2f.png", d(j),t), "-dpng") endfor endfor