beam_calculator section (mandatory)
Note that the role of the reference_phase_policy is extremely important, as it controls how cavities are rephased after failure.
More details and an example in the dedicated notebook.
Envelope1D solver
This solver computes the propagation of the beam in the longitudinal phase space and in envelope. Space charge effects are not considered. It is adapted to high energy problems, such as ADS linacs.
Entry |
Type |
Description |
Mandatory? |
Allowed values |
|---|---|---|---|---|
|
|
The type of phases that should be exported in the final file. Note that
implemented yet, but
same way, provided that you alter no FieldMap.CavitySettings.refer- ence attribute. |
✅ |
(‘phi_0_abs’, ‘phi_0_rel’, ‘phi_s’, ‘as_in_original_dat’, ‘as_in_settings’) |
|
|
Controls cavities reference phase. More details in With TraceWin solver, prefer sticking with |
✅ |
(‘phi_0_abs’, ‘phi_0_rel’, ‘phi_s’, ‘as_in_original_dat’) |
|
|
DEPRECATED, prefer use of
field maps phases should be absolute (no implicit rephasing after a failure). |
❌ |
|
|
|
Name of the tool. |
✅ |
(‘Envelope1D’, ‘Envelope3D’, ‘Envelope_1D’, ‘Envelope_3D’, ‘TraceWin’, ‘envelope1d’, ‘envelope3d’, ‘envelope_1d’, ‘envelope_3d’, ‘tracewin’) |
|
|
If we should use the Cython implementation (faster). |
❌ |
|
|
|
Integration method. |
❌ |
(‘RK4’, ‘leapfrog’) |
|
|
Number of integrating steps per cavity cell. Recommended values are 40 for RK4 and 20 for leapfrog. |
❌ |
The following elements are explicitly supported.
Note that, by default, an element that is implemented but not explicitly supported is replaced by a DRIFT.
In 1D, this is perfectly acceptable for most non-implemented elements that act on the transverse dynamics, such as THIN_LENS.
Envelope3D solver
Envelope solver in 3D, without space charge.
Entry |
Type |
Description |
Mandatory? |
Allowed values |
|---|---|---|---|---|
|
|
The type of phases that should be exported in the final file. Note that
implemented yet, but
same way, provided that you alter no FieldMap.CavitySettings.refer- ence attribute. |
✅ |
(‘phi_0_abs’, ‘phi_0_rel’, ‘phi_s’, ‘as_in_original_dat’, ‘as_in_settings’) |
|
|
Controls cavities reference phase. More details in With TraceWin solver, prefer sticking with |
✅ |
(‘phi_0_abs’, ‘phi_0_rel’, ‘phi_s’, ‘as_in_original_dat’) |
|
|
DEPRECATED, prefer use of
field maps phases should be absolute (no implicit rephasing after a failure). |
❌ |
|
|
|
Name of the tool. |
✅ |
(‘Envelope1D’, ‘Envelope3D’, ‘Envelope_1D’, ‘Envelope_3D’, ‘TraceWin’, ‘envelope1d’, ‘envelope3d’, ‘envelope_1d’, ‘envelope_3d’, ‘tracewin’) |
|
|
Not implemented yet. If we should use the Cython implementation (faster). |
❌ |
(False,) |
|
|
Integration method. |
❌ |
(‘RK4’,) |
|
|
Number of integrating steps per cavity cell. Recommended value is 40. |
❌ |
Note
The default behavior when an element in the input DAT file is not recognized, is to issue a warning and replace this element by a DRIFT.
Do not hesitate to file an issue if you need me to implement some elements.
TraceWin solver
3D solver, can be used in multiparticle or envelope.
You will need a valid TraceWin license.
It can be used during the optimization process, though this approach relies on a lot of file writing/reading and is very slow.
Generally, I use it to re-compute the propagation of the beam in the linac when compensation settings were found (beam_calculator_post).
Entry |
Type |
Description |
Mandatory? |
Allowed values |
|---|---|---|---|---|
|
|
The type of phases that should be exported in the final file. Note that
implemented yet, but
same way, provided that you alter no FieldMap.CavitySettings.refer- ence attribute. |
✅ |
(‘phi_0_abs’, ‘phi_0_rel’, ‘phi_s’, ‘as_in_original_dat’, ‘as_in_settings’) |
|
|
Controls cavities reference phase. More details in With TraceWin solver, prefer sticking with |
✅ |
(‘phi_0_abs’, ‘phi_0_rel’, ‘phi_s’, ‘as_in_original_dat’) |
|
|
DEPRECATED, prefer use of
field maps phases should be absolute (no implicit rephasing after a failure). |
❌ |
|
|
|
Name of the tool. |
✅ |
(‘Envelope1D’, ‘Envelope3D’, ‘Envelope_1D’, ‘Envelope_3D’, ‘TraceWin’, ‘envelope1d’, ‘envelope3d’, ‘envelope_1d’, ‘envelope_3d’, ‘tracewin’) |
|
|
Optimization using algorithm ( 0: Owner, 1: Simplex, 2: Diff. evo.) |
❌ |
|
|
|
Input twiss parameter alpXX’ of main beam |
❌ |
|
|
|
Input twiss parameter alpXX’ of second beam |
❌ |
|
|
|
Input twiss parameter alpYY’ of main beam |
❌ |
|
|
|
Input twiss parameter alpYY’ of second beam |
❌ |
|
|
|
Input twiss parameter alpZZ’ of main beam |
❌ |
|
|
|
Input twiss parameter alpZZ’ of second beam |
❌ |
|
|
|
Input twiss parameter betXX’ of main beam |
❌ |
|
|
|
Input twiss parameter betXX’ of second beam |
❌ |
|
|
|
Input twiss parameter betYY’ of main beam |
❌ |
|
|
|
Input twiss parameter betYY’ of second beam |
❌ |
|
|
|
Input twiss parameter betZZ’ of main beam |
❌ |
|
|
|
Input twiss parameter betZZ’ of second beam |
❌ |
|
|
|
Cancel all matching procedure (Envelope) |
❌ |
|
|
|
Cancel all matching procedure (Tracking) |
❌ |
|
|
|
Input particle charge state of main beam |
❌ |
|
|
|
Input particle charge state of second beam |
❌ |
|
|
|
Input beam current (mA) of main beam |
❌ |
|
|
|
Input beam current (mA) of second beam |
❌ |
|
|
|
Full name Input dst of main beam (*) |
❌ |
|
|
|
Full name Input dst of second beam (*) |
❌ |
|
|
|
Duty cycle of main beam |
❌ |
|
|
|
Duty cycle of second beam |
❌ |
|
|
|
Input Dw of main beam |
❌ |
|
|
|
Input Dw of second beam |
❌ |
|
|
|
Input ZZ’ emittance (mm.mrad) of main beam |
❌ |
|
|
|
Input ZZ’ emittance (mm.mrad) of second beam |
❌ |
|
|
|
Particle is excluded form emit. calculation if |W-Ws|/ Ws > emit_e_limit |
❌ |
|
|
|
Particle is excluded form emit. calculation if |Ф- Ф s| > emit_p_limit |
❌ |
|
|
|
Input kinetic energy (MeV) of main beam |
❌ |
|
|
|
Input kinetic energy (MeV) of second beam |
❌ |
|
|
|
Input XX’ emittance (mm.mrad) of main beam |
❌ |
|
|
|
Input XX’ emittance (mm.mrad) of second beam |
❌ |
|
|
|
Input YY’ emittance (mm.mrad) of main beam |
❌ |
|
|
|
Input YY’ emittance (mm.mrad) of second beam |
❌ |
|
|
|
Input beam frequency (MHz) of main beam |
❌ |
|
|
|
Input beam frequency (MHz) of second beam |
❌ |
|
|
|
Hide the GUI, or cancel console output (no parameter). |
✅ |
|
|
|
Input distribution type from 1 to 5, see GUI menu |
❌ |
range(1, 6) |
|
|
Mask of the longitudinal input distribution from 1 to 7, see GUI menu |
❌ |
range(1, 8) |
|
|
Particle is lost if |W-Ws| > lost_e_limit |
❌ |
|
|
|
Particle is lost if |Ф- Ф s| > lost_p_limit |
❌ |
|
|
|
Input beam mass (eV) of main beam |
❌ |
|
|
|
Input beam mass (eV) of second beam |
❌ |
|
|
|
Number of particle of main beam |
❌ |
|
|
|
Number of particle of second beam |
❌ |
|
|
|
Set the max. number of core/thread used |
❌ |
|
|
|
To activate/deactivate partran tracking. |
❌ |
(0, 1, True, False) |
|
|
Partran calculation step per meter (per beta.lambda if < 0) |
❌ |
|
|
|
Space-charge routine is defined as picnic2D |
❌ |
|
|
|
Space-charge routine is defined as picnic3D |
❌ |
|
|
|
R mesh of picnic 2D |
❌ |
|
|
|
X&Y mesh of picnic 3D |
❌ |
|
|
|
Z mesh of picnic 3D |
❌ |
|
|
|
Z mesh of picnir 2D |
❌ |
|
|
|
Set the random seed |
❌ |
|
|
|
Input spread energy for CW beam of main beam |
❌ |
|
|
|
Input spread energy for CW beam of second beam |
❌ |
|
|
|
Save the geometric layout at ( entance (=1), middle (=2), exit (=3) of elements. (See “Synoptic” tools for file name ). |
❌ |
|
|
|
Save to file the data sheet at the end of calcul (by default in calculation directory). |
❌ |
|
|
|
Force or avoid Toutatis simulation (1 / 0) |
❌ |
(0, 1, True, False) |
|
|
Mask of the transverse input distribution from 1 to 7, see GUI menu |
❌ |
range(1, 8) |
|
|
To update LightWin |
❌ |
|
|
|
dst file is used as input beam distribution |
❌ |
|
|
|
Change RFQ Ucav (ex: “vfac 0.5”, half reduce of Ucav) |
❌ |
|
|
|
Input X position of main beam |
❌ |
|
|
|
Input X position of second beam |
❌ |
|
|
|
Input X angle of main beam |
❌ |
|
|
|
Input X angle of second beam |
❌ |
|
|
|
Input Y position of main beam |
❌ |
|
|
|
Input Y position of second beam |
❌ |
|
|
|
Input Y angle of main beam |
❌ |
|
|
|
Input Y angle of second beam |
❌ |
|
|
|
Input Z position of main beam |
❌ |
|
|
|
Input Z position of second beam |
❌ |
|
|
|
Input Z angle of main beam |
❌ |
|
|
|
Input Z angle of second beam |
❌ |
|
|
|
Direct path to the TraceWin executable. If given, will override the definition in the machine_config_file. |
❌ |
|
|
|
Path to the |
✅ |
|
|
|
Path to a file holding the paths to TW executables |
✅ |
|
|
|
Name of current machine. Must be a table name in
default, do not provide it and let LightWin handle this part. |
❌ |
|
|
|
A key in the machine_config.toml file |
✅ |
Check TraceWin’s documentation for the list of command line arguments.
Note that you also need to create a configuration file that will define the path to the TraceWin executables.
See data/examples/machine_config_file.toml for an example.
The [beam_calculator_post] follows the same format.
It is used to store a second BeamCalculator.
This is mainly useful for defining a more precise – but more time-consuming – beam dynamics tool, for example to check your compensation settings.