|
| 1 | +function y_ant = adjust_disp_m(y,m) |
| 2 | + global plasma %cnst |
| 3 | + |
| 4 | + % ----- Adjusted position & wave vector in cylindrical coordinates ----------- |
| 5 | + r=y(1); z=y(2); |
| 6 | + kr=y(3); kz=y(4); % starting wave vector |
| 7 | + rho=sqrt((r-plasma.r0).^2+z.^2); |
| 8 | + theta=atan2(plasma.r0-r,-z)+pi/2; |
| 9 | + |
| 10 | + krho_old=-sqrt(kr^2 + kz^2 -(m/rho)^2); % assume wave starts out going in |
| 11 | + %krho=+sqrt(kr^2 + kz^2 -(m/rho)^2); |
| 12 | + |
| 13 | + % Want to adjust kr and kz so that, for given m, k_phi, the initial |
| 14 | + % condtions are on the dispersion surface. |
| 15 | + % m = function argument = rho*k_theta |
| 16 | + |
| 17 | + %kf = plasma.kant(2); |
| 18 | + |
| 19 | + %y0=[r,z,kr,(kr*sin(theta)+(m/rho))/cos(theta)]; |
| 20 | + |
| 21 | + % kz = (kr*sin(theta)+(m/rho))/cos(theta) |
| 22 | +% f = @(krho) dispersion([r,z,... |
| 23 | +% krho*cos(theta)-(m/rho)*sin(theta),... |
| 24 | +% -(krho*sin(theta)+(m/rho)*cos(theta))],'Dsp'); |
| 25 | +% krho = fzero(f,krho); |
| 26 | + |
| 27 | + f = @(krho) disp_eig([r,z,... |
| 28 | + krho*cos(theta)-(m/rho)*sin(theta),... |
| 29 | + -(krho*sin(theta)+(m/rho)*cos(theta)), reshape(eye(4),1,16)].','Dsp'); |
| 30 | +% f = @(krho) disp_eig([r,z,... |
| 31 | +% krho*cos(theta)-(m/rho)*sin(theta),... |
| 32 | +% -(krho*sin(theta)+(m/rho)*cos(theta)), zeros(1,16)].','Dsp'); |
| 33 | + krho_new = fzero(f,krho_old); |
| 34 | + |
| 35 | + %kz = (kr*sin(theta)+(m/rho))/cos(theta); |
| 36 | + |
| 37 | + y_ant = [r,z,krho_new*cos(theta)-(m/rho)*sin(theta),... |
| 38 | + -(krho_new*sin(theta)+(m/rho)*cos(theta))].'; |
| 39 | + |
| 40 | + % ----- Wave vector and refraction index ------------------------------------- |
| 41 | +% kn=kr.*ener +kf.*enef +kz.*enez; |
| 42 | +% kb=kr.*eber +kf.*ebef +kz.*ebez; |
| 43 | +% kp=kr.*eper +kf.*epef +kz.*epez; |
| 44 | +% T =[ener enef enez;... |
| 45 | +% eber ebef ebez;... |
| 46 | +% eper epef epez]; |
| 47 | +% k_cart = T^(-1) * [kn;kb;kp]; |
| 48 | +end |
| 49 | + |
0 commit comments