Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ mass distribution (e.g. if you are starting with an arbitrary set of particles a
build a basis from that with the most naive approach - here you would use ``pnum`` ~ 100 and let it go).
These generally don't need to be changed from the defaults.

The EJ parameters are explained in :ref: `the section on centering <centering>`.
The EJ parameters are explained in :ref:`the section on centering <centering>`.
You only want to change these values from their defaults if you have an external perturber,
these shouldn't be changed if you are working with with simulations of isolated systems.

Expand Down
81 changes: 39 additions & 42 deletions topics/howtosim.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ The general steps for creating an N-body simulation in EXP are to:

#. Generate a model file and body files. The model file contains the initial density distribution for your dark matter halo. The body file contains the initial phase space positions for (e.g.) your stellar disk and dark matter halo

#. Generate a cache file with your bases. In this example, you would need one cache file for your cylindrical (disk) basis and another for your spherical (halo) basis
#. Generate a cache file with your bases. In this example, you would need one cache file for your cylindrical (disk) basis and another for your spherical (halo) basis.
This is unnecessary in newer versions of EXP.

#. Run a three-step relaxation process to ensure that your initial conditions are as quiet as possible

Expand Down Expand Up @@ -46,83 +47,79 @@ Parameters for ``gendisk`` are specified in a YAML file with the following field
CMAPR : 1 # Radial coordinate mapping type for cylindrical grid (0:none, 1:rational fct)
CMAPZ : 1 # Vertical coordinate mapping type for cylindrical grid (0:none, 1:sech, 2:power in z
DF : 1 # Use change-over from Jeans to Eddington
DFLAG : 6 # Output flags for DiskHalo
DFLAG : 0 # Output flags for DiskHalo
DIVERGE : 0 # Cusp extrapolation for primary halo model
DIVERGE2 : 0 # Cusp extrapolation for number model
DIVERGE_RFAC : 1 # Extrapolation exponent for primary mass model
DIVERGE_RFAC2 : 1 # Extrapolation exponent for number model
DMFAC : 0.0 # Disk mass scaling factor for spherical deprojection model
DR_DF : 5 # Width of change for to Eddington
DMFAC : 1.0 # Disk mass scaling factor for spherical deprojection model
DR_DF : 1.0 # Width of change for to Eddington
DUMPCOEF : false # Dump coefficients
ASCALE : XXXXX # radial scale length for disk basis construction (e.g. 0.01)
HSCALE : XXXXX # Vertical scale length for disk basis construction (e.g. 0.002)
LMAX : 6 # Number of harmonics for Spherical SL for halo/spheroid
LMAXFID : 64 # Number of harmonics for Spherical SL for determining disk basis
LMAX : 18 # Number of harmonics for Spherical SL for halo/spheroid
LMAXFID : 128 # Number of harmonics for Spherical SL for determining disk basis (may want to bump to 256)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised this LMAXFID hasn't created complaints before -- LMAXFID will scale runtime like LMAXFID squared. Earlier tests have shown that for realistic disc scale height-to-length ratios (e.g. 15%), this will be overkill unless all other parameters are equally boosted. I'd recommend LMAXFID : 72 or thereabouts.

LOGR : true # Make a logarithmic coordinate mapping
MMAX : 6 # Number of azimuthal harmonics for disk basis
NCHEB : 16 # Chebyshev order for smoothing
NDP : 1
CHEBY : false # Chebyshev smoothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably makes sense to move these to expert parameters, as Chebyshev smoothing is generally dangerous unless using all the diagnostic files.

NCHEB : 12 # Chebyshev order for smoothing if CHEBY = true
NDP : 8 # Number of angular wedges for disc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 is fine here because we are assuming axisymmetry when generating the disc.

(also we have to decide disc vs disk)

NDR : 2000 # Number of points in DiskHalo radial table for disk
NDZ : 200 # Number of points in DiskHalo vertical table for disk
NDZ : 800 # Number of points in DiskHalo vertical table for disk
NHR : 800 # Number of points in DiskHalo radial table for halo
NHT : 200 # Number of points in DiskHalo cos(theta) table for halo
NHT : 800 # Number of points in DiskHalo cos(theta) table for halo
NMAXH : 18 # Number of radial basis functions in Spherical SL for halo/spheroid
NMAXFID : 72 # Number of radial basis functions in Spherical SL for determining disk basis
NODD : 8 # Number of vertically antisymmetric disk basis functions per M-order
NMAXFID : 64 # Number of radial basis functions in Spherical SL for determining disk basis (may want to bump to 128)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests largely again showed that larger than 72 was overkill; but this also isn't as expensive, so it's fine.

NODD : 6 # Number of vertically antisymmetric disk basis functions per M-order
NMAXD : 18 # Number of disk basis functions per M-order
NMAXLIM : 10000 # Restricts disk basis function to NORDER1<NORDER after basis construction for testing
NOUT : 1000 # Number of radial basis functions to output for each harmonic order
NOUT : 18 # Number of radial basis functions to output for each harmonic order
NUMDF : 1000 # Number of grid points for Eddington inversion
NUMR : 1000 # Size of radial grid for Spherical SL
NUMR : 2000 # Size of radial grid for Spherical SL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NUMR : 2000 # Size of radial grid for Spherical SL
NUMR : 2000 # Size of radial grid for Spherical SL (ideally this matches the input halo file)

NUMX : 256 # Radial grid size for disk basis table
NUMY : 128 # Vertical grid size for disk basis table
PNUM : 1 # Number of azimthal knots for EmpCylSL basis construction quadrature
RCYLMAX : 20.0 # Maximum disk radius
RCYLMAX : 20.0 # Maximum disk radius in units of ASCALE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RCYLMAX : 20.0 # Maximum disk radius in units of ASCALE
RCYLMAX : 20.0 # Maximum disk table radius in units of ASCALE

RCYLMIN : 0.001 # Minimum disk radius
RFACTOR : 1 # Disk radial scaling factor for spherical deprojection model
RMIN : 0.00001 # Minimum halo radius
RFACTOR : 1.0 # Disk radial scaling factor for spherical deprojection model
RMIN : 0.001 # Minimum halo radius
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RMIN : 0.001 # Minimum halo radius
RMIN : 0.001 # Minimum halo radius (ideally this matches the input table, or is larger)

RNUM : 200 # Number of radial knots for EmpCylSL basis construction quadrature
RSPHSL : 4.00 # Maximum halo expansion radius
RSPHSL : 1.95 # Maximum halo expansion radius
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RSPHSL : 1.95 # Maximum halo expansion radius
RSPHSL : 1.95 # Maximum halo expansion radius (ideally this matches the input table, or is smaller)

RTRUNC : 0.1 # Maximum disk radius for erf truncation of EOF conditioning density
RWIDTH : 0 # Width for erf truncationofr EOF conditioning density (ignored if zero)
R_DF : 20 # Change over radius for Eddington
SCMAP : 1 # Turn on Spherical SL coordinate mapping (1, 2, 0:off
SCSPH : 0.05 # Scale for Spherical SL coordinate mapping
RWIDTH : 0.0 # Width for erf truncation of r EOF conditioning density (ignored if zero)
R_DF : -1.0e20 # Change over radius for Eddington (default is all Eddington)
SCMAP : 1 # Turn on Spherical SL coordinate mapping (1, 2, 0:off)
SCSPH : XXXXX # Scale for Spherical SL coordinate mapping - this should match rmapping in exp
SEED : XXXXX # Random number seed (e.g. your favorite number)
SELECT : false # Enable significance selection in coefficient computation
SHFAC : 16 # Scale height factor for assigning vertical table size
SVD : false # Use svd for symmetric eigenvalue problesm
TNUM : 80 # Number of cos(theta) knots for EmpCylSL basis construction quadrature
Temp : 2000 # Gas temperature (in K)
Tmin : 500 # Temperature floor (in K) for gas disk generation
ToomreQ : XXXXX # Toomre Q parameter for stellar disk generation (e.g. 1.4)
U0 : 0 # Disk-Halo x velocity center position
V0 : 0 # Disk-Halo y velocity center position
VFLAG : 16 # Output flags for EmpCylSL
W0 : 0 # Disk-Halo z velocity center position
X0 : 0 # Disk-Halo x center position
Y0 : 0 # Disk-Halo y center position
Z0 : 0 # Disk-Halo z center position
U0 : 0.0 # Disk-Halo x velocity center position
V0 : 0.0 # Disk-Halo y velocity center position
VFLAG : 8 # Output flags for EmpCylSL
W0 : 0.0 # Disk-Halo z velocity center position
X0 : 0.0 # Disk-Halo x center position
Y0 : 0.0 # Disk-Halo y center position
Z0 : 0.0 # Disk-Halo z center position
basis : false # Print out disk and halo basis
ignore : XXXXX # 'false' if you want to generate and save out cache files, otherwise 'true'
ignore : XXXXX # 'true' if you want to generate and save out cache files, otherwise 'false'
cachefile : XXXXX # Name of EOF cache file (e.g. eof.cache.fileF)
centerfile : # Read position and velocity center from this file
constheight : true # Use constant disk scale height
dbods : disk.bods # Disk particle output file
deproject : Exponential # set deprojection model (Exponential or MN)
deproject : EXP # set deprojection model (Exponential or MN)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, the code only checks for MN input right now, and then defaults to exponential. So we should set this with whatever is clearest and update documentation elsewhere.

disk_mass : XXXXX # Mass of stellar disk (e.g. 0.0125)
dtype : exponential # Disk type for condition (one of: constant, gaussian, mn, exponential)
expcond : true # Use analytic density function for computing EmpCylSL basis
gentype : asymmetric # DiskGenType string for velocity initialization (Jeans, Asymmetric, or Epicyclic)
gentype : Asymmetric # DiskGenType string for velocity initialization (Jeans, Asymmetric, or Epicyclic)
halofile1 : XXXXX # File with input halo model (your .model file here)
evolved : false
hbods : halo.bods # Halo particle output file
ignore : false # Recompute EOF regardless of existence
multi : false # Use multimass halo
ndisk : XXXXX # Number of disk particles (e.g. 1000000)
ngas : 0 # Number of gas particles
ngparam : 3 # Number of gas particle parameters
nhalo : XXXXX # Number of halo particles (e.g. 10000000)
report : true # Report particle progress in EOF computation
report : false # Report particle progress in EOF computation
runtag : XXXXX # Label prefix for diagnostic images (e.g. 'run1')
scale_height : XXXXX # Scale height for disk realization (e.g. 0.002)
scale_length : XXXXX # Scale length for disk realization (e.g. 0.01)
Expand All @@ -132,7 +129,7 @@ Parameters for ``gendisk`` are specified in a YAML file with the following field

Parameters that have values set to 'XXXXX' are those that users are encouraged to change. Example values are given in the
comment following the parameter value. The remaining parameters are "expert parameters" and generally do not need to be changed
unless you have a good reason to use a different value. Note that the ``exponential`` disk is
unless you have a good reason to use a different value. The listed parameter values are the defaults. Note that the ``exponential`` disk is
exponential in R and :math:`sech^2` in z.

To generate the initial conditions, you would run:
Expand All @@ -142,14 +139,14 @@ To generate the initial conditions, you would run:
mpirun gendisk --config gendisk_step1.yml

in the terminal, replacing ``gendisk_step1.yml`` with the name of your YAML file that specifies the ``gendisk`` parameters. If
you set ``ignore = false``, it may take a moment to generate the cylindrical bases cache file. The cylindrical bases will be
you set ``ignore = true``, it may take a moment to generate the cylindrical bases cache file. The cylindrical bases will be
saved out to whatever name is specified in ``cachefile``, and the halo basis will generally be saved out to
``.slgrid_sph_cache``. Note that the ``diskgen`` YAML file here is distinct from the EXP YAML config file, EXP YAML config files
look like :ref:`this annotated example <yamlconfig>`.

Step Two: generate cache files
******************************
If you didn't generate cache files in step one, you need to generate these files now. An example of how to do this is in the
If you didn't generate cache files in step one and you have an old install of EXP, you need to generate these files now. An example of how to do this is in the
`pyEXP-Examples repo <https://github.com/EXP-code/pyEXP-examples/blob/main/How-To/Utilities/create%20Cylinder%20basis%20(parallel).py>`_.
If you are including a stellar disk in your simulation, EXP requires that you provide a cylindrical cache file with a name that matches
the ``cachename`` for the **star disk** in the EXP YAML config file. You are not required to provide a spherical cache file, as it is much
Expand Down
6 changes: 3 additions & 3 deletions topics/yamlconfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ is an EXP YAML file with annotation.
bodyfile : halo.bod
force :
id : sphereSL
parameters : {rmax : 27.5}
parameters : {rmax : 2.5}

- name : star disk
parameters : {nlevel: 1, indexing: true, EJ: 2, nEJkeep: 256, EJdryrun: true}
Expand Down Expand Up @@ -231,8 +231,8 @@ documentation <doxygen>`.
Cachename: slgrid_sph_cache # cache name, this can be omitted if you are only interested in making a basis and not a simulation


The parameters *rmin* and *rmax* define the inner and outer radii for the basis in virial units
(e.g. where :math:`R_{vir} = 1`), *Lmax* and *nmax* describe the maximum harmonic and radial
The parameters *rmin* and *rmax* define the inner and outer radii for the basis in units where
:math:`G = 1`, *Lmax* and *nmax* describe the maximum harmonic and radial
orders for the basis, respectively. The *rmapping* parameter adjusts the internal coordinate mapping
and a good choice is the characteristic or scale radius of the halo.

Expand Down