Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 29, 2023
1 parent 00b2d2a commit 38191a0
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions examples/iota_lens/run_iotalens_sdep.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
muypy=0.8090169943749474,
mutpt=0.0,
)
#distr = distribution.Waterbag(
# distr = distribution.Waterbag(
# sigmaX=1.865379469388e-003,
# sigmaY=2.0192133150418e-003,
# sigmaT=1.0e-4,
Expand All @@ -53,7 +53,7 @@
# muxpx=-0.482260919078473,
# muypy=-0.762127656873158,
# mutpt=0.0,
#)
# )

sim.add_particles(bunch_charge_C, distr, npart)

Expand All @@ -76,18 +76,22 @@
# define the nonlinear lens segments
for j in range(0, num_lenses):
s = -lens_length / 2.0 + ds_half + j * ds
beta_star = lens_length/2.0 * 1.0/math.tan(math.pi * tune_advance)
# beta = beta_star * (1.0 + 4.0 * s**2 * math.tan(math.pi * tune_advance) ** 2 / lens_length**2)
beta = beta_star * (1.0 + (2.0 * s * math.tan(math.pi * tune_advance) / lens_length)**2)
beta_star = lens_length / 2.0 * 1.0 / math.tan(math.pi * tune_advance)
# beta = beta_star * (1.0 + 4.0 * s**2 * math.tan(math.pi * tune_advance) ** 2 / lens_length**2)
beta = beta_star * (
1.0 + (2.0 * s * math.tan(math.pi * tune_advance) / lens_length) ** 2
)
knll_s = t_strength * c_parameter**2 * ds / beta
cnll_s = c_parameter * math.sqrt(beta)
nllens = elements.NonlinearLens(knll=knll_s, cnll=cnll_s)
segments = [dr, nllens, dr]
# segments = [dr, dr]
# segments = [dr, dr]
sim.lattice.extend(segments)

# focusing lens
const = elements.ConstF(ds=1.0e-8, kx=12060.113295833, ky=12060.113295833, kt=1.0e-12, nslice=1)
const = elements.ConstF(
ds=1.0e-8, kx=12060.113295833, ky=12060.113295833, kt=1.0e-12, nslice=1
)
sim.lattice.append(const)
sim.lattice.append(monitor)

Expand Down

0 comments on commit 38191a0

Please sign in to comment.