Loading matlab/bfield_library_jdl/EFIT_routines/calc_Bangle_g.m +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ function P = calc_Bangle_g(g,RZ1,RZ2,npts) if length(RZ1) ~= 2 || length(RZ2) ~= 2 error('Only single point pairs are allowed') end if nargin < 3 if nargin < 4 npts = 3; end if npts < 1 Loading matlab/bfield_library_jdl/EFIT_routines/calc_psi.m +1 −1 Original line number Diff line number Diff line function [psi,ierr,dpsidr,dpsidz] = calc_psi(g,R,Z,nowarn) % psi = -sign(Ip)*psirz if nargin < 4 nowarn = 0; end Loading matlab/bfield_library_jdl/EFIT_routines/calc_psiN.m +4 −2 Original line number Diff line number Diff line Loading @@ -6,5 +6,7 @@ function [psiN,psi,ierr] = calc_psiN(g,R,Z,quiet) if nargin < 4 quiet = 0; end [psi,ierr]= calc_psi(g,R,Z,quiet); % this applies g.ip_sign psiN = (g.ip_sign*psi-g.ssimag)/(g.ssibry-g.ssimag); % so have to apply it again because ssi quantities will be flipped (if ip_sign = -1) No newline at end of file % this applies g.ip_sign [psi,ierr]= calc_psi(g,R,Z,quiet); % so have to apply it again because ssi quantities will be flipped (if ip_sign = -1) psiN = (g.ip_sign*psi-g.ssimag)/(g.ssibry-g.ssimag); No newline at end of file matlab/bfield_library_jdl/fieldline_following/dl/fl_derivs_dl_gfile.m +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ end Btot = sqrt(Bout.br.^2 + Bout.bz.^2 + Bout.bphi.^2); df(1:3:N-2) = Bout.br./Btot; % dR/dl df(2:3:N-1) = Bout.bphi./(RPZ(1:3:N-2).'.*Btot); % dphi/dl df(2:3:N-1) = Bout.bphi./(RPZ(1:3:N-2).*Btot); % dphi/dl df(3:3:N) = Bout.bz./Btot; % dZ/dl ierr = 0; Loading matlab/bfield_library_jdl/fieldline_following/follow_fieldlines_rzphi_dl.m +2 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,8 @@ s.phi = yout(:,2:Neq:Nsys*Neq-1); s.z = yout(:,3:Neq:Nsys*Neq); s.l = xout; ierr = ierr_rk45; s.ierr = ierr_rk45; s.i_last_good = i_last_good; Loading Loading
matlab/bfield_library_jdl/EFIT_routines/calc_Bangle_g.m +1 −1 Original line number Diff line number Diff line Loading @@ -17,7 +17,7 @@ function P = calc_Bangle_g(g,RZ1,RZ2,npts) if length(RZ1) ~= 2 || length(RZ2) ~= 2 error('Only single point pairs are allowed') end if nargin < 3 if nargin < 4 npts = 3; end if npts < 1 Loading
matlab/bfield_library_jdl/EFIT_routines/calc_psi.m +1 −1 Original line number Diff line number Diff line function [psi,ierr,dpsidr,dpsidz] = calc_psi(g,R,Z,nowarn) % psi = -sign(Ip)*psirz if nargin < 4 nowarn = 0; end Loading
matlab/bfield_library_jdl/EFIT_routines/calc_psiN.m +4 −2 Original line number Diff line number Diff line Loading @@ -6,5 +6,7 @@ function [psiN,psi,ierr] = calc_psiN(g,R,Z,quiet) if nargin < 4 quiet = 0; end [psi,ierr]= calc_psi(g,R,Z,quiet); % this applies g.ip_sign psiN = (g.ip_sign*psi-g.ssimag)/(g.ssibry-g.ssimag); % so have to apply it again because ssi quantities will be flipped (if ip_sign = -1) No newline at end of file % this applies g.ip_sign [psi,ierr]= calc_psi(g,R,Z,quiet); % so have to apply it again because ssi quantities will be flipped (if ip_sign = -1) psiN = (g.ip_sign*psi-g.ssimag)/(g.ssibry-g.ssimag); No newline at end of file
matlab/bfield_library_jdl/fieldline_following/dl/fl_derivs_dl_gfile.m +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ end Btot = sqrt(Bout.br.^2 + Bout.bz.^2 + Bout.bphi.^2); df(1:3:N-2) = Bout.br./Btot; % dR/dl df(2:3:N-1) = Bout.bphi./(RPZ(1:3:N-2).'.*Btot); % dphi/dl df(2:3:N-1) = Bout.bphi./(RPZ(1:3:N-2).*Btot); % dphi/dl df(3:3:N) = Bout.bz./Btot; % dZ/dl ierr = 0; Loading
matlab/bfield_library_jdl/fieldline_following/follow_fieldlines_rzphi_dl.m +2 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,8 @@ s.phi = yout(:,2:Neq:Nsys*Neq-1); s.z = yout(:,3:Neq:Nsys*Neq); s.l = xout; ierr = ierr_rk45; s.ierr = ierr_rk45; s.i_last_good = i_last_good; Loading