mg_interp_jd

PURPOSE ^

SYNOPSIS ^

function [xyBb_rf,xyBPb_rf,xyrb_rf,xycosb_rf,xyxb_rf,xyyb_rf,xyBxb_rf,xyByb_rf,xyBphib_rf] = mg_interp_jd(theta,Xx,Xy,XBx,XBy,XBphi,xythetab_rf,method);

DESCRIPTION ^

 This function interpolates the magnetic geometry data to given
 poloidal positions

 by Joan Decker (jodecker@mit.edu) and Yves Peysson (yves.peysson@cea.fr)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [xyBb_rf,xyBPb_rf,xyrb_rf,xycosb_rf,xyxb_rf,xyyb_rf,xyBxb_rf,xyByb_rf,xyBphib_rf] = mg_interp_jd(theta,Xx,Xy,XBx,XBy,XBphi,xythetab_rf,method);
0002 %
0003 % This function interpolates the magnetic geometry data to given
0004 % poloidal positions
0005 %
0006 % by Joan Decker (jodecker@mit.edu) and Yves Peysson (yves.peysson@cea.fr)
0007 %
0008 if nargin < 8
0009     method = 'linear';
0010 end
0011 nr = size(Xx,1);
0012 if size(xythetab_rf,1) == 1,
0013     xythetab_rf = repmat(xythetab_rf,[nr,1]);
0014 end
0015 for ir = 1:nr
0016     xyxb_rf(ir,:) = interp1(theta,Xx(ir,:),xythetab_rf(ir,:),method);
0017     xyyb_rf(ir,:) = interp1(theta,Xy(ir,:),xythetab_rf(ir,:),method);
0018 %
0019     xyBxb_rf(ir,:) = interp1(theta,XBx(ir,:),xythetab_rf(ir,:),method);
0020     xyByb_rf(ir,:) = interp1(theta,XBy(ir,:),xythetab_rf(ir,:),method);
0021     xyBphib_rf(ir,:) = interp1(theta,XBphi(ir,:),xythetab_rf(ir,:),method);
0022 end
0023 xyrb_rf = sqrt(xyxb_rf.^2 + xyyb_rf.^2);% minor radius at theta = thetab_rf
0024 xyBPb_rf = sqrt(xyBxb_rf.^2 + xyByb_rf.^2);% poloidal magnetic field at theta = thetab_rf
0025 xyBb_rf = sqrt(xyBPb_rf.^2 + xyBphib_rf.^2);% magnetic field at theta = thetab_rf
0026 xycosb_rf = abs(xyBxb_rf.*xyyb_rf - xyByb_rf.*xyxb_rf)./xyrb_rf./xyBPb_rf;

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