-
Notifications
You must be signed in to change notification settings - Fork 3
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
adding an exponential disk + Hernquist bulge model #103
base: main
Are you sure you want to change the base?
Conversation
Just to make sure I understand: you want a cylindrical basis that has a biorthogonal basis whose lowest order basis function that is the sum of a exponential basis and Hernquist-model bulge? So the idea is that you want to simulate a single component disk with this new profile? |
Is there some reason that this can not be accommodated by adding a separate bulge component? |
Indeed - I would like the lowest order basis function to be the sum of a disk and a bulge. I do not intend to run simulations with this basis, I want to use this basis to analyze cosmological simulations. I had initially started off with separate disks and bulges, but then I would need to assign stars to the disk or to the bulge which created a new set of problems. I figured that a single basis would be more straightforward - I can just determine the disk + bulge properties from density fits and describe the total stellar potential with this one basis (Mike also suggested this!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice changes! I think just a little tweak to make.
utils/ICs/cylcache.cc
Outdated
@@ -384,6 +403,10 @@ main(int ac, char **av) | |||
cxxopts::value<int>(CMAPR)->default_value("1")) | |||
("CMAPZ", "Vertical coordinate mapping type for cylindrical grid (0=none, 1=rational fct)", | |||
cxxopts::value<int>(CMAPZ)->default_value("1")) | |||
("HERNA", "The Hernquist 'a' scale radius, diskbulge model only", | |||
cxxopts::value<string>(dmodel)->default_value("0.1")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this line should be
cxxopts::value<string>(dmodel)->default_value("0.1")) | |
cxxopts::value<string>(HERNA)->default_value("0.1")) |
utils/ICs/cylcache.cc
Outdated
("HERNA", "The Hernquist 'a' scale radius, diskbulge model only", | ||
cxxopts::value<string>(dmodel)->default_value("0.1")) | ||
("Mfac", "Fraction of mass in the disk, remaining mass will be in the bulge (i.e. Mfac = .75 would have 75% of the mass be disk, 25% bulge). diskbulge model only", | ||
cxxopts::value<string>(dmodel)->default_value("0.1")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this line should be
cxxopts::value<string>(dmodel)->default_value("0.1")) | |
cxxopts::value<string>(Mfac)->default_value("1.0")) |
(both the variable name and the default value)
We do offer the construction of custom-density-function bases, so I think it makes sense for us to also add some clearer documentation somewhere of how a user would do this, particularly since the changes can/should happen in a few places if one wants the density model fully available (as the edits here demonstrate!). |
Yes, I would suggest that rather than change the code for this customized application that we provide a user-define density/potential functor for pyEXP analysis. |
Sigh, looks like the [UPDATE: I think I axed it because I had too much on my plate to gin up and example and document it. It would be straightforward to restore it. Maybe Carrie can try putting in her new joint function as test case?] |
As I see it, the main reason to keep this functionality (e.g. edits in That said, a functor in |
True. But it doesn't solve the problem of how a user adds a new density target 'on the fly'. The proposed one is general useful, but suppose some particular project needs a more specialized target; is the only option to add it like this one, with a lists of new parameters, etc.? Is there a way to do this in a more modular way? As I scan the diffs, I note that most of this is about adding a lot of new parameters. The main problem with EXP, imho, is that we already have too many parameters. My bad but still... An alternative to your Anyway, feel free to proceed with this. I'm not trying to impede progress, but I am trying to learn from this PR if there is something we could be or should be doing better. It does bring up some interesting questions for future user needs. I will add the functionoid call from Python (it's pretty easy) after we merge #101. Assuming that we are going ahead with this, can I ask if @CarrieFilion has checked whether you get a high quality basis out of this? Are there particular parameter choices that work or don't work? |
Okay, here's another related idea: write a function class in |
I have set of changes to this PR that implements Python functors in all the same places as the [UPDATE: Functor implemented in |
… 'pyEXP' and 'exp'
…ently using this feature
Summary of the last commit blobFix a few minor issues identified while testing the user-specified Python density target
TL;DR; usage
For example, put the code below in the file
Comments
Tests
|
This is definitely a good update! I have been working with the new I totally agree that the proliferation of options, even in a siloed piece of software like The basis creation is obviously quite computationally expensive on a single processor; I think we'll want big flashing warnings to users if they run an example notebook. With All changes compile and work for me, so I'll approve this; we can think about deprecating |
Thanks for checking all of this, Mike! This trick might come in useful in other cases. I agree with you that I'm not overly concerned about sane parameters for |
One more comment: we have a bit of a cache file ambiguity even without the |
Let's wait for @CarrieFilion before merging. Also, there is the issue of which order to merge this one and #101; there will probably be conflicts, albeit easy to fix. |
Added the option to make an exponential disk + Hernquist bulge cylindrical basis. I did a few minor sanity checks and would be happy to run any additional checks that you can think of! Also happy to change naming etc if there is a specific convention that is desired.
Note - in the Hernquist portion, I transform the cylindrical R and z into spherical rr for the density profile. Not sure if this is the right thing to do
I also found some minor typo issues in
BiorthBasis.cc
for the double exponential model.