Example #1
0
def mDustTot(ro,ri=0.35, alpha=1.5,sigcoef=1.,rice=2.7):
	'''Calculate the mass of a dust disk using the Hayashi slope formula.'''

	import numpy as np
	import JangCondell as J
	from numpy import pi
	from cgs_constants import mEarth, mSun, AU

### Densities, breakpoints from Hayashi '81 paper
	rho = sigcoef*np.array([7.1, 30., 1700.])
	rin  = 0.35	# inner edge
	rice = rice	# ice line
	rout = 36.	# outer edge

### Inside ice line
	if (ri < rice):
		ri1 = max( min(ri, rice), rin)
		ro1 = min( max(ro,  rin), rice)
		mDust1 = J.mDust( ro1,ri1,alpha=alpha, sigma0cgs=rho[0] ) 
	else:
		mDust1 = 0.
		print('no inner disk')

### Outside ice line
	if (ro > rice):
		ri2 = max( ri, rice)
		ro2 = min( ro, rout)
		mDust2 = J.mDust( ro2,ri2,alpha=alpha, sigma0cgs=rho[1] ) 
	else:
		mDust2 = 0.
		print('no outer disk')

### Gas component
	rig = max( ri, rin)
	rog = min( ro, rout)
	mGas   = J.mDust( rog,rig,alpha=alpha, sigma0cgs=rho[2] ) 

### Total solid mass
#	mDust = mDust1+mDust2

	return [mDust1, mDust2, mGas]
Example #2
0
def mDustTot(ro, ri=0.35, alpha=1.5, sigcoef=1., rice=2.7):
    '''Calculate the mass of a dust disk using the Hayashi slope formula.'''

    import numpy as np
    import JangCondell as J
    from numpy import pi
    from cgs_constants import mEarth, mSun, AU

    ### Densities, breakpoints from Hayashi '81 paper
    rho = sigcoef * np.array([7.1, 30., 1700.])
    rin = 0.35  # inner edge
    rice = rice  # ice line
    rout = 36.  # outer edge

    ### Inside ice line
    if (ri < rice):
        ri1 = max(min(ri, rice), rin)
        ro1 = min(max(ro, rin), rice)
        mDust1 = J.mDust(ro1, ri1, alpha=alpha, sigma0cgs=rho[0])
    else:
        mDust1 = 0.
        print('no inner disk')

### Outside ice line
    if (ro > rice):
        ri2 = max(ri, rice)
        ro2 = min(ro, rout)
        mDust2 = J.mDust(ro2, ri2, alpha=alpha, sigma0cgs=rho[1])
    else:
        mDust2 = 0.
        print('no outer disk')

### Gas component
    rig = max(ri, rin)
    rog = min(ro, rout)
    mGas = J.mDust(rog, rig, alpha=alpha, sigma0cgs=rho[2])

    ### Total solid mass
    #	mDust = mDust1+mDust2

    return [mDust1, mDust2, mGas]
Example #3
0
def DiskTable():
    '''Calculate dust mass in truncated disks for a suite of parameters'''

    import numpy as np
    import JangCondell as J
    from numpy import pi
    from cgs_constants import mEarth, mSun, AU

    ### Parameters
    rice = np.array([2.5, 2.7, 3.])
    sigcoef = np.array([1 / 3., 1., 3.])
    alpha = np.array([1., 1.5])
    rtr = np.array([2.54, 2.77])

    ### Make 3x3x2x2 array, fill with mDust for above parameters
    ind = np.zeros(shape=(len(rtr), len(alpha), len(sigcoef), len(rice)))
    M = np.zeros(shape=(len(rtr), len(alpha), len(sigcoef), len(rice)))
    counter = 0
    for l in range(len(rtr)):
        for k in range(len(alpha)):
            for j in range(len(sigcoef)):
                for i in range(len(rice)):
                    counter = counter + 1
                    ind[l, k, j, i] = counter
                    mTot = J.mDustTot(ro=rtr[l],
                                      alpha=alpha[k],
                                      sigcoef=sigcoef[j],
                                      rice=rice[i])
                    M[l, k, j, i] = mTot[0] + mTot[1]

### Collapse over two dimensions
    M = np.hstack((M[:, 0, :, :], M[:, 1, :, :]))
    M = np.hstack((M[0, :, :], M[1, :, :]))

    np.savetxt("../Paper/Inserts/DiskMassTable.tex",
               M,
               fmt='%2.2f',
               delimiter=' & ',
               newline=' \\\\\n')

    return (M)
Example #4
0
def DiskTable():
	'''Calculate dust mass in truncated disks for a suite of parameters'''

	import numpy as np
	import JangCondell as J
	from numpy import pi
	from cgs_constants import mEarth, mSun, AU


### Parameters
	rice    = np.array([ 2.5, 2.7, 3.])
	sigcoef = np.array([1/3.,  1., 3.])
	alpha   = np.array([  1., 1.5])
	rtr     = np.array([2.54, 2.77])

### Make 3x3x2x2 array, fill with mDust for above parameters
	ind = np.zeros( shape=( len(rtr), len(alpha), len(sigcoef), len(rice) ) )
	M   = np.zeros( shape=( len(rtr), len(alpha), len(sigcoef), len(rice) ) )
	counter=0
	for l in range(len(rtr)):
		for k in range(len(alpha)):
			for j in range(len(sigcoef)):
				for i in range(len(rice)):
					counter=counter+1
					ind[l,k,j,i] = counter
					mTot = J.mDustTot(
				ro=rtr[l], alpha=alpha[k],sigcoef=sigcoef[j],rice=rice[i])
					M[l,k,j,i] = mTot[0]+mTot[1]

### Collapse over two dimensions
	M = np.hstack(( M[:,0,:,:], M[:,1,:,:] )) 
	M = np.hstack(( M[0,:,:],   M[1,:,:]   )) 

	np.savetxt("../Paper/Inserts/DiskMassTable.tex", M, 
		fmt = '%2.2f', delimiter=' & ', newline=' \\\\\n')

	return(M)