AWA Flat Beams¶
Example courtesy of T. Xu
In [ ]:
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 [ ]:
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 [ ]:
Copied!
%%time
I.numprocs = 0
I.run()
%%time
I.numprocs = 0
I.run()
In [ ]:
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 [ ]:
Copied!
I.plot(
["sigma_x", "sigma_y", "sigma_z"],
y2="mean_kinetic_energy",
xlim=(0, 16),
ylim=(0, 0.01),
figsize=(16, 6),
)
I.plot(
["sigma_x", "sigma_y", "sigma_z"],
y2="mean_kinetic_energy",
xlim=(0, 16),
ylim=(0, 0.01),
figsize=(16, 6),
)
In [ ]:
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 [ ]:
Copied!
Pi = I.particles["initial_particles"]
Pi.plot("t", "pz")
Pi = I.particles["initial_particles"]
Pi.plot("t", "pz")
In [ ]:
Copied!
Pf = I.particles["final_particles"]
Pf = I.particles["final_particles"]
In [ ]:
Copied!
Pf.plot("x", "y")
Pf.plot("x", "y")
In [ ]:
Copied!
Pf.plot("delta_z", "pz")
Pf.plot("delta_z", "pz")
In [ ]:
Copied!
Pf.plot("x_bar", "px_bar")
Pf.plot("x_bar", "px_bar")