Replies: 2 comments
-
I made a few modifications to your example:
and I get it running: import at
from at import Drift, Quadrupole, Bend, Corrector, Sextupole, Monitor, RFCavity
import numpy as np E0 = 3e9
Ncells = 30
Kq = 0.1*np.sqrt(2)
L = 3
ksf = 0.00
ksd = -0.00
Dr = Drift('Dr', L/8)
Drh = Drift('Dr', Dr.Length/2)
QF1 = Quadrupole('QF1', L/4, Kq)
QD2 = Quadrupole('QD2', L/4, -Kq)
QD3 = Quadrupole('QD3', L/4, -Kq)
QF4 = Quadrupole('QF4', L/4, Kq)
Dip = Bend('Bend', L/2, 2*np.pi/(2*Ncells))
SF = Sextupole('SF', Dr.Length/2, ksf)
SD = Sextupole('SD', Dr.Length/2, ksd)
BPM1 = Monitor('BPM1')
BPM2 = Monitor('BPM2')
BPM3 = Monitor('BPM3')
BPM4 = Monitor('BPM4') Lc = 0 #Cavity Length
Vc = 1e6 #Cavity Voltage
fc = 0
h = 1 #Harmonic Number
#rfc = RFCavity('CA', Lc, Vc, fc, h, E0, PassMethod = 'CavityPass')
rfc = RFCavity('CA', Lc, Vc, fc, h, E0, PassMethod = 'IdentityPass')
arc = [rfc,Dr, Dr, Dr, BPM1, Dr, Dr, Dr, QF1, Dr, Dr, QD2, Dr, Dr, Dip, BPM2, Dip, Drh, QD3, Drh, SD, Drh, Drh, Drh, BPM3, QF4, Drh, SF]
arc = at.Lattice(arc, energy=E0, periodicity = Ncells)
ring = at.Lattice(arc * int(Ncells/2),energy=E0, periodicity=1)
ring.set_cavity(Frequency=at.Frf.NOMINAL) print(arc.radiation_parameters())
ring.radiation_on()
print(ring.envelope_parameters())
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@lfarv Thank you very much, i still have a problem when i run the code, an error of " 'Lattice' object has no attribute 'set_cavity'" arises from the line : |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I am tiring to get the ring parameters using the envelope parameters function in PyAT, i run the following code first with setting the radiation off but i got an error massage that it should be on, so i turned it on and the error now is " singular matrix" Could you please give feedback on this.
Thank you in advance
_**from at import Drift, Quadrupole, Bend, Corrector, Sextupole, Monitor
E0 = 3e9
Ncells = 30
Kq = 0.1*np.sqrt(2)
L = 3
ksf = 0.00
ksd = -0.00
Dr = Drift('Dr', L/8)
Drh = Drift('Dr', Dr.Length/2)
QF1 = Quadrupole('QF1', L/4, Kq,
PassMethod = 'StrMPoleSymplectic4Pass')
QD2 = Quadrupole('QD2', L/4, -Kq,
PassMethod = 'StrMPoleSymplectic4Pass')
QD3 = Quadrupole('QD3', L/4, -Kq,
PassMethod = 'StrMPoleSymplectic4Pass')
QF4 = Quadrupole('QF4', L/4, Kq,
PassMethod = 'StrMPoleSymplectic4Pass')
Dip = Bend('Bend', L/2, 2np.pi/(2Ncells),
PassMethod = 'BndMPoleSymplectic4Pass')
SF = Sextupole('SF', Dr.Length/2, ksf,
PassMethod = 'StrMPoleSymplectic4Pass')
SD = Sextupole('SD', Dr.Length/2, ksd,
PassMethod = 'StrMPoleSymplectic4Pass')
BPM1 = Monitor('BPM1')
BPM2 = Monitor('BPM2')
BPM3 = Monitor('BPM3')
BPM4 = Monitor('BPM4')
from at import RFCavity
Lc = 0 #Cavity Length
Vc = 1e6 #Cavity Voltage
fc = ring.circumference/299792458 #Cavity Frequency
h = 1 #Harmonic Number
#rfc = RFCavity('CA', Lc, Vc, fc, h, E0, PassMethod = 'CavityPass')
rfc = RFCavity('CA', Lc, Vc, fc, h, E0, PassMethod = 'CavityPass')
arc = [rfc,Dr, Dr, Dr, BPM1, Dr, Dr, Dr, QF1, Dr, Dr, QD2, Dr, Dr, Dip, BPM2, Dip, Drh, QD3, Drh, SD, Drh, Drh, Drh, BPM3, QF4, Drh, SF]
arc = at.Lattice(arc, energy=E0, periodicity = Ncells)
ring = at.Lattice(arc * int(Ncells/2),energy=E0, periodicity=1)
ring = at.Lattice(ring)
#ring.radiation_off()
ring.radiation_on()
env = ring.envelope_parameters()](url)**_
Beta Was this translation helpful? Give feedback.
All reactions