Num beta osc stage length#175
Conversation
…gives a given number of main beam betatron oscillations.
…c() to calculate the number of betatron oscillations a particle can undergo in the stage.
… betatron oscillations that should be performed in the main flattop by subtracting the contributions from the ramps.
…d Stage.flattop_length2num_beta_osc() for calculating the number of betatron oscillations when the gradient is small (usually the case for ramps).
…ted various docstrings.
…top_length2num_beta_osc().
… ramps are uniform type.
…beta_osc_stage_length
…fying Stage.flattop_length2num_beta_osc() and Stage.calc_flattop_num_beta_osc().
…es/stage/stage.py.
…ength_num_beta_osc() and removed unnecessary comments and imports in some of the beatron oscillation length and phase advance class methods.
… flattop lengths to match the number of betatron oscillations.
…rive beam with an angular offset will follow when driver guiding is applied. Also added getter and setter for StageHipace.external_focusing. The setter will also calculate the gradient for the external focusing field.
…river_guiding_orbit().
…iver_guiding_trajectory() and edited docstrings.
…es/beam_physics.py.
…he energy depletion is too severe.
…ithout driver guiding.
…ield used for driver guiding in abel/classes/stage/impl/stage_hipace.py.
….driver_guiding_trajectory() for array initialisation.
…t any external focusing gradient.
…lving self.external_focusing_gradient may cause an infinite loop.
…ipace.match_length_2_num_beta_osc().
…tory() and StageHipace.estimate_beam_trajectory(). Also removed a commented out version of StageHipace.calc_length_num_beta_osc().
…to include correction for driver trajectory.
|
Merge from master before today's meeting? |
ben-c-2013
left a comment
There was a problem hiding this comment.
Changes to be done...
|
|
||
|
|
||
| # ================================================== | ||
| def match_length_2_num_beta_osc(self, num_beta_osc, q=SI.e): |
There was a problem hiding this comment.
Should add logic to autimiatically find closest num_beta_osc for current stage length. Can perhaps do this in separate PR.
…/abel/utilities/beam_physics.py::length2num_beta_osc.
…e.phase_advance_beta_evolution().
….driver_num_half_beta_osc.
…ed_beta_function(). This takes into account any external focusing gradient.
…vance_integrate_betas.
…ocusing (set to False) and made corrections in docstring in Stage.)
| ramp_length = beta_matched(self.plasma_density, ramp.nom_energy)*np.pi/(2*np.sqrt(1/ramp_beta_mag)) | ||
|
|
||
| g = SI.e*self.plasma_density/(2*SI.epsilon_0*SI.c) # [T/m], ion background focusing gradient | ||
| #if self.external_focusing_gradient is not None: # Add contribution from external field |
| ``True``. Otherwise, will match the beta function to the downramp. | ||
| Default set to ``True``. | ||
|
|
||
| q : [C] float, optional |
There was a problem hiding this comment.
Some comment about the sign of this? I see you later use abs(q)
| the stage (excluding ramps). | ||
|
|
||
| Will take into account the contribution from an external linear magnetic | ||
| field B=[gy,-gx,0] if :attr:`self.external_focusing_gradient <abel.Stage.external_focusing>` |
|
I had a very very quick look, @carlandreaslindstrom should probably see more for the architechture stuff. |
|
Hmm, looking at the output here https://app.readthedocs.org/projects/abel/builds/32906630/ (expand the final command |
Adds the capability to tailor the length of
Stageaccording to desired number of betatron oscillations. Also includes tests, but these require PR #174.In addition, also includes functions for estimating the orbit of the drive beam when driver guiding with an external azimuthal magnetic field is applied to a drive beam with an anglar offset.