Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added an s-dependent IOTA lens example #467

Merged
merged 44 commits into from
Dec 1, 2023
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3d4e114
Examples for 3D space charge benchmarking
cemitch99 Jun 7, 2022
38cc6c7
Update input_kurth_10nC.in
cemitch99 Dec 5, 2022
9d82f8a
Add s-dependent IOTA lens example.
cemitch99 Nov 15, 2023
cefe2c0
Delete examples/kurth/input_kurth_10nC.in
cemitch99 Nov 15, 2023
3fcf3e9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 15, 2023
5e66562
Add IOTA lattice with full nonlinear lens.
cemitch99 Nov 16, 2023
4fa23b2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 16, 2023
897419e
Update run_iotalattice_sdep.py
cemitch99 Nov 27, 2023
9b4fea4
Update run_iotalattice_sdep.py
cemitch99 Nov 28, 2023
95318b9
Update examples/iota_lattice/run_iotalattice_sdep.py
cemitch99 Nov 28, 2023
a676d5d
Update run_iotalattice_sdep.py
cemitch99 Nov 28, 2023
00b2d2a
Add app IOTA lens example.
cemitch99 Nov 29, 2023
38191a0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 29, 2023
6b8e261
Add app input file for full IOTA lattice.
cemitch99 Nov 29, 2023
3871352
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 29, 2023
98a3921
Add analysis scripts.
cemitch99 Nov 29, 2023
06ab40a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 29, 2023
7167610
Add tests to CMakeLists.
cemitch99 Nov 29, 2023
6ec1a9b
Merge branch 'development' into add_iotalens_sdep
cemitch99 Nov 29, 2023
b1a1067
Update analysis_iotalens_sdep.py
cemitch99 Nov 29, 2023
3aa2a35
Update analysis_iotalattice_sdep.py
cemitch99 Nov 29, 2023
f4639ab
Update CMakeLists.txt
cemitch99 Nov 29, 2023
e7ccb1c
Update analysis_iotalattice_sdep.py
cemitch99 Nov 29, 2023
2679c8c
Update analysis_iotalens_sdep.py
cemitch99 Nov 29, 2023
3429267
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 29, 2023
15eb44b
Update CMakeLists.txt
cemitch99 Nov 29, 2023
9d0a789
Update CMakeLists.txt
cemitch99 Nov 29, 2023
39f0c3c
Update CMakeLists.txt
cemitch99 Nov 29, 2023
ab5c403
Add dummy Python script analysis files.
cemitch99 Nov 29, 2023
99524ae
Update CMakeLists.txt
cemitch99 Nov 30, 2023
21918c4
Update analysis_iotalattice_sdep_dum.py
cemitch99 Nov 30, 2023
0f90f74
Update analysis_iotalens_sdep_dum.py
cemitch99 Nov 30, 2023
2185959
Add values of alpha, beta,c,t to Python invariant calculation.
cemitch99 Dec 1, 2023
c66491a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2023
10d00a1
Update analysis_iotalens_sdep_dum.py
cemitch99 Dec 1, 2023
f0d409e
Update analysis_iotalattice_sdep_dum.py
cemitch99 Dec 1, 2023
1953cb4
Update CMakeLists.txt
cemitch99 Dec 1, 2023
da497f3
Delete examples/iota_lattice/analysis_iotalattice_sdep_dum.py
cemitch99 Dec 1, 2023
782c5ec
Delete examples/iota_lens/analysis_iotalens_sdep_dum.py
cemitch99 Dec 1, 2023
76234a9
Update examples documentation.
cemitch99 Dec 1, 2023
2ec2b4d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 1, 2023
d79cf2e
Update analysis_iotalens_sdep.py
cemitch99 Dec 1, 2023
b9d09ee
Update analysis_iotalens_sdep.py
cemitch99 Dec 1, 2023
66bc0a9
Tiny Formatting of Docs
ax3l Dec 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add values of alpha, beta,c,t to Python invariant calculation.
cemitch99 committed Dec 1, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 2185959bf63a53cd3c8537bc24dee3626d517071
3 changes: 3 additions & 0 deletions examples/iota_lattice/run_iotalattice_sdep.py
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@
# domain decomposition & space charge mesh
sim.init_grids()

# diagnostics: IOTA nonlinear lens invariants calculation
sim.set_diag_iota_invariants(alpha=1.376381920471173, beta=1.892632003628881, tn=0.4, cn=0.01)

# init particle beam
energy_MeV = 2.5
bunch_charge_C = 1.0e-9 # used with space charge
16 changes: 3 additions & 13 deletions examples/iota_lens/run_iotalens_sdep.py
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@
# domain decomposition & space charge mesh
sim.init_grids()

# diagnostics: IOTA nonlinear lens invariants calculation
sim.set_diag_iota_invariants(alpha=1.376381920471173, beta=1.892632003628881, tn=0.4, cn=0.01)

# load a 2.5 MeV proton beam
kin_energy_MeV = 2.5 # reference energy
bunch_charge_C = 1.0e-9 # used with space charge
@@ -43,17 +46,6 @@
muypy=0.8090169943749474,
mutpt=0.0,
)
# distr = distribution.Waterbag(
# sigmaX=1.865379469388e-003,
# sigmaY=2.0192133150418e-003,
# sigmaT=1.0e-4,
# sigmaPx=1.402566720991e-003,
# sigmaPy=9.57593913381e-004,
# sigmaPt=0.0,
# muxpx=-0.482260919078473,
# muypy=-0.762127656873158,
# mutpt=0.0,
# )

sim.add_particles(bunch_charge_C, distr, npart)

@@ -77,15 +69,13 @@
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
)
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]
sim.lattice.extend(segments)

# focusing lens