file = 'Copper_Wire_Data.xlsx';
MAX_CURRENT = 30;
VOLTAGE = 6;
M = xlsread(file);
p = 1.68e-8; % resistivity of copper
u = 1.26e10-4;
core_d = M(:,3)' * 1e-3; % diameter of copper core
wire_d = M(:,4)' * 1e-3 ; % diameter of whole wire
turns = floor(14e-3 ./ wire_d);
layers = floor(13.5e-3 ./ wire_d);
windings = floor(turns .* layers);
len = zeros(1,length(M(:,1)));
for i = (1:length(M(:,1)))
for j = (1:layers(i))
len(i) = len(i) + (pi*(25.5+(2*wire_d(i)*(j-1))));
end
end
len = len .* turns;
area = pi * ((core_d./2).^2);
res = p * (len./area);
current = VOLTAGE ./ res;
for i = (1:length(current))
if(current(i)>MAX_CURRENT)
current(i) = 30;
end
end
mag = zeros(1,length(M(:,1)));
for i = (1:length(M(:,1)))
mag(i) = u*(windings(i)/(14e-3))*current(i);
end
plot(M(:,1),mag);
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.