Commit 7224de17 authored by Lore, Jeremy's avatar Lore, Jeremy
Browse files

Propagate recent updates through

parent 3dccbed2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+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
+4 −2
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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;

+2 −1
Original line number Diff line number Diff line
@@ -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