%**************************************************************************
%This function plots the Fourier series coefficients of Bx.
%
%Input:
%plt_file, plot file for results
%a0, constant term (T)
%an, cosine terms (T)
%bn, sine terms (T)
%
%Zachary Wolf, 8/19/10

function [] = field_plot_har_bx(plt_file, a0, an, bn)
  
%Check
if abs(a0) == 0 || max(abs(an)) == 0 || max(abs(bn)) == 0
    return;
end

%Initialize
figure;

%Plot the field harmonics
nn = 0 : length(an);
ann = [a0, an];
%stem(nn, ann, 'linewidth', 0.5, 'markerfacecolor', 'red', 'marker', 'o', 'markersize', '4');
semilogy(nn, abs(ann), 'r*', 'linewidth', 0.5);
hold on;
nn = 1 : length(an);
%stem(nn, bn, 'linewidth', 0.5, 'markerfacecolor', 'blue', 'marker', 's', 'markersize', '4');
semilogy(nn, abs(bn), 'b*', 'linewidth', 0.5);

%Labels
legend('|An|', '|Bn|');
title('Bx Field Harmonics');
xlabel('n');
ylabel('Absolute Value Of An, Bn (T)');

%Finalize
grid on;
zoom on;
hold off;

%Print
util_print_fig(plt_file);

%Done
