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

Make the parameters in the NG force law of Marsden+73 user-defined #112

Open
federico-spada opened this issue Nov 7, 2024 · 6 comments · May be fixed by #113
Open

Make the parameters in the NG force law of Marsden+73 user-defined #112

federico-spada opened this issue Nov 7, 2024 · 6 comments · May be fixed by #113

Comments

@federico-spada
Copy link

federico-spada commented Nov 7, 2024

The parameters "alpha," "nk," "nm," "nn," and "r0" in the g(r) function defining the NG force are currently hard-coded.

For work on long-period comets orbits, it would be very helpful if these parameters could be user-defined, perhaps through extras.particle_params. Calculating derivatives wouldn't probably be necessary, as these parameters are fixed in typical use-cases focused on fitting A1, A2, and A3 for specific values of alpha, nk, nm, nn, r0 (e.g., 0.1113, 4.6142, 2.15, 5.093, 2.808; Marsden et al. 1973).

@hannorein
Copy link
Collaborator

Does your use case require you to use a different set of values for each particle or is one set for the entire simulation good enough? The former is a bit harder to implement in an efficient way.

@federico-spada
Copy link
Author

For my use case, one set of values for the entire simulation is perfectly fine.

@hannorein
Copy link
Collaborator

Then one could just add them directly in the assist_extras struct (not in the particle_params struct). Are you ok doing that yourself? If not, I can provide a patch. Note that if you're using python, you also need to update the structure in the python code.

FWIW, there are better ways to do this (see e.g. how REBOUNDx handles particle specific parameters) but I'd hesitate to do anything like this here. The amount of extra work does not seem justified. And anything more complicated could affect the performance.

@federico-spada
Copy link
Author

Hi Hanno, thank you very much for your prompt replies and for offering your help! I would really appreciate it if you could make the changes yourself when you have some time. I do not feel comfortable with handling the interactions between C and Python.

@hannorein hannorein linked a pull request Nov 7, 2024 that will close this issue
@hannorein
Copy link
Collaborator

No problem. See these changes here:

https://github.com/matthewholman/assist/pull/113/files

@federico-spada
Copy link
Author

Perfect, thank you very much!

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

Successfully merging a pull request may close this issue.

2 participants