Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsothermalDiskPotential amplitude error #400

Closed
morganb-phys opened this issue Sep 16, 2019 · 0 comments
Closed

IsothermalDiskPotential amplitude error #400

morganb-phys opened this issue Sep 16, 2019 · 0 comments
Labels
Milestone

Comments

@morganb-phys
Copy link
Contributor

The code below shows that when you call IsothermalDiskPotential, the second derivative does not give the amplitude (density) entered when the potential is initialized. However, pot._evaluate() does give the correct amplitude.

from galpy.potential import IsothermalDiskPotential,turn_physical_off
import numpy as np

z= np.linspace(-0.1,0.1,10001)
pot= IsothermalDiskPotential(amp=0.1, sigma=20.5/220.)
turn_physical_off(pot)

p1= 1./(np.pi*4)*np.gradient(np.gradient(pot(z),z),z)
p2= 1./(np.pi*4)*np.gradient(np.gradient(pot._evaluate(z),z),z)

print(p1[5000]) #Result is: 0.01
print(p2[5000]) #Result is: 0.1
@jobovy jobovy added the bug label Oct 28, 2019
@jobovy jobovy added this to the v1.6 milestone Oct 28, 2019
@jobovy jobovy closed this as completed in 050b6c0 Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants