Skip to content

Commit ede598b

Browse files
Update README.md
1 parent 5af16e1 commit ede598b

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
11
# apace
2-
Depends on Python 3.7
2+
**apace** is yet **a**nother **p**article **a**ccelerator **c**od**e** designed for the optimization of beam optics. It is available as Python packages and aims to provide a convenient and straightforward API to make use Python's numeros scientific libaries.
33

4-
## Usage
5-
import apace
6-
```python
7-
import apace as ap
4+
5+
6+
## Installing
7+
Install and update using pip:
8+
9+
```sh
10+
pip install -U apace
811
```
912

10-
### Linear Beam Dynamics
11-
Import the linear beam dynamics module:
13+
## Dependencies
14+
- Python 3.7 or higher
15+
- CFFI 1.0.0 or higher
16+
- NumPy/SciPy
17+
- Matplotlib
18+
19+
20+
### A Simple Example
21+
import apace
1222
```python
13-
from apace.linbeamdyn import LinBeamDyn
23+
import apace as ap
1424
```
1525

16-
Create a ring consting out of FODO cells:
26+
Create a ring consisting of 8 FODO cells:
1727
```python
1828
D1 = ap.Drift('D1', length=0.55)
1929
Q1 = ap.Quad('Q1', length=0.2, k1=1.2)
2030
B1 = ap.Bend('B1', length=1.5, angle=0.392701, e1=0.1963505, e2=0.1963505)
2131
Q2 = ap.Quad('Q2', length=0.4, k1=-1.2)
22-
fodo = ap.Line('fodo-cell', [Q1, D1, B1, D1, Q2, D1, B1, D1, Q1])
23-
ring = ap.Mainline('fodo-ring', [fodo] * 8)
32+
fodo = ap.Cell('FODO-CELL', [Q1, D1, B1, D1, Q2, D1, B1, D1, Q1])
33+
ring = ap.MainCell('FODO-RING', [fodo] * 8)
2434
```
2535

26-
Get twiss parameters:
36+
Calculate the twiss parameters:
2737
```python
2838
twiss = ap.Twiss(ring)
2939
```
3040

3141

32-
Plot twissfunctions:
42+
Plot horizontal and vertical beta functions using matplotlib:
3343
```python
34-
plot(twiss.s, twiss.beta_x, twiss.beta_y, twiss.eta_x)
44+
plt.plot(twiss.s, twiss.beta_x, twiss.beta_y, twiss.eta_x)
3545
```
46+
47+
## License
48+
[GNU General Public License v3.0](https://github.com/andreasfelix/apace/blob/master/LICENSE)
49+

0 commit comments

Comments
 (0)