%
% BDFIM design parameters

r=0.1745/2;l=0.1899;g=6.35e-4;
np=2;nc=4;nr=np+nc;Np=80;Nc=80;Nr1=1;Nr2=1;Nr3=1;
thr1=pi*1/36;thr2=pi*3/36;thr3=pi*5/36;
%
% Compute inductance parameters
%
c=4e-7*pi*r*l/g;
Lpw=c*Np^2*pi/4,Mpw=-c*Np^2*pi/8
Lcw=c*Nc^2*pi/4,Mcw=-c*Nc^2*pi/8
Lrw11=2*c*Nr1^2*thr1*(pi-thr1)/pi+Lr1s,Mrw11=-2*c*Nr1^2*thr1^2/pi
Lrw12=2*c*Nr1*Nr2*thr1*(pi-thr2)/pi,Mrw12=-2*c*Nr1*Nr2*thr1*thr2/pi
Lrw13=2*c*Nr1*Nr3*thr1*(pi-thr3)/pi,Mrw13=-2*c*Nr1*Nr3*thr1*thr3/pi
Lrw22=2*c*Nr2^2*thr2*(pi-thr2)/pi+Lr2s,Mrw22=-2*c*Nr2^2*thr2^2/pi
Lrw23=2*c*Nr2*Nr3*thr2*(pi-thr3)/pi,Mrw23=-2*c*Nr2*Nr3*thr2*thr3/pi
Lrw33=2*c*Nr3^2*thr3*(pi-thr3)/pi+Lr3s,Mrw33=-2*c*Nr3^2*thr3^2/pi
Mpr=(c*Np/np)*[Nr1*sin(np*thr1) Nr2*sin(np*thr2) Nr3*sin(np*thr3)]
Mcr=(c*Nc/nc)*[Nr1*sin(nc*thr1) Nr2*sin(nc*thr2) Nr3*sin(nc*thr3)]
%
% Compute complex model parameters
%
Lp=Lpw-Mpw,Lc=Lcw-Mcw
Lrl=[Lrw11-Mrw11 Lrw12-Mrw12 Lrw13-Mrw13; ...
Lrw12-Mrw12 Lrw22-Mrw22 Lrw23-Mrw23; ...
Lrw13-Mrw13 Lrw23-Mrw23 Lrw33-Mrw33]
Mpl=(sqrt(3*nr)/2)*Mpr,Mcl=(sqrt(3*nr)/2)*Mcr