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') ax.legend(loc=3) axes[2].plot([tmin,tmax],[1,1],ls='--') axes[3].set_xlabel('R/kpc') plt.show()
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): #ax.set_xlim((tmin,tmax)) if i != 3: ax.set_xlabel('t/Myr') else: ax.set_xlabel('R/kpc') ax.set_ylabel(ylabs[i]) ax.legend(loc=0) axes[2].plot([tmin, tmax], [1, 1], ls='--') plt.show()
# Example dwarf galaxy profile from constants import * from solver import Evolve_RG import numpy as np import os.path xi = 0.4 q = 2.1 env = Evolve_RG('beta', kT=1e4 * boltzmann, p0=10**0.75 * 3.1e-16, rc=0.8 * kpc, beta=0.67, xi=xi, q=q) outname = 'dwarf.pickle' tmin = 0 tmax = 100 tv = np.logspace(-5, np.log10(tmax), 100) * Myr Q = 1e35 env.solve(Q, tv) env.save(outname) env.findb() env.findsynch(150e6) env.findcorrection((150e6, 330e6, 1.4e9, 5e9, 8e9, 15e9), do_adiabatic=True) env.save(outname)
import pickle import os from constants import * from solver import Evolve_RG if __name__ == '__main__': import sys number = int(sys.argv[1]) - 1 qnum = number // 10 mnum = number % 10 print qnum, mnum tmin = 0 tmax = 500 tv = np.logspace(-6, np.log10(tmax), 100) * Myr Qs = np.logspace(36, 40, 13) masses = np.logspace(13, 15, 10) Q = Qs[qnum] m = masses[mnum] print 'Doing the run for Q=', Q, 'M=', m env = Evolve_RG('universal', M500=m, xi=0.40, q=2.1) outfile = 'save_%.1f_%.1f.pickle' % (np.log10(Q), np.log10(m)) if not os.path.isfile(outfile): print 'solving for', Q, m env.solve(Q, tv) env.findb() env.findsynch(150e6) env.findcorrection((150e6, 1400e6), do_adiabatic=True) env.save(outfile)
#!/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)