Skip to content
Open
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
16 changes: 15 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 @@ -112,6 +112,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 All @@ -138,6 +140,18 @@ def getRingParametersDict(self, momentum, mass):
nuy = math.acos(cos_phi_y) / (2 * math.pi) * sign_y
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