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

Add quad triplet optimization example #539

Merged
merged 7 commits into from
Mar 28, 2024

Conversation

cemitch99
Copy link
Member

@cemitch99 cemitch99 commented Feb 28, 2024

Added an example of a quadrupole triplet focusing system, illustrating matching of a beam to small spot size at focus (target values of beta_x = beta_y and alpha_x = alpha_y = 0).

This example will be modified to illustrate the use of optimization.

  • Add example input with nominal (near-optimal) parameters
  • Update examples/CmakeLists.txt
  • Update documentation
  • Add plot script
  • Modify Python script to allow optimization of quad strengths and/or spacing

@cemitch99 cemitch99 requested review from ax3l and n01r February 28, 2024 22:47
Copy link
Member

@n01r n01r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @cemitch99! Looks good 🙂
I marked some tiny details with comments.
Will the last bullet point about the actual optimization also be done in this PR or on a follow-up?

examples/optimize_triplet/README.rst Outdated Show resolved Hide resolved
examples/optimize_triplet/input_triplet.in Outdated Show resolved Hide resolved
examples/optimize_triplet/run_triplet.py Outdated Show resolved Hide resolved
examples/optimize_triplet/analysis_triplet.py Show resolved Hide resolved
@cemitch99
Copy link
Member Author

Here is an illustration of the beta functions.
Optimized_Triplet.pdf

@ax3l ax3l added the component: tests examples, tests and benchmarks label Mar 1, 2024
Copy link
Member

@ax3l ax3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

Let's add the visualization of the beta functions as a visualization script (as we do in the FODO example)?

examples/optimize_triplet/README.rst Outdated Show resolved Hide resolved
@cemitch99
Copy link
Member Author

Good idea. Working on the visualization script now.

@ax3l
Copy link
Member

ax3l commented Mar 4, 2024

Thank you so much. I'll try to add the optimization part this week :)

@ax3l
Copy link
Member

ax3l commented Mar 5, 2024

cs_twiss_beta

@ax3l ax3l force-pushed the add_opt_example branch 4 times, most recently from bd5a1b5 to 229d506 Compare March 5, 2024 08:34
@ax3l ax3l force-pushed the add_opt_example branch 2 times, most recently from eda162e to 1df3f81 Compare March 6, 2024 01:31
@ax3l ax3l force-pushed the add_opt_example branch 2 times, most recently from 90cabfc to e8c1cc3 Compare March 6, 2024 05:22
@ax3l ax3l mentioned this pull request Mar 6, 2024
@ax3l ax3l force-pushed the add_opt_example branch 2 times, most recently from 1afeb5d to 591ad8c Compare March 12, 2024 21:51
tests/python/test_xopt.py Fixed Show fixed Hide fixed
tests/python/test_xopt.py Fixed Show fixed Hide fixed
@ax3l ax3l force-pushed the add_opt_example branch 2 times, most recently from ee17b15 to 7191e77 Compare March 13, 2024 03:14
# -*- coding: utf-8 -*-

import amrex.space3d as amr
import impactx

Check notice

Code scanning / CodeQL

Module is imported with 'import' and 'import from' Note

Module 'impactx' is imported with both 'import' and 'import from'.
tests/python/test_xopt.py Dismissed Show dismissed Hide dismissed
@ax3l ax3l force-pushed the add_opt_example branch from f1e2b90 to fd3fcbb Compare March 26, 2024 06:57
@ax3l ax3l force-pushed the add_opt_example branch from 5e59aa4 to c9874b3 Compare March 26, 2024 07:47
@ax3l ax3l self-assigned this Mar 26, 2024
examples/optimize_triplet/README.rst Outdated Show resolved Hide resolved
examples/optimize_triplet/README.rst Outdated Show resolved Hide resolved
@ax3l ax3l force-pushed the add_opt_example branch from 2d6afc1 to f0274a6 Compare March 28, 2024 00:59
@ax3l ax3l enabled auto-merge (squash) March 28, 2024 01:00
@ax3l ax3l disabled auto-merge March 28, 2024 01:12
@ax3l ax3l merged commit 75ec1e5 into ECP-WarpX:development Mar 28, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tests examples, tests and benchmarks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants