function [S,L] = VaporPressure(element);
%   [S,L] = VaporPressure(element,T);
%   element is two leter symbol for element
%   S and L are log of the vapor pressures in atm of solid and liquid with
%   temperatures.
%  (Note that you need to look in the Hbk of Pys and Chem to
%   see correct top temperatures
%   The data in di is element, state, A, B, C, D, T(melt)/K
%   equation is log(VP) = A + B/T +C*log(T) + D/T^3 
%   log is common logarithum


d={'Li'	'solid'	5.667	-8310	0	0	453
'Li'	'liquid'	5.055	-8023	0	0	0
'Na'	'solid'	5.298	-5603	0	0	371
'Na'	'liquid'	4.704	-5377	0	0	0
'K'	'solid'	4.961	-4646	0	0	336
'K'	'liquid'	4.402	-4453	0	0	0
'Rb'	'solid'	4.5857	-4215	0	0	313
'Rb'	'liquid'	4.312	-4040	0	0	0
'Cs'	'solid'	4.711	-3999	0	0	301.6
'Cs'	'liquid'	4.165	-3830	0	0	0
'Be'	'solid'	8.042	-17020	-0.444	0	1560
'Be'	'liquid'	5.786	-15731	0	0	0
'Mg'	'solid'	8.489	-7813	-0.8253	0	923
'Mg'	'liquid'	0	0	0	0	0
'Ca'	'solid'	10.127	-9517	-1.403	0	1112
'Ca'	'liquid'	0	0	0	0	0
'Sr'	'solid'	9.226	-8572	-1.1926	0	1042
'Sr'	'liquid'	0	0	0	0	0
'Ba'	'solid'	12.405	-9690	-2.289	0	1002
'Ba'	'liquid'	4.007	-8163	0	0	0
'Al'	'solid'	9.459	-17342	-0.7927	0	933
'Al'	'liquid'	5.911	-16211	0	0	0
'Ga'	'solid'	6.657	-14208	0	0	302.9
'Ga'	'liquid'	6.754	-13984	-0.3413	0	0
'In'	'solid'	5.991	-12548	0	0	429
'In'	'liquid'	5.374	-12276	0	0	0
'Tl'	'solid'	5.971	-9447	0	0	577
'Tl'	'liquid'	5.259	-9037	0	0	0
'Sn'	'solid'	6.036	-15710	0	0	508
'Sn'	'liquid'	5.262	-15332	0	0	0
'Pb'	'solid'	5.643	-10143	0	0	601
'Pb'	'liquid'	4.911	-9701	0	0	0
'Sc'	'solid'	6.65	-19721	0.2885	-0.3663	1812
'Sc'	'liquid'	5.795	-17681	0	0	0
'Y'	'solid'	9.735	-22306	-0.8705	0	1799
'Y'	'liquid'	5.795	-20341	0	0	0
'La'	'solid'	7.463	-22551	-0.3142	0	1190
'La'	'liquid'	5.911	-21855	0	0	0
'Ti'	'solid'	11.925	-24991	-1.3376	0	1930
'Ti'	'liquid'	6.358	-22747	0	0	0
'Zr'	'solid'	10.008	-31512	-0.789	0	2125
'Zr'	'liquid'	6.806	-30295	0	0	0
'Hf'	'solid'	9.445	-32482	-0.6735	0	2500
'Hf'	'liquid'	0	0	0	0	0
'V'	'solid'	9.744	-27132	-0.5501	0	2175
'V'	'liquid'	6.929	-25011	0	0	0
'Nb'	'solid'	8.822	-37818	-0.2575	0	2741
'Nb'	'liquid'	0	0	0	0	0
'Ta'	'solid'	16.807	-41346	-3.2152	0.7437	3269
'Ta'	'liquid'	0	0	0	0	0
'Cr'	'solid'	6.8	-20733	0.4391	-0.4094	2130
'Cr'	'liquid'	0	0	0	0	0
'Mo'	'solid'	11.529	-34626	-1.1331	0	2890
'Mo'	'liquid'	0	0	0	0	0
'W'	'solid'	2.945	-44094	1.3677	0	3695
'W'	'solid2'	-54.527	-57687	-12.2231	0	0
'Mn'	'solid'	12.805	-15097	-1.7896	0	1519
'Mn'	'liquid'	0	0	0	0	0
'Re'	'solid'	11.543	-40726	-1.1629	0	3450
'Re'	'liquid'	0	0	0	0	0
'Fe'	'solid'	7.1	-21723	0.4536	-0.5846	1808
'Fe'	'liquid'	6.347	-19574	0	0	0
'Ru'	'solid'	9.755	-34154	-0.4723	0	2520
'Ru'	'liquid'	0	0	0	0	0
'Os'	'solid'	9.419	-41198	-0.3896	0	3300
'Os'	'liquid'	0	0	0	0	0
'Co'	'solid'	10.976	-22576	-1.028	0	1768
'Co'	'liquid'	6.488	-20578	0	0	0
'Rh'	'solid'	10.168	-29010	-0.7068	0	2239
'Rh'	'liquid'	6.802	-26792	0	0	0
'Ir'	'solid'	10.506	-35099	-0.75	0	2716
'Ir'	'liquid'	0	0	0	00	0
'Ni'	'solid'	10.557	-22606	-0.8717	0	1726
'Ni'	'liquid'	6.666	-20765	0	0	0
'Pd'	'solid'	9.502	-19813	-0.9258	0	1825
'Pd'	'liquid'	5.426	-17899	0	0	0
'Pt'	'solid'	4.882	-29387	1.1039	-0.4527	2045
'Pt'	'liquid'	6.386	-26856	0	0	0
'Cu'	'solid'	9.123	-17748	-0.7317	0	1358
'Cu'	'liquid'	5.849	-16415	0	0	0
'Ag'	'solid'	9.127	-14999	-0.7845	0	1234
'Ag'	'liquid'	5.752	-13827	0	0	0
'Au'	'solid'	9.52	-19343	-0.7479	0	1337
'Au'	'liquid'	5.832	-18024	0	0	0
'Zn'	'solid'	6.102	-6776	0	0	692
'Zn'	'liquid'	5.378	-6286	0	0	0
'Cd'	'solid'	5.939	-5799	0	0	594
'Cd'	'liquid'	5.242	-5392	0	0	0
'Hg'	'solid'	0	0	0	0	234
'Hg'	'liquid'	5.116	-3190	0	0	0
'Ce'	'solid'	6.139	-21752	0	0	1071
'Ce'	'liquid'	5.611	-21200	0	0	0
'Pr'	'solid'	8.859	-18720	-0.9512	0	1204
'Pr'	'liquid'	4.772	-17315	0	0	0
'Nd'	'solid'	8.996	-17264	-0.9519	0	1016
'Nd'	'liquid'	4.912	-15824	0	0	0
'Sm'	'solid'	9.6988	-11034	-1.287	0	1345
'Sm'	'liquid'	0	0	0	0	0
'Eu'	'solid'	9.24	-9459	-1.1661	0	1095
'Eu'	'liquid'	0	0	0	0	0
'Gd'	'solid'	8.344	-20861	-0.5775	0	1585
'Gd'	'liquid'	5.557	-19389	0	0	0
'Tb'	'solid'	9.51	-20457	-0.9247	0	1630
'Tb'	'liquid'	5.411	-18639	0	0	0
'Dy'	'solid'	9.579	-15336	-1.1114	0	1680
'Dy'	'liquid'	0	0	0	0	0
'Ho'	'solid'	9.785	-15899	-1.1753	0	1740
'Ho'	'liquid'	0	0	0	0	0
'Er'	'solid'	9.916	-16642	-1.2154	0	1795
'Er'	'liquid'	4.668	-14380	0	0	0
'Tm'	'solid'	8.882	-1227	-0.9564	0	1818
'Tm'	'liquid'	0	0	0	0	0
'Yb'	'solid'	9.111	-8111	-1.0849	0	1097
'Yb'	'liquid'	0	0	0	0	0
'Lu'	'solid'	8.793	-22423	-0.62	0	1936
'Lu'	'liquid'	5.648	-20302	0	0	0
'Th'	'solid'	8.668	-31483	-0.5288	0	2028
'Th'	'liquid'	-18.453	-24569	6.6473	0	0
'Pa'	'solid'	10.552	0.34869	-1.0075	0	1870
'Pa'	'liquid'	6.177	32874	0	0	0};	

name=d(1:end,1);
pam=d(1:end,3:end);
idx=find(strcmp(element,name));
idx = idx(1);
Tmelt=pam{idx,5};
Ts = (298:Tmelt)';

Tl =(Tmelt:min(3000,Tmelt+1000))';

logP_solid = pam{idx,1} + pam{idx,2}./Ts + pam{idx,3}*log10(Ts) + pam{idx,4}./(Ts.^3);
idx = idx+1;
logP_liq =  pam{idx,1} + pam{idx,2}./Tl + pam{idx,3}*log10(Tl) + pam{idx,4}./(Tl.^3);

S = logP_solid;
L = logP_liq;
if length(Tl)>0;
    plot(Ts,logP_solid,Tl,logP_liq);
else
    plot(Ts,logP_solid);
end
ylim([max(-20,min(logP_solid)),0]);
xlim([290,max([Ts;Tl])*1.05]);
xlabel('Temperature, K ');
ylabel('Log(Vapor Pressure/atm) ');
h = legend('Solid','liquid');
pos = get(h,'position');
set(h,'Position',[.2,pos(2:4)]);
grid on;

title(sprintf('Log(Vapor Pressure/atm) vs Temp for %s ',name{idx,1}));
%legend(sprintf('%s Solid',name{idx,1}));
fprintf(1,'%s\n', name{idx,1});
L = [Tl,L];
S = [Ts,S];

    