% mstepstab.m % % Written by: David Darmofal % February 20, 2003 % % Purpose: plots the stability countour for multi-step methods % clear theta z g; % Specify theta theta = linspace(0,2*pi,301); % Set growth factor g = exp(i*theta); % Calculate z-location % Adams-Bashforth 1 (i.e. Forward Euler) z = g - 1; % Adams-Moulton 1 (i.e. Backward Euler) %z = (g-1)./g; % Adams-Moulton 2 (i.e. Trapezoidal) %z = (g-1)./(0.5*(g+1)); % Plot z-locus of g-contour plot(z,'k-'); axis([-3,3,-3,3]); axis('square'); xlabel('Real z'); ylabel('Imag z'); grid on;