clf;

NaCl = [
4.000000 -13.167215 -13.097568
4.040000 -13.252781 -13.191534
4.080000 -13.337034 -13.283466
4.120000 -13.419974 -13.373439
4.160000 -13.501600 -13.461515
4.200000 -13.581912 -13.547744
4.240000 -13.660911 -13.632167
4.280000 -13.738596 -13.714821
4.320000 -13.814968 -13.795738
4.360000 -13.890026 -13.874946
4.400000 -13.963770 -13.952468
4.440000 -14.036201 -14.028329
4.480000 -14.107319 -14.102548
4.520000 -14.177123 -14.175145
4.560000 -14.245613 -14.246138
4.600000 -14.312790 -14.315542
4.640000 -14.378653 -14.383373
4.680000 -14.443203 -14.449645
4.720000 -14.506439 -14.514373
4.760000 -14.568362 -14.577568
4.800000 -14.628971 -14.639244
4.840000 -14.688266 -14.699412
4.880000 -14.746248 -14.758083
4.920000 -14.802917 -14.815268
4.960000 -14.858272 -14.870978
5.000000 -14.912313 -14.925221
5.040000 -14.965041 -14.978008
5.080000 -15.016455 -15.029348
5.120000 -15.066555 -15.079249
5.160000 -15.115343 -15.127721
5.200000 -15.162816 -15.174771
5.240000 -15.208976 -15.220408
5.280000 -15.253823 -15.264639
5.320000 -15.297355 -15.307473
5.360000 -15.339575 -15.348917
5.400000 -15.380481 -15.388977
5.440000 -15.420073 -15.427661
5.480000 -15.458352 -15.464977
5.520000 -15.495317 -15.500930
5.560000 -15.530968 -15.535527
5.600000 -15.565306 -15.568775
5.640000 -15.598331 -15.600680
5.680000 -15.630042 -15.631250
5.720000 -15.660439 -15.660913
5.760000 -15.689523 -15.690157
5.800000 -15.717293 -15.718347
5.840000 -15.743750 -15.745151
5.880000 -15.768893 -15.770491
5.920000 -15.792723 -15.794372
5.960000 -15.815239 -15.816823
6.000000 -15.836441 -15.837870
6.040000 -15.856330 -15.857539
6.080000 -15.874906 -15.875854
6.120000 -15.892168 -15.892831
6.160000 -15.908116 -15.908488
6.200000 -15.922751 -15.922838
6.240000 -15.936072 -15.935892
6.280000 -15.948080 -15.947662
6.320000 -15.958774 -15.958156
6.360000 -15.968154 -15.967383
6.400000 -15.976221 -15.975351
6.440000 -15.982975 -15.982067
6.480000 -15.988415 -15.987539
6.520000 -15.992541 -15.991772
6.560000 -15.995354 -15.994773
6.600000 -15.996853 -15.996547
6.640000 -15.997039 -15.997100
6.680000 -15.995911 -15.996438
6.720000 -15.993470 -15.994565
6.760000 -15.989715 -15.991487
6.800000 -15.984646 -15.987209
6.840000 -15.978264 -15.981736
6.880000 -15.970569 -15.975072
6.920000 -15.961560 -15.967222
6.960000 -15.951237 -15.958191
7.000000 -15.939601 -15.947983
7.040000 -15.926651 -15.936602
7.080000 -15.912388 -15.924053
7.120000 -15.896811 -15.910340
7.160000 -15.879920 -15.895468
7.200000 -15.861716 -15.879440
7.240000 -15.842199 -15.862260
7.280000 -15.821368 -15.843934
7.320000 -15.799223 -15.824464
7.360000 -15.775765 -15.803855
7.400000 -15.750993 -15.782110
7.440000 -15.724908 -15.759235
7.480000 -15.697509 -15.735231
7.520000 -15.668796 -15.710104
7.560000 -15.638770 -15.683858
7.600000 -15.607431 -15.656495
7.640000 -15.574778 -15.628020
7.680000 -15.540811 -15.598437
7.720000 -15.505531 -15.567749
7.760000 -15.468937 -15.535960
7.800000 -15.431030 -15.503073
7.840000 -15.391809 -15.469092
7.880000 -15.351275 -15.434022
7.920000 -15.309427 -15.397864
7.960000 -15.266266 -15.360699
8.000000 -15.221791 -15.323142
];
plot(NaCl(:,1), NaCl(:,2), 'g');
hold on;
plot(NaCl(:,1), NaCl(:,3), 'g--');

ZnS = [
4.000000 -14.033728 -14.140795
4.040000 -14.084805 -14.195981
4.080000 -14.134275 -14.249086
4.120000 -14.182139 -14.300167
4.160000 -14.228397 -14.349272
4.200000 -14.273048 -14.396440
4.240000 -14.316094 -14.441702
4.280000 -14.357534 -14.485086
4.320000 -14.397367 -14.526618
4.360000 -14.435594 -14.566318
4.400000 -14.472216 -14.604207
4.440000 -14.507231 -14.640303
4.480000 -14.540640 -14.674622
4.520000 -14.572442 -14.707181
4.560000 -14.602639 -14.737995
4.600000 -14.631230 -14.767077
4.640000 -14.658214 -14.794442
4.680000 -14.683593 -14.820102
4.720000 -14.707365 -14.844070
4.760000 -14.729531 -14.866358
4.800000 -14.750091 -14.886979
4.840000 -14.769045 -14.905943
4.880000 -14.786393 -14.923261
4.920000 -14.802135 -14.938945
4.960000 -14.816270 -14.953005
5.000000 -14.828800 -14.965452
5.040000 -14.839723 -14.976296
5.080000 -14.849041 -14.985546
5.120000 -14.856752 -14.993213
5.160000 -14.862857 -14.999307
5.200000 -14.867356 -15.003836
5.240000 -14.870249 -15.006811
5.280000 -14.871535 -15.008240
5.320000 -14.871216 -15.008132
5.360000 -14.869290 -15.006497
5.400000 -14.865759 -15.003342
5.440000 -14.860621 -14.998678
5.480000 -14.853877 -14.992512
5.520000 -14.845527 -14.984853
5.560000 -14.835571 -14.975709
5.600000 -14.824009 -14.965089
5.640000 -14.810840 -14.953000
5.680000 -14.796066 -14.939452
5.720000 -14.779685 -14.924840
5.760000 -14.761699 -14.909616
5.800000 -14.742106 -14.893200
5.840000 -14.720907 -14.875290
5.880000 -14.698102 -14.855815
5.920000 -14.673691 -14.834784
5.960000 -14.647674 -14.812222
6.000000 -14.620050 -14.788159
6.040000 -14.590821 -14.762619
6.080000 -14.559985 -14.735627
6.120000 -14.527543 -14.707200
6.160000 -14.493496 -14.677356
6.200000 -14.457842 -14.646109
6.240000 -14.420582 -14.613474
6.280000 -14.381715 -14.579461
6.320000 -14.341243 -14.544082
6.360000 -14.299165 -14.507347
6.400000 -14.255480 -14.469265
6.440000 -14.210190 -14.429846
6.480000 -14.163293 -14.389097
6.520000 -14.114790 -14.347027
6.560000 -14.064681 -14.303644
6.600000 -14.012966 -14.258956
6.640000 -13.959645 -14.212969
6.680000 -13.904718 -14.165691
6.720000 -13.848184 -14.117130
6.760000 -13.790045 -14.067290
6.800000 -13.730299 -14.016181
6.840000 -13.668947 -13.963807
6.880000 -13.605989 -13.910176
6.920000 -13.541425 -13.855293
6.960000 -13.475255 -13.799166
7.000000 -13.407479 -13.741800
7.040000 -13.338097 -13.683201
7.080000 -13.267108 -13.623375
7.120000 -13.194514 -13.562329
7.160000 -13.120313 -13.500068
7.200000 -13.044506 -13.436597
7.240000 -12.967093 -13.371924
7.280000 -12.888074 -13.306053
7.320000 -12.807449 -13.238989
7.360000 -12.725218 -13.170740
7.400000 -12.641381 -13.101309
7.440000 -12.555937 -13.030703
7.480000 -12.468888 -12.958926
7.520000 -12.380232 -12.885985
7.560000 -12.289970 -12.811885
7.600000 -12.198102 -12.736630
7.640000 -12.104628 -12.660227
7.680000 -12.009548 -12.582680
7.720000 -11.912862 -12.503994
7.760000 -11.814569 -12.424175
7.800000 -11.714671 -12.343227
7.840000 -11.613166 -12.261156
7.880000 -11.510055 -12.177967
7.920000 -11.405339 -12.093664
7.960000 -11.299016 -12.008323
8.000000 -11.191087 -11.922528
];
plot(ZnS(:,1), ZnS(:,2), 'b');
plot(ZnS(:,1), ZnS(:,3), 'b--');

CsCl = [
4.000000 -10.703716 -10.094431
4.040000 -10.779832 -10.185818
4.080000 -10.854898 -10.276259
4.120000 -10.928917 -10.364834
4.160000 -11.001887 -10.451107
4.200000 -11.073809 -10.535108
4.240000 -11.144682 -10.616941
4.280000 -11.214508 -10.696706
4.320000 -11.283284 -10.774486
4.360000 -11.351013 -10.850351
4.400000 -11.417693 -10.924361
4.440000 -11.483325 -10.996567
4.480000 -11.547908 -11.067014
4.520000 -11.611443 -11.135739
4.560000 -11.673930 -11.202779
4.600000 -11.735368 -11.268166
4.640000 -11.795758 -11.331928
4.680000 -11.855100 -11.394092
4.720000 -11.913393 -11.454682
4.760000 -11.970638 -11.513722
4.800000 -12.026834 -11.571231
4.840000 -12.081983 -11.627229
4.880000 -12.136083 -11.681735
4.920000 -12.189134 -11.734765
4.960000 -12.241137 -11.786336
5.000000 -12.292092 -11.836463
5.040000 -12.341999 -11.885159
5.080000 -12.390857 -11.932439
5.120000 -12.438666 -11.978315
5.160000 -12.485428 -12.022800
5.200000 -12.531141 -12.065904
5.240000 -12.575806 -12.107639
5.280000 -12.619422 -12.148014
5.320000 -12.661990 -12.187041
5.360000 -12.703510 -12.224729
5.400000 -12.743981 -12.261086
5.440000 -12.783404 -12.296121
5.480000 -12.821779 -12.329843
5.520000 -12.859105 -12.362261
5.560000 -12.895383 -12.393380
5.600000 -12.930612 -12.423210
5.640000 -12.964794 -12.452169
5.680000 -12.997927 -12.482077
5.720000 -13.030011 -12.511819
5.760000 -13.061047 -12.540266
5.800000 -13.091035 -12.567103
5.840000 -13.119975 -12.592301
5.880000 -13.147866 -12.615913
5.920000 -13.174708 -12.638000
5.960000 -13.200503 -12.658622
6.000000 -13.225249 -12.677826
6.040000 -13.248947 -12.695652
6.080000 -13.271596 -12.712134
6.120000 -13.293197 -12.727298
6.160000 -13.313750 -12.741166
6.200000 -13.333254 -12.753758
6.240000 -13.351710 -12.765090
6.280000 -13.369118 -12.775176
6.320000 -13.385477 -12.784029
6.360000 -13.400788 -12.791658
6.400000 -13.415050 -12.798075
6.440000 -13.428265 -12.803287
6.480000 -13.440431 -12.807304
6.520000 -13.451548 -12.810132
6.560000 -13.461617 -12.811778
6.600000 -13.470638 -12.812250
6.640000 -13.478611 -12.811553
6.680000 -13.485535 -12.809692
6.720000 -13.491410 -12.806674
6.760000 -13.496238 -12.802503
6.800000 -13.500017 -12.797185
6.840000 -13.502748 -12.790724
6.880000 -13.504430 -12.783125
6.920000 -13.505064 -12.774393
6.960000 -13.504650 -12.764532
7.000000 -13.503187 -12.753546
7.040000 -13.500676 -12.741439
7.080000 -13.497117 -12.728216
7.120000 -13.492509 -12.713880
7.160000 -13.486853 -12.698435
7.200000 -13.480148 -12.681885
7.240000 -13.472396 -12.664234
7.280000 -13.463594 -12.645485
7.320000 -13.453745 -12.625642
7.360000 -13.442847 -12.604708
7.400000 -13.430901 -12.582789
7.440000 -13.417906 -12.560754
7.480000 -13.403864 -12.538578
7.520000 -13.388772 -12.515632
7.560000 -13.372633 -12.491582
7.600000 -13.355445 -12.466310
7.640000 -13.337209 -12.439789
7.680000 -13.317924 -12.412030
7.720000 -13.297591 -12.383053
7.760000 -13.276210 -12.352882
7.800000 -13.253780 -12.321540
7.840000 -13.230302 -12.289046
7.880000 -13.205775 -12.255418
7.920000 -13.180201 -12.220671
7.960000 -13.153578 -12.184818
8.000000 -13.125906 -12.147871
];
plot(CsCl(:,1), CsCl(:,2), 'r');
plot(CsCl(:,1), CsCl(:,3), 'r--');

axis([4.000000 8.000000 -16.098249 -12.498249]);
legend('NaCl LDA','NaCl empirical','ZnS LDA','ZnS empirical','CsCl LDA','CsCl empirical', 3);
xlabel('Crystal density [g/cm^3]');
ylabel('Cohesive energy [eV/pair]');
title('LDA (shifted) {\it vs} empirical potential  for ZrC crystals');
