simple storage ring for single particle dynamics simulation.
Project description
SimpleStorageRing
SimpleStorageRing is a python project to simulate single particle dynamics in a simple storage ring and calculate lattice data.
You can sort the components to generate a ring, and then calculate the data of storage ring by Courant-Snyder method.
Installation
Download from PyPi:
pip install -U simplestoragering
or download the source files and then compile them using Cython:
git clone https://github.com/wei0852/simplestoragering.git
cd simplestoragering
pip install .
Usage
see example_features.py.
set reference particle (electron) energy first:
set_ref_energy(energy_MeV: float)
or
set_ref_gamma(gamma: float)
components
A storage ring consists of many magnets to guide electron beam,
MarkDriftHBend, horizontal bend.QuadrupoleSextupoleOctupole
$k_n = \dfrac{q}{P_0} \dfrac{\partial^n B_y}{\partial x^n}$. All the components are child classes of the Element class.
Courant-Snyder lattice
CSLattice(ele_list: list[Element], n_periods: int), lattice solved by C-S method.
Functions
symplectic_track(particle, lattice, n_turns: int, record = True)
track_4d_closed_orbit(lattice: CSLattice, delta, resdl_limit=1e-16, matrix_precision=1e-9)
output_opa_file(lattice: CSLattice, file_name=None)
output_elegant_file(lattice: CSLattice, filename=None, new_version=True)
chromaticity_correction(lattice: CSLattice, sextupole_name_list: list, target: list=None, initial_k2=None, update_sext=True, verbose=True)
adjust_tunes(lattice: CSLattice, quadrupole_name_list: list, target: list, iterations=5, initialize=True)
DA & LMA
- XYGrid()
- XDeltaGrid()
- NLine()
- LocalMomentumAperture()
and some functions:
plot_layout_in_ax(ele_list: list, ax: Axes, ratio=0.03)
plot_resonance_line_in_ax(ax: Axes, order: int = 3, refnux: float=None, refnuy: float=None)
plot_lattice(ele_list, parameter: str or list[str], with_layout=True)
or use get_col(ele_list, parameter) to get a column of the parameter along the element list.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simplestoragering-0.0.2.tar.gz.
File metadata
- Download URL: simplestoragering-0.0.2.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3856f872cc2d6e9e3b3d514b46bfaf5a7f9f1121a97d0f2be5ee0492ad050916
|
|
| MD5 |
049052af198fe4aa4606a6b26e06b530
|
|
| BLAKE2b-256 |
bd6dfc391440e6c554fa05b84137b3504bdf5f488da13f4d11a62524a4a0aa4c
|
File details
Details for the file simplestoragering-0.0.2-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: simplestoragering-0.0.2-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
343b32740788169ebfb0608dadb77e8999ab29e3e9bfa6dbeccd3dbc31f0a447
|
|
| MD5 |
8c2db8046035993adf937a05956d48bd
|
|
| BLAKE2b-256 |
42f017742655a1a919387e07f2f7c3e1439faa8375e917a5f12210cad67cca12
|
File details
Details for the file simplestoragering-0.0.2-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: simplestoragering-0.0.2-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbb1c45629941af5606bce94605260ea761ba29b075419dacb68fad83624640d
|
|
| MD5 |
5b513f234307a7df98414c4723614f8c
|
|
| BLAKE2b-256 |
c047ed685795a4461395524bbbb738d39999a7896daf623d90ae25309dbad5be
|
File details
Details for the file simplestoragering-0.0.2-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: simplestoragering-0.0.2-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c566d1132943c5986e90733db078347ed077eae2362a881e591ddf46ffefa43f
|
|
| MD5 |
813e9e566b23cb6c4106db242e37caec
|
|
| BLAKE2b-256 |
5da5ea99a6fdda88e9d02fc80ba9f173b08ef357f973929c552611010f73a031
|
File details
Details for the file simplestoragering-0.0.2-cp39-cp39-win_amd64.whl.
File metadata
- Download URL: simplestoragering-0.0.2-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 1.9 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de27ae699b156d806f73f613149afcdd2a54dd0ca3ee66e9d045f4dee282dd3f
|
|
| MD5 |
8039bed250255bda6b860d9a39b67db6
|
|
| BLAKE2b-256 |
346eb3d08e51c635c3a1d24d78ba3f2a8380322d1ca34c1187b50960d12b5111
|