Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 14 additions & 1 deletion py/orbit/matrix_lattice/MATRIX_Lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"""
import os
import math

import numpy as np

# import bunch
from orbit.core.bunch import Bunch
Expand Down Expand Up @@ -114,6 +114,8 @@ def getRingParametersDict(self, momentum, mass):
mt = self.oneTurnMatrix
res_dict["fractional tune x"] = None
res_dict["fractional tune y"] = None
res_dict["fractional tune 1"] = None
res_dict["fractional tune 2"] = None
res_dict["alpha x"] = None
res_dict["alpha y"] = None
res_dict["beta x [m]"] = None
Expand Down Expand Up @@ -145,6 +147,17 @@ def getRingParametersDict(self, momentum, mass):
res_dict["fractional tune x"] = nux
res_dict["fractional tune y"] = nuy

# Eigentunes
M = np.array([[mt.get(i, j) for j in range(4)] for i in range(4)])
eigvals, _ = np.linalg.eig(M)
eigvals = eigvals[[0, 2]]
cos_phi = np.real(eigvals)
phi = np.arccos(cos_phi)
nu = phi / (2.0 * np.pi)
nu %= 1.0
res_dict["fractional tune 1"] = float(nu[0])
res_dict["fractional tune 2"] = float(nu[1])

# Alpha, beta, gamma
beta_x = mt.get(0, 1) / sin_phi_x
beta_y = mt.get(2, 3) / sin_phi_y
Expand Down
Loading
Loading