0001 function [B66, M, rout] = findthinmpoleraddiffm(rin, PolynomA, PolynomB, L, irho, E0, max_order)
0002
0003
0004
0005 persistent TWOPI CGAMMA M0C2 LAMBDABAR CER CU
0006 if isempty(TWOPI)
0007 TWOPI = 2*pi;
0008 CGAMMA = 8.846056192e-05;
0009 M0C2 = 5.10999060e5;
0010 LAMBDABAR = 3.86159323e-13;
0011 CER = 2.81794092e-15;
0012 CU = 1.323094366892892;
0013 end
0014
0015
0016
0017 P1 = i*PolynomA(1:max_order+1)+PolynomB(1:max_order+1);
0018 Z1 = cumprod([1, (rin(1)+i*rin(3))*ones(1,max_order)]);
0019 S1 = sum(P1.*Z1);
0020 Bx = real(S1);
0021 By = imag(S1);
0022
0023 B2P = B2perp([Bx; By+irho; 0], irho, rin);
0024 B3P = B2P^(3/2);
0025 p_norm = 1/(1+rin(5));
0026 p_norm2 = p_norm^2;
0027
0028 CRAD = CGAMMA*E0^3/(TWOPI*1e27);
0029 BB = CU * CER * LAMBDABAR * (E0/M0C2)^5 * L * B3P * (1+rin(5))^4*...
0030 (1+rin(1)*irho + (rin(2)^2+rin(4)^2)*p_norm2/2);
0031
0032
0033 rout = rin;
0034
0035
0036 rout(5) = rin(5) - CRAD*(1+rin(5))^2*B2P*...
0037 (1+rin(1)*irho + (rin(1)^2+rin(3)^2)*p_norm2/2)*L;
0038
0039
0040
0041
0042
0043
0044 rout([2 4]) = rin([2 4])*(1+rout(5))/(1+rin(5));
0045
0046
0047 rout(2) = rout(2) - L*(Bx-(rin(5)-rin(1)*irho)*irho);
0048 rout(4) = rout(4) + L*By;
0049
0050
0051 rout(6) = rout(6) + L*irho*rin(1);
0052
0053
0054
0055 P2 = i*PolynomA(2:max_order+1)+PolynomB(2:max_order+1);
0056 Z2 = cumprod([1, (rin(1)+i*rin(3))*ones(1,max_order-1)]);
0057 S2 = sum(P2.*(1:max_order).*Z2);
0058
0059 M = eye(6);
0060 M(2,1) = -L*real(S2);
0061 M(2,3) = L*imag(S2);
0062 M(4,1) = L*imag(S2);
0063 M(4,3) = L*real(S2);
0064 M(2,5) = L*irho;
0065 M(2,1) = M(2,1) - L*irho*irho;
0066 M(6,1) = L*irho;
0067
0068
0069
0070
0071
0072
0073
0074 B66 = zeros(6);
0075 B66(2,2) = BB*rin(2)^2*p_norm2;
0076 B66(2,4) = BB*rin(2)*rin(4)*p_norm2;
0077 B66(4,2) = B66(2,4);
0078 B66(4,4) = BB*rin(4)^2*p_norm2;
0079 B66(5,2) = BB*rin(2)*p_norm;
0080 B66(2,5) = B66(5,2);
0081 B66(5,4) = BB*rin(4)*p_norm;
0082 B66(4,5) = B66(5,4);
0083 B66(5,5) = BB;
0084
0085 function b2 = B2perp(B, irho, rin)
0086
0087
0088
0089
0090
0091
0092 E = [rin(2)/(1+rin(5));rin(4)/(1+rin(5));1+rin(1)*irho];
0093 b2 = sum(cross(E/norm(E),B).^2);
0094