imake_launch_angles_TCV_jd

PURPOSE ^

SYNOPSIS ^

function launch = imake_launch_angles_TCV_jd(angles)

DESCRIPTION ^

 This function creates a launch structure based on the launched angles and
 posision in TCV.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function launch = imake_launch_angles_TCV_jd(angles)
0002 %
0003 % This function creates a launch structure based on the launched angles and
0004 % posision in TCV.
0005 %
0006 id = angles.id;
0007 P1_R = angles.P1_R;
0008 P1_Z = angles.P1_Z;
0009 P1_theta = angles.P1_theta;
0010 P2_R = angles.P2_R;
0011 P2_Z = angles.P2_Z;
0012 P2_d = angles.P2_d;
0013 P3_Z = angles.P3_Z;
0014 phi = angles.phi;
0015 theta = angles.theta;
0016 %
0017 P4_theta = (theta - P1_theta)/2;
0018 %
0019 xp2 = P2_R - P1_R;
0020 yp2 = P2_Z - P1_Z;
0021 %
0022 yp4 = (yp2 - P2_d*cos(P4_theta) - tan(P4_theta)*(xp2 + P2_d*sin(P4_theta)))./...
0023       (1 + tan(P4_theta)*cot(P1_theta));
0024 xp4 = - yp4*cot(P1_theta);  
0025 %
0026 P4_R = P1_R + xp4; 
0027 P4_Z = P1_Z + yp4;
0028 %
0029 Pr4_X = P4_R;
0030 Pr4_Y =        (P4_Z - P3_Z)*sin(phi);
0031 Pr4_Z = P3_Z + (P4_Z - P3_Z)*cos(phi);
0032 %
0033 yR_L = sqrt(Pr4_X^2 + Pr4_Y^2);
0034 yZ_L = Pr4_Z;
0035 yphi_L = - atan(Pr4_Y./Pr4_X);
0036 %
0037 alpha_inv = atan(tan(theta)*sin(phi));
0038 yalpha_L = pi + alpha_inv + yphi_L;
0039 if yalpha_L > pi,
0040     yalpha_L = yalpha_L - 2*pi;
0041 end
0042 beta_inv = asin(sin(theta)*cos(phi));
0043 ybeta_L = pi/2 + beta_inv;
0044 %
0045 launch.id = id;
0046 launch.type = 'EC';
0047 launch.yR_L = yR_L;
0048 launch.yZ_L = yZ_L;
0049 launch.yphi_L = yphi_L;
0050 launch.yalpha_L = yalpha_L;
0051 launch.ybeta_L = ybeta_L;
0052 %
0053 if isfield(angles,'freq'),
0054     launch.omega_rf = angles.freq*2*pi;
0055 end
0056 %
0057 launch.yP_L = angles.P0;
0058 %
0059 launch.w0 = angles.w0;
0060 launch.z_L = angles.z_L;
0061 %
0062 launch.dNpar0 = NaN;%Calculated from waist and focal point
0063 %
0064 if isfield(angles,'Xfrac'),
0065     launch.yXfrac = angles.Xfrac;
0066 end
0067 %
0068 launch.angles = angles;

Community support and wiki are available on Redmine. Last update: 18-Apr-2019.