function aeulersystemLV(n)
% Solves the Lotka-Volterra system 
% by the forward Euler method
%
fprintf('\n')
%
%
%nn=2^(iit-1)*n;
nn=n;
%
h=1/nn;
%
y=zeros(2,1);u1=zeros(nn+1,2);
u2=zeros(nn+1,2);tt=zeros(nn+1,2);
f=zeros(2,1);g=zeros(2,1);
%y(1,1)=1;y(2,1)=2;
y(1,1)=3;y(2,1)=5;
%
for i=0:nn
t=i*h;
%
tt(i+1)=t;
u1(i+1)=y(1,1);
u2(i+1)=y(2,1);
y1=y(1,1);y2=y(2,1);
g=gterm1(t);
f=fterm1(t,y1,y2);
%
y=y+h*f;
end
%
%fprintf('h =%12.6f        maxerr1 = %15.6e    maxerr2 = %15.6e\n',h,u1(iit),u2(iit))
%
plot(tt,u1,'b+',tt,u2,'ro');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function exact=exact1(t);
%exact=zeros(2,1);
%exact(1,1)=cos(t)+sin(t);
%exact(2,1)=2*cos(t);
%exact(1,1)=exp(3*t)+exp(-t);
%exact(2,1)=2*exp(3*t)-2*exp(-t);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function gterm=gterm1(t);
gterm=zeros(2,1);
%gterm(1,1)=4*cos(t)-2*sin(t);
%gterm(2,1)=5*cos(t)-5*sin(t);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function fterm=fterm1(t,y1,y2);
fterm=zeros(2,1);
fterm(1,1)=4*y1*(1-0.5*y2);
fterm(2,1)=3*y2*((y1/3)-1);