% Taylor series in complex plane demos, showing disk of convergence
%
% Alex Barnett 11/11/05

% Paste in each of these groups of commands in turn...

clear opt
opt.slice = 0.3;
figure; set(gcf,'Units','normalized','Position',[.3 .1 .4 .8]);
opt.func = 'z';                % show identity function
show_zser([], opt);

figure; set(gcf,'Units','normalized','Position',[.3 .1 .4 .8]);
opt.func = 'exp(z)';           % show exp function
show_zser([], opt);

figure; set(gcf,'Units','normalized','Position',[.3 .1 .4 .8]);
opt.func = 'exp(z)';           % convergence: converges everywhere
for n=1:20; show_zser([1 1./cumprod(1:n)], opt); drawnow; pause(0.3); end;

opt.func = '1./(1-z)';         % pole on real axis at 1
opt.win = 1.4;
for n=1:20; show_zser(ones(1,n+1), opt); drawnow; pause(0.2); end;

opt.func = '1./(1+z.^2)';      % poles at +-i
opt.win = 1.4;
for n=1:50; show_zser([1 cos((1:n)*pi/2)], opt); drawnow; end;

opt.func = 'log(z)';           % singularity at 0, expanded about 1
opt.z0 = 1;
opt.win = 2.2;
for n=1:20; show_zser([0 -cos(pi*(1:n))./(1:n)], opt); drawnow; end;
