Giter VIP home page Giter VIP logo

baryonic-effects-on-pal5's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

baryonic-effects-on-pal5's Issues

Fix coordinate shift due to moved progenitor in bar potential

Hi Nil,

Looking through your code again, I think I've found an issue with how the stripped (x,v) is computed using the perturbed progenitor, in this line:

pert_orb=(np.array(unp_orb) - np.array(pal5_orb_nobar)) + np.array(pal5_orb_bar)

_vxvv is in cylindrical coordinates, but vector addition in cylindrical coordinates is not just a simple component-wise addition. Easiest way to do this is probably to extract the rectangular coordinates, as

unp_orb=numpy.array([o.x(ts[-1]),o.y(ts[-1]),o.z(ts[-1]),-o.vx(ts[-1]),-o.vy(ts[-1]),-o.vz(ts[-1])])
pal5_orb_bar= numpy.array([pal5_bar.x(ts[-1]),pal5_bar.y(ts[-1]),pal5_bar.z(ts[-1]),-pal5_bar.vx(ts[-1]),-pal5_bar.vy(ts[-1]),-pal5_bar.vz(ts[-1])])
pal5_orb_nobar= numpy.array([pal5_nobar.x(ts[-1]),pal5_nobar.y(ts[-1]),pal5_nobar.z(ts[-1]),-pal5_nobar.vx(ts[-1]),-pal5_nobar.vy(ts[-1]),-pal5_nobar.vz(ts[-1])])

(note that I do the velocity fliiping explicitly here), then

pert_orb= unp_orb - pal5_orb_nobar + pal5_orb_bar

and then convert this cartesian coordinate set to cylindrical

pert_orb_RpZ= bovy_coords.rect_to_cyl(pert_orb[0],pert_orb[1],pert_orb[2])
pert_orb_vRpZ= bovy_coords.rect_to_cyl_vec(pert_orb[3],pert_orb[4],pert_orb[5]),pert_orb[0],pert_orb[1],pert_orb[2])
pert_orb=Orbit([pert_orb_RpZ[0],pert_orb_vRpZ[0],pert_orb_vRpZ[1],pert_orb_RpZ[2],pert_orb_vRpZ[2],pert_orb_RpZ[1]])

Please check this code before implementing it, because I've only written it, not tested it...

Vary Mbar

Explore the effects of varying Mbar = 5x10^9 and 2x10^10 Msun and add the results.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.