Home > pubtools > local_lattice_params > atmakeXYProjectionEllipse.m

atmakeXYProjectionEllipse

PURPOSE ^

atmakeXYProjectionEllipse( sigxx,sigyy,sigxy ) gives points to plot the contour ellipses

SYNOPSIS ^

function [x,y] =atmakeXYProjectionEllipse( sigxx,sigyy,sigxy )

DESCRIPTION ^

atmakeXYProjectionEllipse( sigxx,sigyy,sigxy ) gives points to plot the contour ellipses
given the second spatial moments <x^2>, <y^2>, and <xy>

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [x,y] =atmakeXYProjectionEllipse( sigxx,sigyy,sigxy )
0002 %atmakeXYProjectionEllipse( sigxx,sigyy,sigxy ) gives points to plot the contour ellipses
0003 %given the second spatial moments <x^2>, <y^2>, and <xy>
0004 
0005 %we solve for effective Twiss parameters and emittance.
0006 %Note that since this is x-y space, this is just a computational tool
0007 %This emittance is not constant around ring.
0008 
0009 %first compute epsilon
0010 eps=sqrt(sigxx.*sigyy-sigxy.^2);
0011 %now compute beta,gamma,alpha
0012 beta=sigxx./eps;
0013 gamma=sigyy./eps;
0014 alpha=-sigxy./eps;
0015 
0016 t=linspace(0,2*pi);
0017 xh=sqrt(eps)*cos(t);
0018 yh=sqrt(eps)*sin(t);
0019 
0020 x=sqrt(beta)*xh;
0021 y=(-alpha/sqrt(beta))*xh+(1/sqrt(beta))*yh;
0022

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