% ECD_4_6_Comparison
% This compares the ECD dipoles 4 and 6.

% Load the ECD6 data
Load_wirevsx(2);
Load_wirevsx(3);

cd ..
cd ECD4

% Load the ECD4 data
Load_wireplt_blvsx_mmcvi(2);
Load_wireplt_blvsx_mmcvi(3);

% plot the data of ECD4 and ECD6 together 

ECD4_X = unique(Wireplt2.X); 
ECD6_X = unique(Wirevsx2.X); 


for i = 1:length(ECD4_X)
figure;
arr4 = find(ECD4(i) == Wireplt2.X);    
plot([Wireplt2.Imag(arr4)],[Wireplt2.SL(arr4)], 'r*')
hold
arr5 = find(ECD6_X(i) == Wirevsx2.X);
plot([Wirevsx2.Imag1(arr5)],[Wirevsx2.SL(arr5)], 'bo')
xlabel('Imag (A)');
ylabel('BL (Tm)');
title(['Integrated Field vs Current at X = ', num2str(ECD4(i)),' (m)']);
legend('ECD4', 'ECD6');

end

for i = 1:6
num_x = length(Wireplt3.X)/6;
figure
plot(Wireplt3.X(num_x*(i-1)+1:i*num_x),Wireplt3.SL(num_x*(i-1)+1:i*num_x), 'r*')
hold
plot(Wirevsx3.X(num_x*(i-1)+1:i*num_x),Wirevsx3.SL(num_x*(i-1)+1:i*num_x), 'bo')
xlabel('X (m)');
ylabel('BL (Tm)');
title(['Integrated Field vs X at Imag = ', num2str(mean(Wireplt3.Imag(num_x*(i-1)+1:i*num_x))),' (A)']);
legend('ECD4', 'ECD6');
end
cd ..
cd ECD5

