clear
energy=[0.11833e-12 0.20766e-2 0.83664e-2 0.21710e-1 0.20904e-2 ...
        0.45814e-8 0.20808e-2 0.83749e-2 0.21711e-1 0.20861e-2;
        0.18598e-2 0.37903e-2 0.10016e-1 0.23678e-1 0.414719e-2 ...
        0.18600e-2 0.37945e-2 0.10025e-1 0.23679e-1 0.41674e-2;
        0.77687e-2 0.92549e-2 0.15200e-1 0.29856e-1 0.10660e-1 ...
        0.77694e-2 0.92587e-2 0.15208e-1 0.29858e-1 0.10655e-1;
        0.01776 0.01856 0.02402 0.04013 0.02145 ...
        0.01776 0.01856 0.02403 0.04013 0.02145;
        0.015986 0.015678 0.015987 0.04670 0.03725 ...
        0.015986 0.015678 0.015988 0.04671 0.03724;
        0.16585 0.16223 0.16490 0.17302 0.17645 ...
        0.16586 0.16223 0.16491 0.17303 0.17643;
        0.15985 0.15678 0.15987 0.04669 0.03724 ...
        0.15986 0.15678 0.15988 0.04671 0.03723;
        0.017780 0.018580 0.024050 0.040150 0.02148 ...
        0.017780 0.018580 0.024050 0.040150 0.02148;
        0.007580 0.009089 0.015040 0.029670 0.010460 ...
        0.007580 0.009089 0.015040 0.029670 0.010460;
        0.001886 0.003814 0.010040 0.023710 0.004201 ...
        0.001886 0.003814 0.010040 0.023710 0.004201;];
a=2.78;
        
energy(11:13,:)=energy(1:3,:);
energy(3:15,:)=energy(1:13,:);
energy(1:2,:)=energy(11:12,:);
energy(:,11:13)=energy(:,1:3);
energy(:,3:15)=energy(:,1:13);
energy(:,1:2)=energy(:,11:12);


X=[-sqrt(2)*a*2/10 -sqrt(2)*a/10 linspace(0,sqrt(2)*a*12/10,13)];
Z=[-sqrt(3)*a*2/10 -sqrt(3)*a/10 linspace(0,sqrt(3)*a*12/10,13)];

Xi=linspace(0,sqrt(2)*2.78,75);
Zi=linspace(0,sqrt(3)*2.78,75);

energy=0.3*16*energy;
for i=1:length(energy)
  energy1(i,:)=spline(Z,energy(i,:),Zi);
end
for i=1:length(energy1)
  energy2(:,i)=spline(X,energy1(:,i),Xi)';
end

figure(1), surf(Zi,Xi,energy2')
title(['Surface Energy from Slip in the (1,1,2) Plane (J/m' 32 178 ')'])
text(1.2,-0.75,-0.2,['x displacement [-1,-1,1] (' 197 ')'])
text(-3.25,2.0,-0.2,['z displacement [1,-1,0] (' 197 ')'])
colormap(jet)

figure(2), pcolor(Zi,Xi,energy2')
title(['Surface Energy from Slip in the (1,1,2) Plane (J/m' 32 178 ')'])
xlabel(['x displacement [-1,-1,1] (' 197 ')'])
ylabel(['z displacement [1,-1,0] (' 197 ')'])
colormap(jet), colorbar

% output plots are 560x420