Home > lattice > element_creation > atquadrupole.m

atquadrupole

PURPOSE ^

ATQUADRUPOLE(FAMNAME,LENGTH,K,PASSMETHOD)

SYNOPSIS ^

function elem=atquadrupole(fname,varargin)

DESCRIPTION ^

ATQUADRUPOLE(FAMNAME,LENGTH,K,PASSMETHOD)
    creates a quadrupole element with Class 'Quadrupole'

FAMNAME    family name
LENGTH     length [m]
K          strength [m-2]
PASSMETHOD    tracking function, defaults to 'QuadLinearPass'

ATQUADRUPOLE(FAMNAME,LENGTH,K,PASSMETHOD,'FIELDNAME1',VALUE1,...)
   Each pair {'FIELDNAME',VALUE} is added to the element

See also: ATDRIFT, ATSEXTUPOLE, ATSBEND, ATRBEND
          ATMULTIPOLE, ATTHINMULTIPOLE, ATMARKER, ATCORRECTOR

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function elem=atquadrupole(fname,varargin)
0002 %ATQUADRUPOLE(FAMNAME,LENGTH,K,PASSMETHOD)
0003 %    creates a quadrupole element with Class 'Quadrupole'
0004 %
0005 %FAMNAME    family name
0006 %LENGTH     length [m]
0007 %K          strength [m-2]
0008 %PASSMETHOD    tracking function, defaults to 'QuadLinearPass'
0009 %
0010 %ATQUADRUPOLE(FAMNAME,LENGTH,K,PASSMETHOD,'FIELDNAME1',VALUE1,...)
0011 %   Each pair {'FIELDNAME',VALUE} is added to the element
0012 %
0013 %See also: ATDRIFT, ATSEXTUPOLE, ATSBEND, ATRBEND
0014 %          ATMULTIPOLE, ATTHINMULTIPOLE, ATMARKER, ATCORRECTOR
0015 
0016 [rsrc,L,K,method]=decodeatargs({0,[],'QuadLinearPass'},varargin);
0017 [L,rsrc]=getoption(rsrc,'Length',L);
0018 [K,rsrc]=getoption(rsrc,'K',K);
0019 [method,rsrc]=getoption(rsrc,'PassMethod',method);
0020 [PolynomB,rsrc]=getoption(rsrc,'PolynomB',[0 0]);
0021 [cl,rsrc]=getoption(rsrc,'Class','Quadrupole');
0022 if ~isempty(K), PolynomB(2)=K; end
0023 elem=atbaselem(fname,method,'Class',cl,'Length',L,'K',PolynomB(2),...
0024     'PolynomB',PolynomB,rsrc{:});
0025 end

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005