-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestlookupucold.py
53 lines (39 loc) · 1.3 KB
/
testlookupucold.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""
This script produces a plot of the cold curve for the Tillotson EOS.
"""
from matplotlib import *
rcParams['font.family'] = 'serif'
from matplotlib.patches import *
from numpy import *
from matplotlib.pyplot import *
# Load the whole lookup table
data = loadtxt('lookup.txt')
# Load interpolated values
data2 = loadtxt('testlookupucold.txt')
rho = data2[:,0]
u = data2[:,1]
# Plot the lookup table
for i in range(1,size(data[:,0]),1):
plot(data[:,0],data[:,i],'-',color='red',markersize=1,label='Table')
scatter(rho,u,s=16,color='green',label='Lookup')
#drho = 0.100376
#for i in arange(0,size(data[:,0])*drho,drho):
# plot([i,i],[0,1000],'--',color='cyan',markersize=1)
xmax = 25
ymax = 25
xlim(0,xmax)
ylim(0,ymax)
#title('The Tillotson equation of state')
xlabel('Density')
ylabel('Internal energy')
#plot(rho,u,'.',color='blue',markersize=1,label='Lookup')
#plot(rho,u,'-',color='blue',linewidth=1,label='Lookup table')
#fill_between(rhocold,ucold,color='orange')
#plot([0,rho0],[us,us],'r--')
#plot([0,rho0],[us2,us2],'r--')
#plot([rho0,rho0],[0,25],'r--')
#xticks([0,rho0,2*rho0,3*rho0],[r'$0$',r'$\rho_0$',r'$2\rho_0$',r'$3\rho_0$'])
#xticks([0,rho0],[r'$0$',r'$\rho_0$'],size='large')
#yticks([0,us,us2],[r'$0$',r'$u_{IV}$',r'$u_{CV}$'],size='large')
#savefig('lookup.pdf')
savefig('testlookupucold.png')