Commit bd532885 authored by Lore, Jeremy's avatar Lore, Jeremy
Browse files

cleanup

parent 5955f958
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -39,7 +39,9 @@ end


% figure; hold on; box on;
if isfield(g,'lim')
    plot(g.lim(1,g.lim(1,:)>0),g.lim(2,g.lim(1,:)>0),con_linesty,'linewidth',2)
end
contour(g.r,g.z,psiN_g.',linspace(psi_min,psi_max,npsi),'-','linewidth',1);
contour(g.r,g.z,psiN_g.',[1,1],'k-','linewidth',2);
hc = colorbar;
@@ -48,8 +50,11 @@ colormap(colorflipper(512,'jet'));
axis equal; axis tight;
% axis([1,2.4,-1.5,1.5])
ax = axis;
if isfield(g,'gfilename')
    h=text(ax(1)+(ax(2)-ax(1))*0.48,ax(3)+(ax(4)-ax(3))*0.97,g.gfilename,'fontsize',8);
    set(h,'interpreter','none');
end



% Find the xpt(s)
+19 −11
Original line number Diff line number Diff line
@@ -5,26 +5,34 @@ gfile_name = 'C:/Work/DIII-D/148712/g148712.04101';

g = readg_g3d(gfile_name);

N = 10000000;
N = 1000000;
a = 1; b = 2.4;
R = sort(a + (b-a).*rand(N,1));

a = -1.2; b = 1.2;
Z = a + (b-a).*rand(N,1);

f = @() bfield_geq_bicub_inv(g,R,Z);

% profile on;
tic; 
Binv = bfield_geq_bicub_inv(g,R,Z);
toc
% profile report
timeit(f)

tic;
% profile on;
Borig = bfield_geq_bicub(g,R,Z);
% profile report
toc
f = @() bfield_geq_bicub(g,R,Z);

timeit(f)


% % profile on;
% tic; 
% Binv = bfield_geq_bicub_inv(g,R,Z);
% toc
% % profile report
% 
% tic;
% % profile on;
% Borig = bfield_geq_bicub(g,R,Z);
% % profile report
% toc
% % 
% figure; hold on; 
% plot(R,Borig.br)
% plot(R,Binv.br,'--')
+0 −2
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@ function coil = build_circular_coil_jackson(r1,r2,z1,dz,nturns,nlayers)

fw = dz/nturns;
fh = (r2-r1)/nlayers;
% zwind = repmat(z1+fw/2:fw:z1+dz-fw/2+eps,1,nlayers);
% rwind = repmat(r1+fh/2:fh:r2-fh/2,1,nturns);

zwind = repmat(linspace(z1+fw/2,z1+dz-fw/2,nturns),1,nlayers);
rwind = repmat(linspace(r1+fh/2,r2-fh/2,nlayers),1,nturns);