Exemplo n.º 1
0
from getBoundary import getBoundary
from solveBC import sweep, findrho
from printStatus import printRatio
import numpy as np
import pylab as pl
from fig import fig, saveFig, printText

a2s=np.logspace(-4,4,60)
y1s,y2s=[],[]
Tr=2
for i in range(len(a2s)):
    a2=a2s[i]
    printRatio(i,len(a2s))
    bbs,sols=sweep(lambda x,y:getBoundary(x,y,[0,a2]),[1e-6],oscN=1)
    
    rho=-np.array(bbs)[:,:,1,1].real
    rhoc=min([min(r) for r in rho])#rho, in units used at Tc

    rho=rhoc/Tr**2
    zh=1
    T=3./(zh*4.*np.pi)
    Tc=T*np.sqrt(rho/rhoc)


    bb,osc=getBoundary(1,0,[0,a2])
    guess=rho/(-bb[1][1])
    from scipy.optimize import fsolve
    hphi=fsolve(lambda hphi:rho+getBoundary(hphi,0,[0,a2])[0][1][1], guess)

    w=1e-3*Tc
    bb,osc=getBoundary(hphi,0,[w,a2])
Exemplo n.º 2
0
import numpy as np
import pylab as pl
from fig import fig, saveFig, printText, getPlotY
from printStatus import printRatio
from pickle import load, dump

hpsis = np.logspace(-6, 1.5, 300)
a2 = 0.1
plotImag = False  # True
from solveBC import sweep, findrho

try:
    bbs, sols = load(open("cache/sols_a2=" + str(a2)))
except IOError:
    print("Solve for sweep of different horizon BCs...")
    bbs, sols = sweep(lambda x, y: getBoundary(x, y, [0, a2]), hpsis, oscN=1, status=True)
    dump((bbs, sols), open("cache/sols_a2=" + str(a2), "w"))

rho = -np.array(bbs)[:, :, 1, 1].real
rhoc = min([min(r) for r in rho])  # rho, in units used at Tc

fig(11)
if a2 == 0:
    Trs = [1.0, 0.9, 0.5, 0.05]
else:
    Trs = [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3]
    # Trs=[0.1,0.3,0.5,0.7,0.9,1.1]
    # Trs=np.linspace(0.23,0.4,8)
zh = 1
T = 3.0 / (zh * 4.0 * np.pi)
# wvs= np.logspace(0,1.5,40)/15.