Analyze a D-T power plant.

The number density is a function of magnetic field and beta. This only looks at bremsstrahlung and fusion power.

------------------------------------------------------------------------
See also: NumberDensityFromBeta, Bremsstrahlung, FusionPower, Plot2D
------------------------------------------------------------------------
%--------------------------------------------------------------------------
%	Copyright 1997, 2011-2012 Princeton Satellite Systems, Inc.
%   All rights reserved.
%--------------------------------------------------------------------------

% Temperature range in kEV
%-------------------------
tK      = logspace(0,2);

m       = length(tK);

beta    = 0.02; % Tokamak value
b       = 10;

n       = NumberDensityFromBeta( beta, b, tK );

pB      = zeros(1,m);
pF      = zeros(1,m);
for k = 1:m
    pB(k) = Bremsstrahlung( [n(k) n(k)]/2, [1 1], tK(k) );
    pF(k) = FusionPower(n(k)/2, n(k)/2, 'd', 't', tK(k) );
end

% If it doesn't produce power set to zero
%-----------------------------------------
dP = (pF - pB);
k  = find(dP <= 0);
dP(k) = 0;

Plot2D( tK, [pF;pB;dP;n], 'Energy (keV)', {'Fusion' 'Bremsstrahlung' 'Net' 'Number Density'}, 'D-T Power Plant', 'ylog')


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