% % macm 202 -- 17 mar 03 -- djm % % w11lakes.m: nmax = 30; a=zeros(1,nmax+1); b=a; % initial values a(1) = 1; b(1) = 1; for n=1:nmax a(n+1) = .87*a(n) + .38*b(n); b(n+1) = .62*b(n); end figure(1);clf subplot(2,1,1) np = 0:nmax; plot(np,a,'ro'); hold on plot(np,b,'bx'); xlabel('\bf n-axis') ylabel('\bf pollution index: a_n, b_n') subplot(2,1,2) plot(np,2.52*(.87).^np - 1.52*(.62).^np,'ro'); hold on xlabel('\bf n-axis') ylabel('\bf power solutions: a_n, b_n') plot(np,(.62).^np,'bx');