Home > atplot > plotfunctions > plotWdispP.m

plotWdispP

PURPOSE ^

plotWdispP Plot W functions

SYNOPSIS ^

function varargout=plotWdispP(varargin)

DESCRIPTION ^

plotWdispP    Plot W functions

Helper function for atplot: plot
- W functions (derivatives of beta-functions versus momentum) on left axis
- derivative of dispersion on right axis

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function varargout=plotWdispP(varargin)
0002 %plotWdispP    Plot W functions
0003 %
0004 %Helper function for atplot: plot
0005 %- W functions (derivatives of beta-functions versus momentum) on left axis
0006 %- derivative of dispersion on right axis
0007 
0008 if nargout == 1
0009     [ring,dpp]=deal(varargin{2:3});
0010     refpts=1:length(ring)+1;
0011     DE=0.001;
0012     
0013     [lz,~,~]=atlinopt(ring,dpp,refpts);
0014     [lpd,~,~]=atlinopt(ring,dpp+DE,refpts);
0015     [lmd,~,~]=atlinopt(ring,dpp-DE,refpts);
0016     bz=cat(1,lz.beta);
0017     bp=cat(1,lpd.beta);
0018     bm=cat(1,lmd.beta);
0019     az=cat(1,lz.alpha);
0020     ap=cat(1,lpd.alpha);
0021     am=cat(1,lmd.alpha);
0022     
0023     aa=((bp-bm)./bz)/2/DE;
0024     bb=((ap-am)-az./bz.*(bp-bm))/2/DE;
0025     
0026     plotdata(1).values=sqrt(aa.^2+bb.^2);
0027     plotdata(1).labels={'W_x','W_z'};%{'\beta_x/D\delta','\beta_z/D\delta'};
0028     plotdata(1).axislabel='W_x W_z [m]';
0029     
0030     dp=cat(2,lpd.Dispersion)';
0031     dm=cat(2,lmd.Dispersion)';
0032     plotdata(2).values=100*(dp(:,1)-dm(:,1))/2/DE;
0033     plotdata(2).labels={'\partial\eta_{x}/\partial\delta'};
0034     plotdata(2).axislabel='D'' [cm]';
0035     varargout={plotdata};
0036 else
0037     s=findspos(varargin{1},1:length(varargin{1})+1);
0038     varargout={s,plotWdispP([],varargin{:})};
0039 end
0040 end

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