source: MML/trunk/at/simulator/element/user/crabcavity.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 921 bytes
Line 
1function z = crabcavity(fname,phi0,V,F,method)
2% CRABCAVITY('FAMILYNAME',phase [m],Voltage[V], Frequency[Hz], 'METHOD')
3%       creates a new family (vertical crab cavity) in the FAMLIST - a structure with fields
4%               FamName                 family name
5%               Phase                   phase[m]
6%               Voltage                 peak voltage (V)
7%               Frequency               RF frequency [Hz]
8%               HarmNumber              Harmonic Number
9%               PassMethod              name of the function on disk to use for tracking
10% returns assigned address in the FAMLIST that uniquely identifies
11% the family
12
13global GLOBVAL
14
15ElemData.FamName = fname;  % add check for identical family names
16ElemData.TimeLag = phi0;
17ElemData.Length = 0;
18ElemData.Voltage = V;
19ElemData.Frequency = F;
20ElemData.Energy = GLOBVAL.E0;
21ElemData.PassMethod=method;
22
23global FAMLIST
24z = length(FAMLIST)+1; % number of declare families including this one
25FAMLIST{z}.FamName = fname;
26FAMLIST{z}.NumKids = 0;
27FAMLIST{z}.KidsList= [];
28FAMLIST{z}.ElemData= ElemData;
29
30
Note: See TracBrowser for help on using the repository browser.