[yt-users] Angular momentum with a general axis

Junhwan Choi choi.junhwan at gmail.com
Wed Jun 4 20:37:05 PDT 2014



> On Jun 4, 2014, at 4:34 PM, Matthew Turk <matthewturk at gmail.com> wrote:
> 
> Hi Junhwan,
> 
> On Wed, Jun 4, 2014 at 1:54 PM, Junhwan Choi (최준환)
> <choi.junhwan at gmail.com> wrote:
>> On Wed, Jun 4, 2014 at 11:20 AM, Matthew Turk <matthewturk at gmail.com> wrote:
>>> Hi Junhwan,
>>> 
>>> On Tue, Jun 3, 2014 at 10:38 PM, Junhwan Choi (최준환)
>>> <choi.junhwan at gmail.com> wrote:
>>>> Hi yt users,
>>>> 
>>>> I wrote basic yt script to make Jz profile of my simulation as follow:
>>>> ======
>>>> import matplotlib as matplotlib
>>>> matplotlib.use('Agg')
>>>> from yt.mods import *
>>>> import matplotlib.pyplot as plt
>>>> 
>>>> Nbin = 75
>>>> rmax = 1200 # in pc
>>>> index = 60
>>>> 
>>>> pf = load("../DD%04d/DD%04d" % (index,index))
>>>> rmin = [1e-4,2.0*pf.h.get_smallest_dx()*pf.units['pc']]
>>>> sphere = pf.h.sphere(center, (rmax, 'pc'))
>>>> bulk_velocity = sphere.quantities['BulkVelocity']()
>>>> sphere.set_field_parameter('bulk_velocity', bulk_velocity)
>>>> 
>>>> profile = BinnedProfile1D(sphere, Nbin, "Radiuspc", max(rmin), rmax,
>>>> log_space=True, lazy_reader=True, end_collect=False)
>>>> profile.add_fields('AngularMomentumZ',weight=None)
>>>> profile.add_fields('Radius',weight=None)
>>>> 
>>>> plt.loglog(profile['Radiuspc'],
>>>> profile['AngularMomentumZ'],label='t=%4.2fMyr' %
>>>> (pf.current_time*7.26), linestyle="-",color='b')
>>>> plt.xlabel('r [pc]')
>>>> plt.ylabel(r'j ($\rm{cm}^2/\rm{s}$)',fontsize=17)
>>>> plt.xlim(1e-4,1000)
>>>> plt.legend(loc=4, prop={'size':10})
>>>> plt.savefig('jprof2K_%04d' % index)
>>>> =========
>>>> 
>>>> Now I would like to compute the AngularMomentum not according to x,
>>>> y,and z but according to a general axis (i.e. angular momentum axis).
>>>> Is there any simple way in yt to compute the AngularMomentum according
>>>> to the general axis?
>>> 
>>> My reading of this is that what you want to do is compute:
>>> 
>>> L = r [x] mv
>>> 
>>> (provided by yt) and then compute your final L vector as:
>>> 
>>> L' = L [x] mv
>>> 
>>> is that right?  This would then be:
>>> 
>>> (r [x] mv) [x] mv
>>> 
>>> which I'm not really sure is what you're looking for, right?  Can you
>>> describe your desired result in vector notation?
>> I would like to compute the L_{rot} means the angular momentum
>> regarding to rotating axis.
>> Hence, what I am looking for as in vector notation would be the following.
>> First (as you think), compute L as
>> 
>> L = r[x]mv
>> 
>> and compute the rotation matrix (Omega) that satisfies
>>                             | 0 |
>> Omega odot L/|L| = | 0 |
>>                             | 1 |
>> 
>> [Means the rotation matrix that rotate L vector to (0,0,1)]
>> and compute
>> 
>> L' = (Omega odot r) [x] (Omega odot mv)
>> 
>> From L', I can get L'_z that is L_{rot}.
> 
> Does this help?
> 
> http://planetmath.org/rotationalinvarianceofcrossproduct
> 
> My reading is that if you have a proper rotation matrix for Omega, L'
> = Omega odot L.
> 
> -Matt
> 

Thank you matt.
I will try what you suggest.
Junhwan


>> Thank you,
>> Junhwan
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org



More information about the yt-users mailing list