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

How to allow update of [email protected] in the family of AstroNbodySim.jl codes ? #11

Open
martinmestre opened this issue Feb 1, 2024 · 4 comments

Comments

@martinmestre
Copy link

Hello,
I am trying to perform this example: https://juliaastrosim.github.io/AstroNbodySim.jl/dev/examples/05-plummer/
but there is an error that I have tracked to CSV version. According to Julia Discourse, I should update to a higher version but the code AstroIO, AstroPlots, etc has restrictions. How could I do to update CSV in order to run the example?
Thank you very much.
Best.

@martinmestre
Copy link
Author

Hi, I have an additional question. Do you know why in that same example, the softening length is set to a value of 0.0177 kpc by the algorithm even though the Plummer scale is only 0.01 kpc ? I would have expected a much smaller softening length, much smaller than the average interparticle distance. Thanks for any comment.

islent referenced this issue in JuliaAstroSim/AstroIO.jl Feb 2, 2024
islent referenced this issue in JuliaAstroSim/AstroPlot.jl Feb 2, 2024
@islent
Copy link
Member

islent commented Feb 2, 2024

there is an error that I have tracked to CSV version

I have updated upper bounds of CSV version to v0.10. Have a try!

the softening length is set to a value of 0.0177 kpc by the algorithm even though the Plummer scale is only 0.01 kpc

The softening lengths in Plummer example (numbered 03 in @v0.1.1) is set by suggest_softlen!, which simple use the averaged seperation length cbrt(Volumn / number of particles). To use a preferred softening length, you can use set_softlen!, as compared:

suggest_softlen!(sim)  # where you got 0.0177 kpc

set_soflen!(sim, 0.001u"kpc")  # or anything you want

@martinmestre
Copy link
Author

Thanks for you answers and solutions. Just to know I understand, do you know why the code is suggesting such a large value of softening for this case of Plummer sphere with virial radius of 0.01 kpc ?

@islent
Copy link
Member

islent commented Feb 3, 2024

do you know why the code is suggesting such a large value of softening for this case of Plummer sphere with virial radius of 0.01 kpc ?

image

In the Plummer example, the softening lengths are suggested as cbrt(V / N), where V is volumn, and N is the number of particles. The definition is arbitrary. Feel free to change it with set_softlen!

The softening lengths in Plummer example (numbered 03 in @v0.1.1) is set by suggest_softlen!, which simple use the averaged seperation length cbrt(Volumn / number of particles). To use a preferred softening length, you can use set_softlen!

The definitions of above functions locate here:
https://github.com/JuliaAstroSim/AstroNbodySim.jl/blob/main/src/tools/SofteningLength.jl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants