HTS magnet array mass with cryo

%--------------------------------------------------------------------------
% See also: PFRCSolenoid, SuperconductorDataStructure, SuperPowerHTS,
% MagnetArrayMass, CryocoolerBrake
%--------------------------------------------------------------------------

%--------------------------------------------------------------------------
% Copyright (c) 2018 Princeton Satellite Systems, Inc.
% All rights reserved.
%--------------------------------------------------------------------------

z0      = [-1.15 -0.75 -0.45 -0.15 0.15 0.45 0.75 1.15];
a0      = EllipsoidalSolenoid( 0.35, 0.5, z0 );
bAxial	= 5;
I0      = PFRCSolenoid( a0, z0, bAxial, [], [], 0.5  );

d = SuperconductorDataStructure;

temp = linspace(5,50,25);
for k = 1:length(temp)
  Iop = 0.6*SuperPowerHTS(bAxial,temp(k));
  [mass(k),mass_k] = MagnetArrayMass( a0(1:4), I0(1:4), Iop, [], d );

  cryo(k) = CryocoolerBrake( 5, temp(k) );
end

Plot2D(temp,[mass;cryo;mass+cryo],'Temperature (K)','Mass')

% the minimum for above is at 12 K
tempK = 12;
IopK = 0.6*SuperPowerHTS(bAxial,tempK);
[~,massK] = MagnetArrayMass( a0(1:4), I0(1:4), IopK, [], d );
cryoK = CryocoolerBrake( 5, tempK );


%--------------------------------------