AWA Flat Beams¶
Example courtesy of T. Xu
In [1]:
Copied!
from impact import Impact
import matplotlib.pyplot as plt
%config InlineBackend.figure_format = 'retina'
from impact import Impact
import matplotlib.pyplot as plt
%config InlineBackend.figure_format = 'retina'
In [2]:
Copied!
I = Impact('../templates/awa_flatbeam/ImpactT.in')
I.plot(figsize=(16,4), include_labels=True, include_field=True)
I = Impact('../templates/awa_flatbeam/ImpactT.in')
I.plot(figsize=(16,4), include_labels=True, include_field=True)
In [3]:
Copied!
%%time
I.numprocs = 8
I.run()
%%time
I.numprocs = 8
I.run()
CPU times: user 1.98 s, sys: 383 ms, total: 2.36 s Wall time: 16min 22s
In [4]:
Copied!
I.plot(['norm_emit_x', 'norm_emit_y'], y2='mean_kinetic_energy', xlim=(0,16),figsize=(16,6))
I.plot(['norm_emit_x', 'norm_emit_y'], y2='mean_kinetic_energy', xlim=(0,16),figsize=(16,6))
In [5]:
Copied!
I.plot(['sigma_x', 'sigma_y', 'sigma_z'], y2='mean_kinetic_energy', xlim=(0,16), ylim=(0,.01), figsize=(16,6))
I.plot(['sigma_x', 'sigma_y', 'sigma_z'], y2='mean_kinetic_energy', xlim=(0,16), ylim=(0,.01), figsize=(16,6))
In [6]:
Copied!
I.plot('Ez', y2='Bz', figsize=(16,6))
plt.title('Fields seen by the bunch centroid');
I.plot('Ez', y2='Bz', figsize=(16,6))
plt.title('Fields seen by the bunch centroid');
In [7]:
Copied!
Pi = I.particles['initial_particles']
Pi.plot('t', 'pz')
Pi = I.particles['initial_particles']
Pi.plot('t', 'pz')
In [8]:
Copied!
Pf = I.particles['final_particles']
Pf = I.particles['final_particles']
In [9]:
Copied!
Pf.plot('x', 'y')
Pf.plot('x', 'y')
In [10]:
Copied!
Pf.plot('delta_z', 'pz')
Pf.plot('delta_z', 'pz')
In [11]:
Copied!
Pf.plot('x_bar', 'px_bar')
Pf.plot('x_bar', 'px_bar')