%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MAO 2002/2003
%
%   =================================================
%   Resolution numérique d'EDP par différences finies
%   =================================================
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%    Représentation de la solution
%
%   - en dimension 1 si d=1 (fonction bord1)
%   - en dimension 2 si d=2 (fonction bord2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if d==1
   figure(1)
   h=1/(n+1);
   xx=h:h:1-h;
   plot(xx,X)
   title('La solution calculée')
   xlabel('x')
   ylabel('u(x)')
end

if d==2
for j=1:n
   k=(j-1)*n;
   for i=1:n
      uu(i,j)=X(i+k);
   end
end
figure(1)
h=1/(n+1);
ix=h:h:1-h;
ig=ix;
[xx,yy]=meshgrid(ix,ig);
subplot(2,2,1),mesh(xx,yy,uu)
title('La solution calculée')
subplot(2,2,2), contour(xx,yy,uu)
title('Les lignes de niveau')
subplot(2,2,3), contourf(xx,yy,uu)
title('Les lignes de niveau')

end
