예제 #1
0
tmin = 10**-6
tmax = 300
tv = np.logspace(np.log10(tmin), np.log10(tmax), 100) * Myr

env = Evolve_RG('beta',
                kT=0.86e3 * eV,
                p0=2e-12,
                rc=22 * 1.528714 * kpc,
                beta=0.67,
                do_adiabatic=False,
                q=2.1)
#env=evolve_rg('universal',M500=1e14)
for Q in np.logspace(37.5, 39.5, 5):
    print('solving for jet power', Q, 'W')
    env.solve(Q, tv)
    env.findb()
    env.findsynch(150e6)
    env.findcorrection((150e6, ))

    axes[0].plot(tv / Myr, env.R / kpc, label='Q = %.2g W' % Q)
    axes[1].plot(tv / Myr, env.rlobe, label='Q = %.2g W' % Q)
    axes[2].plot(tv / Myr, env.m1, label='Q = %.2g W' % Q)
    axes[3].plot(env.R / kpc,
                 env.synch * env.corrs[:, 0],
                 label='Q = %.2g W' % Q)

    env.save('save_%.1f.pickle' % np.log10(Q))
#axis1.set_ylim(R/kpc/5,5*R/kpc)
#axis2.set_ylim(enow/5,enow*20)
for i, ax in enumerate(axes):
예제 #2
0
naxes=4
for i in range(naxes):
    axes.append(plt.subplot(naxes/2,naxes/2,i+1))
for ax in axes:
    ax.set_xscale('log')
    ax.set_yscale('log')

tmin=0
tmax=300
tv=np.logspace(-6,np.log10(tmax),100)*Myr

#env=evolve_rg('universal',M500=1e14)
Q=10**38.5
for i in range(2):
    env=Evolve_RG('beta',kT=0.86e3*eV,p0=2e-12,rc=22*1.528714*kpc,beta=0.67,do_adiabatic=True,q=2.1)
    env.solve(Q,tv,tstop=Myr*(tmax-(i*200)))
    env.findb()
    env.findsynch(150e6)
    env.findcorrection((150e6,))

    axes[0].plot(tv/Myr,env.R/kpc)
    axes[1].plot(tv/Myr,env.rlobe,label='i = %i' % i)
    axes[2].plot(tv/Myr,env.m1)
    axes[3].plot(env.R/kpc,env.synch*env.corrs[:,0])

    env.save('save_tstop_%i.pickle' % i)
#axis1.set_ylim(R/kpc/5,5*R/kpc)
#axis2.set_ylim(enow/5,enow*20)
for ax in axes[0:3]:
    ax.set_xlim((tmin,tmax))
    ax.set_xlabel('t/Myr')
예제 #3
0
#!/usr/bin/python

from solver import Evolve_RG
from astropy.table import Table
import sys
from constants import *
import os

t = Table.read('source-table.txt', format='ascii')
lookback = 1000

n = int(sys.argv[1])
r = t[n]
print r
env = Evolve_RG('universal', M500=r['M500'], xi=0.40, q=2.1)
tlimit = lookback - r['Tstart']
tv = np.logspace(-6, np.log10(tlimit), 100) * Myr
outfile = 'run-%i.pickle' % n
if not os.path.isfile(outfile):
    env.solve(r['Q'], tv, tstop=r['lifetime'] * Myr)
    env.findb()
    env.findsynch(150e6)
    env.findcorrection((150e6, 150e6 * (1 + r['z']), 1400e6 * (1 + r['z'])),
                       do_adiabatic=True,
                       z=r['z'],
                       timerange=(99, ))
    env.save('run-%i.pickle' % n)