コード例 #1
0
ファイル: campaign007.py プロジェクト: colinmcnally/chains
 def __init__(self):
     p = {
         'aspectratio0': 0.035,
         'sigma0': 3.8e-4 * 0.5 * 1.4,
         'redge': 0.1,
         'a0': 0.102,
         'deltaredge': 0.001,
         'alpha': 1.5,
         'flaringindex': 2.0 / 7.0,
         'ffudge': 1.0 / 100.0,
         'tdep': 2e6 * keplertime,
         'deltatdep': 2e6 * keplertime,
         'pmass': 3.16227766e-05,
         'nchain': 4,
         'q_res': 1,
         'p_res': 4,
         'seq': 0,
         'collision': 'direct',
         'G': 1.0,
         'starmass': 1.0,
         'integrator': 'WHFAST',
         'integrator_dt': 1e-2 * keplertime,
         'snap_wall_interval': 15 * 60,
         'incscatter': np.pi / 100.0,
         'aspread': 0.01
     }
     p['physical_outputs'] = [p['tdep'], p['tdep'] + p['deltatdep']]
     # try an empirical scaling of aspread
     p['aspread'] = (0.04) * (np.log(p['pmass']) - np.log(1e-6)) / (
         np.log(1e-5) - np.log(1e-6)) + 0.01
     nmodels = 10
     nchains = range(5, 11)
     p_ress = range(3, 5)
     p_resind = self.new_index()
     counter = 0
     for p_res in p_ress:
         p['p_res'] = p_res
         nchainind = self.new_index()
         for nchain in nchains:
             p['nchain'] = nchain
             #make a bunch of realizations of the same model, with randomized phases
             seqind = self.new_index()
             for i in range(0, nmodels):
                 p['seq'] = i
                 print('{} p_res {}, nchain {} seq {}'.format(
                     counter, p['p_res'], p['nchain'], p['seq']))
                 c = chaincalc.Model(p)
                 self.add_model(c)
                 seqind[i] = c.hash
                 counter += 1
             nchainind[nchain] = {'seq': seqind}
         p_resind[p_res] = {'nchain': nchainind}
     self.indexes['p_res'] = p_resind
コード例 #2
0
ファイル: testmodel.py プロジェクト: colinmcnally/chains
def runtest(p):
    c = chaincalc.Model(p, verbose=True)

    c.init_rebound()

    print(c.hash)
    print(c.sim.status())

    c.set_wall_start(wall_start)
    try:
        c.sim.integrate(10000.0)
    except rebound.Collision:
        c.mark_collision()
    else:
        c.manual_snapshot()
    print('')
コード例 #3
0
 def __init__(self):
     p = {
         'aspectratio0': 0.035,
         'sigma0': 3.8e-4,
         'redge': 0.1,
         'a0': 0.11,
         'deltaredge': 0.001,
         'alpha': 1.0,
         'flaringindex': 2.0 / 7.0,
         'ffudge': 1.0 / 100.0,
         'tdep': 1e1,
         'deltatdep': 1e1,
         'pmass': 1e-5,
         'nchain': 4,
         'q_res': 1,
         'p_res': 4,
         'seq': 0,
         'collision': 'line',
         'G': 1.0,
         'starmass': 1.0,
         'integrator': 'WHFASTUNSAFE11',
         'integrator_dt': 1e-2 * 2 * np.pi * 0.1**1.5,
         'snap_wall_interval': 15,
         'incscatter': np.pi / 100.0,
         'aspread': 0.05
     }
     p['physical_outputs'] = [1e0, 1e1, 1e2]
     #make a bunch of realizations of the same model, with randomized phases
     nmodels = 10
     nchains = range(5, 11)
     nchainind = self.new_index()
     for nchain in nchains:
         seqind = self.new_index()
         for i in range(0, nmodels):
             p['seq'] = i
             c = chaincalc.Model(p)
             print(c.hash)
             self.add_model(c)
             seqind[i] = c.hash
         nchainind[nchain] = seqind
     self.indexes['nchain'] = nchainind