atmatch#
Functions
Applies a series of variations to variables as described in |
|
This funciton evaluates the contraints defined in Constraints for lattice |
|
this functions retrives variable Values for two rings to compare |
|
This funciton evaluates the contraints defined in Constraints for lattice |
|
atVarBuilder create a simple variable structure for use with atmatch |
|
Generate a constraint on linear optics for atmatch |
|
- atApplyVariation()#
- Applies a series of variations to variables as described inVariables.Variables is a cell array of structuresVariables struct(‘Indx’,{[indx],…@(ring,varval)fun(ring,varval,…),…},…‘Parameter’,{{‘paramname’,{M,N,…},…},…[initialvarval],…},…‘LowLim’,{[val],[val],…},…‘HighLim’,{[val],[val],…},…)varargin{1} may be a set of delta_0 to applydelata_0: is the applied set of perturbationsvarNum : length(delta_0)
- atDisplayConstraintsChange()#
- This funciton evaluates the contraints defined in Constraints for latticeConstraints: cell array of struct(‘Fun’,@functname,’Min’,min,’Max’,max,’OtherParameters’,otherargs}Constraints: structure array struct(‘Fun’,@(ring)functname(ring,parameters),‘Min’,min, % of unweigthed funct val‘Max’,max,‘Weight’,w,‘RefPoints’,[])Constraints: structure array struct(…‘Fun’,@(ring,lindata,globaldata,refpts)functname(…ring,lindata,globaldata,refpts,parameters),‘Min’,min, % of unweigthed funct val‘Max’,max,‘Weight’,w,‘RefPoints’,refpts);lindata is the output of atlinoptglobdata.tune=tune fromk atlinoptglobdata.chrom=chrom from atlinoptfunctname: handle to vector valued function: [res]=functname(THERING,otherargs)min and max have to be the same size as res. (this allows to give functions as limits!)created 30-8-2012updated 12-10-2012 other_function_args is a cell array, ifit is not it istransformed in a cell array
- atDisplayVariableChange()#
- this functions retrives variable Values for two rings to compareVariables is a structure arrayVariables struct(‘Indx’,{[indx],…@(ring,varval)fun(ring,varval,…),…},…‘Parameter’,{{‘paramname’,{M,N,…},…},…[initialvarval],…},…‘LowLim’,{[val],[val],…},…‘HighLim’,{[val],[val],…},…)
- atEvaluateConstraints()#
- This funciton evaluates the contraints defined in Constraints for latticeTHERINGConstraints: structure array struct(…‘Fun’,@functname(ring,lindata,globaldata),‘Min’,min,‘Max’,max,‘Weight’,w,‘RefPoints’,refpts);lindata is the output of atlinopt at the requested locationsglobdata.fractune=tune fromk atlinoptglobdata.chromaticity=chrom from atlinoptfunctname must return a row vector of values to be optimizedmin, max and weight must have the same size as the return value offunctname
- atGetPenalty()#
- Evaluate the penalty function (distance from the target value of every constraint)
- atGetVariableValue()#
- this functions retrives variable ValuesVariables is a structure array of structuresVariables struct(‘Indx’,{[indx],…@(ring,varval)fun(ring,varval,…),…},…‘Parameter’,{{‘paramname’,{M,N,…},…},…[initialvarval],…},…‘LowLim’,{[val],[val],…},…‘HighLim’,{[val],[val],…},…)
- atVariableBuilder(refpts, parameter, highlim, lowlim)#
- atVarBuilder create a simple variable structure for use with atmatchSingle variable : it corresponds to a scalar numeric value to be varied inthe optimization process. It may be applied to several elements.It isrepresented as a scalar structure.var=atVariableBuilder(refpts,parameter,highlim,lowlim)refpts: indices of the variable elements or logical maskparameter: cell array defining the field name and indices of thevariable parameterlowlim: minimum parameter value (default: no limit)highlim: maximum parameter value (default: no limit)Example: qf=atgetcells(ring,’FamName’,’QF’);var=atVariableBuilder(qf,{‘polynomb’,{2}});var=atVariableBuilder(@func,inival,highlim,lowlim)func: function building a new ring for the given variable valuecalled as new_ring=func(base_ring,variable)inival: initial value of the variablelowlim: minimum parameter value (default: no limit)highlim: maximum parameter value (default: no limit)Example: var=atVariableBuilder(@(r,v) some_function(r,v,…), 0.0);var=atVariableBuilder(ring,location,…)In this syntax, the location may be specified as the family name of thevariable elementsExample: var=atVariableBuilder(ring,’qf’,{‘polynomb’,{2}});Multiple variables: if location,parameter,lowlim and highlim are cell arrayswith the same length or with length 1, atVariableBuilder will build astructure array of variables. Examples:vars=atVariableBuilder(ring,{‘qd’,’sf’},{{‘polynomb’,{1,2}},{‘polynomb’,{1,3}}});qf=atgetcells(ring,’FamName’,’QF’);qd=atgetcells(ring,’FamName’,’QD’);vars=atVariableBuilder({qf,qd},{{‘polynomb’,{1,2}}});vars=atVariableBuilder({qf,@buildring},{{‘polynomb’,{1,2}},0.0})More sophisticated variables, can be defined using directly the variablestructure. The general variable definition is:ex: Variab=struct(‘Indx’,{findcells(RING,’FamName’,’QFM’),…k1start(1)},…‘LowLim’,{[],[]},…‘HighLim’,{[],[]},…‘Parameter’,{{‘PolynomB’,{1,2}},…{‘FUN’,…@(RING,K1Val)VaryQuadFam(RING,K1Val,’QDM’)}}…);
- atlinconstraint(refpts, params, vmin, vmax, weight)#
- Generate a constraint on linear optics for atmatchconstraint=atlinconstraint(refpts,params,vmin,vmax,weight)REFPTS Row vector of selected positionsPARAMS Cell array describing the desired value at each positionThe length of params must be 1 or length(REFPTS)Each element of PARAMS is itself a cell array defining the fieldname and indices in the structure returned by atlinopt. Additionalfield names are: ‘tune’ and ‘chromaticity’.VMIN Minimum value for the constraintVMAX Maximum value for the constraintCONSTRAINT Row structure array to be used in atmatchREFPTS, PARAMS, VMIN, VMAX, WEIGHT must have the same length,or have length 1Example:>> c1=atlinconstraint(1,{{‘closedorbit’,{3}},{‘closedorbit’,{4}}},[0 0],[0 0],[1/6 6]);See also
atmatch()
,atVariableBuilder()
- atmatch()#