% M2A1_D 
% Using MATLAB, plot the inductance of the magnetic circuit 
% of the magnetic core shown as a function of core permeability
% over the range 100\leq\mu_{r}\leq100,000. 

% Core properties
lc=30; %cm
lg=0.05; %cm
Ac=9; %cm^2
Ag=Ac;
N=500;

%%% calculations
mur = 100:100000;
u0=pi*10^(-7);

% reluctance
cm2m=100; %100^2 cm/cm^2
Rc=cm2m*lc./(u0*mur*Ac);
Rg=cm2m*lg./(u0*Ag);

% inductance
L=N^2./(Rc+Rg);

%%% plots
figure(2)
loglog(mur,Rc+Rg)
title("Reluctance")
xlabel("Core Permeability \mu_r")

figure(1)
loglog(mur,L)
title("Inductance")
ylabel("Inductance [H]")
xlabel("Core Permeability \mu_r")

