Home > pubtools > LatticeTuningFunctions > correction > tune > testfittunedelta2fam.m

testfittunedelta2fam

PURPOSE ^

test errors and correction functions

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 test errors and correction functions

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % test errors and correction functions
0002 close all
0003 clear all
0004 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions');
0005 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/correction/response matrix')
0006 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/correction/');
0007 addpath('/mntdirect/_machfs/liuzzo/CODE/LatticeTuningFunctions/errors/');
0008 
0009 % load lattice
0010 s28d=load('/machfs/liuzzo/EBS/S28D/LATTICE/AT/S28Dmerged_PA.mat');
0011 
0012 ring=s28d.LOW_EMIT_RING_INJ;
0013 [l,t,c]=atlinopt(ring,0,1);
0014 r0=ring;
0015 
0016 % mark quadrupoles to use for tune matching
0017 indqf1=find(atgetcells(ring,'FamName','QF1\w*'));
0018 ring=atsetfieldvalues(ring,indqf1,'ForTuneF',1);                
0019 indqd2=find(atgetcells(ring,'FamName','QD2\w*'));
0020 ring=atsetfieldvalues(ring,indqd2,'ForTuneD',1);                
0021 
0022 % set errors, large, AT does not find a closed orbit
0023 ind=find(atgetcells(ring,'Class','Quadrupole','Sextupole'));
0024 dx=5e-6*randn(size(ind));
0025 dy=5e-6*randn(size(ind));
0026 
0027 rerr=atsetshift(ring,ind,dx,dy);
0028 
0029 %% test tune matching
0030 rerr=fittunedelta2fam(rerr,r0);

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