% Nodal coordinates (PDETOOL - Export mesh)
X = p3(1,:)';
Y = p3(2,:)';

%time
t=50;

% Conectividades
T = t3(1:3,:)';

% Numerical solution (PDETOOL - Export solution)
Sol = u3(:,end);

% Analytical solution
SolA = X.^2+X.*Y-Y.^2+exp(-3*t);

% Norm of the maximum error
errMax3 = max(abs(Sol-SolA))

% Post-process
figure(1)
trisurf(T,X,Y,Sol)
set(gca,'FontWeight','bold');
set(gca,'FontSize',16);
title('Numerical solution t = 50 using mesh3','FontSize',18,'FontWeight','bold')

figure(2)
trisurf(T,X,Y,SolA)
set(gca,'FontWeight','bold');
set(gca,'FontSize',16);
title('Analytical Solution t = 50 using mesh3','FontSize',18,'FontWeight','bold')

figure(3)
trisurf(T,X,Y,abs(Sol-SolA))
set(gca,'FontWeight','bold');
set(gca,'FontSize',16);
title('Error t = 50 using mesh3','FontSize',18,'FontWeight','bold')