Comments (2)
I think it's a confusion with units.
If you plot the circular-velocity curve of the original potential, plt.plot(r, (-r*galapot.Rforce(r, r*0))**0.5)
, it has a peak around 6, same as the red curve in your plot. Since the NFW potential has a peak circular velocity at ~2.2 times its scale length, this corresponds to 55 kpc, or ~6.2 in the "native" Galpy length units of 8 kpc. But if you call galapot.Rforce(r * u.kpc, r*0)
, it apparently perform the conversion from astropy dimensional units to its internal units.
Now it seems to me that even when you call galapot.plotRotcurve
with a plain numpy array, it still assumes that the radii are provided in kpc, not in units of 8kpc, that's why the blue curve reaches the peak well beyond the right margin of the plot.
And if you create a pure Agama NFW potential with a scale length of 25 (presumably, kpc, though it is never specificed), its circular velocity will peak at 2.2 times that value, as expected - that's the green dashed line in your plot (mislabelled as "from Galpy", whereas it comes from a pure Agama potential).
I don't understand how Galpy deals with units when mixing astropy.units with its native ones, so it seems that the most straightforward (if awkward) approach is to stick to the length unit of 8kpc and velocity unit of 220 km/s (and not to forget to call agama.setUnits(length=8, velocity=220, mass=1)
at the beginning of the script to instruct Agama to use the same units). Then if you interpret the x axis in terms of units of 8kpc, not 1 kpc, everything should match and peak at x=6.2
from agama.
First of all, yep, you are right: I put the labels in the wrong order.
Having said that, I think it is not worth losing any sleep over this since it is indeed a problem with units, and Galpy is too opaque for me to try and figure it out.
Thank you for the clarification! And sorry for the silly question jeje
from agama.
Related Issues (20)
- explicitly including G in the calculation of Toomre Q in the example? HOT 1
- Generating rotating star clusters HOT 10
- Sampling refinement procedure error HOT 3
- central density of King profile HOT 2
- Gadget-4 plugin HOT 1
- Example python scripts do not work on newer python versions HOT 4
- document of Einasto profile HOT 2
- Versioned tag or release plan HOT 3
- Logarithmic potential energy HOT 7
- GOMP version issue via python 3.9.8 (agama 1.0) HOT 3
- Kernel dies when using AGAMA after importing sklearn HOT 5
- About the tolerance of the Torus Mapper fitting HOT 2
- Windows Installation not working HOT 2
- compilation fails on CentOS HOT 1
- Error in ActionFinder initialization: Interpolator: energy or angular momentum of a circular orbit are not monotonic HOT 3
- "NumPy is not present" when installing via 'pip' HOT 4
- Issue with Mac OS installation HOT 14
- Update `setup.py` to remove deprecated `distutils` dependency HOT 4
- Compilation error of test_fortran on Apple Sequoia 15.0 Apple M3 Pro HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agama.