AstroNbodySim.jl icon indicating copy to clipboard operation
AstroNbodySim.jl copied to clipboard

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

Open martinmestre opened this issue 1 year ago • 4 comments

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 avatar Feb 01 '24 15:02 martinmestre

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.

martinmestre avatar Feb 01 '24 16:02 martinmestre

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

islent avatar Feb 02 '24 15:02 islent

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 ?

martinmestre avatar Feb 02 '24 15:02 martinmestre

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

islent avatar Feb 03 '24 14:02 islent