function Ch2Example3(N,a,b)
%
% Solves the ivp y_{n+1}- 10.1 y_{n} +  y_{n-1} =-1.35 n
%  y_0=a, y1=b
% 
%
fprintf('\n')
disp('_____________________________________________________________________________')
disp('     i        y_n            yclosed          abs error        rel error    ')
disp('_____________________________________________________________________________')
%
ye=zeros(1,N);
yr=zeros(1,N);
%
%ye(1,1:N)=((10*b-(10/6)-a)/99)*10.^(0:N-1)+((100*a+(10/6)-10*b)/99)*10.^(-(0:N-1))+(1/6)*(0:N-1);              
B=(10/99)*(10*a-b+(1/6));A=a-B;
ye(1,1:N)=(1/6)*(0:N-1)+A*10.^(0:N-1)+B*10.^(-(0:N-1));
%
yr(1,1)=a;yr(1,2)=b;
for i=3:N
    y0=yr(1,i-2);y1=yr(1,i-1);
    yr(1,i)=-y0+10.1*y1-1.35*(i-2);
end
%
format short e
%[ye' yee' yr']
for i=1:N
fprintf(' %5.0f  %15.6e  %15.6e  %15.6e  %15.6e\n',i-1,yr(1,i),ye(1,i),yr(1,i)-ye(1,i),(yr(1,i)-ye(1,i))/ye(1,i))
end
xx=zeros(1,N);
xx(1,1:N)=(0:N-1);
plot(xx,ye,'r*',xx,yr,'b+')
xlabel('n','Fontsize',14);ylabel('y_n','Fontsize',14);
legend('Recurrence','Closed form',1)
