
theta = linspace(0,2*pi,250);
z = exp(1i*theta);

%% AM-2

lh = (z.^2-z)./(5/12*z.^2 + 2/3*z - 1/12);
plot(real(lh),imag(lh),'b-','linewidth',2)
hold on
plot(zeros(250),linspace(-1,1,250),'k--','linewidth',2);

%% trapezoid rule 

lh = (z-1)./(.5*(z+1));
plot(real(lh),imag(lh),'b.','linewidth',2)
hold on
plot(zeros(250),linspace(-1,1,250),'k--','linewidth',2);

axis([-1 1 -1 1]) 


%% backward euler

lh = (z-1)./z;
plot(real(lh),imag(lh),'b-','linewidth',2)
hold on
plot(zeros(250),linspace(-4,4,250),'k--','linewidth',2);
axis([-1 1 -1 1]*4) 

%% adams moulton AM-4

lh = (z.^3-z.^2)./(1/24*(9*z.^3 + 19*z.^2 - 5*z + 1));
plot(real(lh),imag(lh),'b-','linewidth',2)
hold on
plot(zeros(250),linspace(-4,4,250),'k--','linewidth',2);
axis([-1 1 -1 1]*4) 

%% BDF 2

lh = (3*z.^2 - 4*z + 1)./(2*z.^2);
plot(real(lh),imag(lh),'r-','linewidth',2)
hold on
plot(zeros(250),linspace(-4,4,250),'k--','linewidth',2);
axis equal
axis([-1 1 -1 1]*4) 

%% BDF 3

lh = (11*z.^3 - 18*z.^2 + 9*z - 2)./(6*z.^3);
plot(real(lh),imag(lh),'b-','linewidth',2)
hold on
plot(zeros(250),linspace(-6,6,250),'k--','linewidth',2);
plot(linspace(-6,6,250),zeros(250),'k--','linewidth',2);
axis([-1 1 -1 1]*6) 

%% BDF 4

lh = (25*z.^4 - 48*z.^3 + 36*z.^2 - 16*z + 3)./(12*z.^4);
plot(real(lh),imag(lh),'b-','linewidth',2)
hold on 
plot(zeros(250),linspace(-8,8,250),'k--','linewidth',2);

axis([-1 1 -1 1]*8) 