Monte Carlo Configuration¶
The montecarlo
section describes the parameters for the Monte Carlo radiation transport and convergence criteria:
type |
object |
||
properties |
|||
|
The number of Numba threads for parallelisation. Must be between 1 and the environment variable NUMBA_NUM_THREADS (by default NUMBA_NUM_THREADS is equal to the number of CPU cores on the local system). |
||
type |
number |
||
multipleOf |
1.0 |
||
default |
1 |
||
|
Seed for the random number generator |
||
type |
number |
||
multipleOf |
1.0 |
||
default |
23111963 |
||
|
Seed for the random number generator |
||
type |
number |
||
multipleOf |
1.0 |
||
|
Number of maximum iterations |
||
type |
number |
||
multipleOf |
1.0 |
||
|
This can set the number of packets for the last run. If set negative it will remain the same as all other runs. |
||
type |
number |
||
multipleOf |
1.0 |
||
default |
-1 |
||
|
Setting the number of virtual packets for the last iteration. |
||
type |
number |
||
multipleOf |
1.0 |
||
default |
0 |
||
|
Limits of virtual packet spawn spectrum (giving maximum and minimum packet frequency) |
||
type |
object |
||
default |
|||
properties |
|||
|
type |
quantity |
|
default |
0 angstrom |
||
|
type |
quantity |
|
default |
inf angstrom |
||
|
experimental feature to enable a reflective boundary. |
||
type |
boolean |
||
default |
False |
||
|
albedo of the reflective boundary |
||
type |
number |
||
default |
0.0 |
||
|
default |
type |
damped |
oneOf |
|||
|
Enables a more complete treatment of relativitic effects. This includes angle aberration as well as use of the fully general Doppler formula. |
||
type |
boolean |
||
default |
False |
||
|
Decide whether to go into debugging mode. [EXPERIMENTAL FEATURE DO NOT RELY ON IT] |
||
type |
boolean |
||
default |
False |
||
|
Provides option to not log every line. |
||
type |
number |
||
default |
1 |
||
|
If debug_packets is true, this is the seed for the only packet. |
||
type |
number |
||
default |
-1 |
||
additionalProperties |
False |
The seed
parameter seeds the random number generator first for the creation of the packets
(\(\nu\) and \(\mu\)) and then the interactions in the actual Monte Carlo process.
The no_of_packets
parameter can take a float number for input convenience and gives the number of packets normally
used in each Monte Carlo loop. The parameters last_no_of_packets
and no_of_virtual_packets
influence the last run
of the Monte Carlo loop (which calculates the final spectrum!) when the radiation field should have converged. last_no_of_packets
is normally higher than
no_of_packets
to create a less noisy output spectrum. no_of_virtual_packets
can also be set to greater than 0 (a useful number is 3) to
use the Virtual Packet formalism. Increasing this number drastically increases computational costs (and memory requirements if they are logged).
The iterations
parameter describes the maximum number of Monte Carlo loops executed in a simulation before it ends. Convergence criteria can be used to make the simulation stop
sooner when the convergence threshold has been reached (see Convergence).
Convergence Strategy¶
The convergence_criteria
section has a type
keyword. Currently, one type is allowed: damped
.
All convergence criteria can be specified separately for the three variables for which convergence can be checked
(t_inner
, t_rad
, ws
) by specifying subsections in the convergence_criteria
of the same name. These then
override the defaults. Two more schemas are presented that further explain the damped
and
custom
convergence strategies:
Damped Convergence Strategy¶
type |
object |
||
properties |
|||
|
enum |
damped |
|
|
damped |
||
|
stop plasma iterations before number of specified iterations are reached if the simulation is plasma and inner boundary state is converged |
||
type |
boolean |
||
default |
False |
||
|
the fraction of shells that have to converge to the given convergence threshold. For example, 0.8 means that 80% of shells have to converge to the threshold that convergence is established |
||
type |
number |
||
minimum |
0 |
||
default |
0.8 |
||
|
the number of iterations that the convergence criteria need to be fulfilled before TARDIS accepts the simulation as converged |
||
type |
number |
||
multipleOf |
1.0 |
||
default |
3 |
||
|
damping constant |
||
type |
number |
||
minimum |
0 |
||
default |
1.0 |
||
|
specifies the threshold that is taken as convergence (i.e. 0.05 means that the value does not change more than 5%) |
||
type |
number |
||
minimum |
0 |
||
default |
0.05 |
||
|
type |
object |
|
properties |
|||
|
damping constant |
||
type |
number |
||
minimum |
0 |
||
default |
0.5 |
||
|
specifies the threshold that is taken as convergence (i.e. 0.05 means that the value does not change more than 5%) |
||
type |
number |
||
minimum |
0 |
||
additionalProperties |
False |
||
|
type |
object |
|
properties |
|||
|
damping constant |
||
type |
number |
||
minimum |
0 |
||
default |
0.5 |
||
|
specifies the threshold that is taken as convergence (i.e. 0.05 means that the value does not change more than 5%) |
||
type |
number |
||
minimum |
0 |
||
additionalProperties |
False |
||
|
type |
object |
|
properties |
|||
|
damping constant |
||
type |
number |
||
minimum |
0 |
||
default |
0.5 |
||
|
specifies the threshold that is taken as convergence (i.e. 0.05 means that the value does not change more than 5%) |
||
type |
number |
||
minimum |
0 |
||
additionalProperties |
False |
||
|
The number of cycles to lock the update of the inner boundary temperature. This process helps with convergence. The default is to switch it off (1 cycle) |
||
type |
number |
||
multipleOf |
1.0 |
||
default |
1 |
||
|
L=4*pi*r**2*T^y |
||
type |
number |
||
default |
-0.5 |
||
additionalProperties |
False |
damped
only has one parameter damping-constant
and does not check for convergence. This can be used to fix the
temperature of the inner boundary.
Custom Convergence Strategy¶
type |
object |
|
properties |
||
|
enum |
custom |
|
Use this convergence_strategy for your specific needs. You need to change the codebase accordingly |
|
additionalProperties |
False |
Parallel Execution with Numba¶
The montecarlo
section of the Configuration file accepts the parameter nthreads
which sets the number of
threads to be used for parallelisation. Setting the value of the parameter between 1 and the environment variable
NUMBA_NUM_THREADS
(which is, by default, the number of CPU cores on your system) will automatically invoke Numba
to parallelise the code. (See Configuration (Required Input) section).