Name: Title:

 Name:
ONLINE COMPILERS
LIBRARY
MANUAL PAGES & DOCS
CONTACT

User Submitted Source Code!

Description:
selva
Language: PASCAL
Code:
UNITxformer;

INTERFACE
uses crt,globvar,errmes,ccore,cwire,mvar;

Procedure For_xformer_design;
Procedure Half_xformer_design;
Procedure Full_xformer_design;
Procedure Push_xformer_design;
Procedure Fly_xformer_design;
Procedure mturns_gauge;

IMPLEMENTATION

PROCEDURE MTURNS_GAUGE;
var
awirem,aww:real;
sww:integer;
Begin
for i:=1 num do
begin
multi_variable;
Ntm[i]:=round(nm*N1);
case configuration of
1,2,3,4: begin
awire:=(Iom[i]*sqrt(Dmm))/J;
If awire 3.243 then
begin
error_message(4,errstrg);
halt;
end;

choose_wire(aww,sww);
awm[i]:=aww;
swgm[i]:=sww;
end;

5.begin
awire:=((2*Iom[i])/sqrt((1-Dmm)*3))/J;
If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;

choose_wire(aww,sww);
awm[i]:=aww;
swgm[i]:sww;
end;
end;{case configuration of}
end;{of for}
awtemp:=0;
for i:=1 to num do
awtemp:=awtemp+awm[i]*Ntm[i];
End;

PROCEDURE FOR_XFORMER_DESIGN:

var
ac,aw,aw1a,aw2a,aw3a:real;

Begin
errstrg:="transformer";
record_no:=0;
Pos:=((1.1*VO+Vd)*Io)+Pom;
If direction=1 then
begin
Use_core (ac,aw,ferrite);
end
else
begin
ap:=((Sqrt(Dmm)*Pos*(1+1/eff)))/(Kw*J*p(10,6)*Bm*fs))*p(10,12);
cal_ap:=ap;
choose_core(ac,aw,ferrite);
end;
direction:=2;

N1:=round((Vcmm*Dmin)/Bm*ac*p(10,-6)*fs));
N3:=N1;
N2:=round(n*N1);
awire:=(Io*Sqrt (Dmm))/J;
If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw2a,sw2);
awire:=(n*Io*Sqrt(Dmm))/J;
for i:=1 to num do
begin
multi_variables;
awire:=awire+(nm*Iom[i]*sqrt(Dmm))/J;
end;

If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw1a,sw1);

awire:=(0.1*n*Io*Sqrt(Dmm))/J;
If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw3a,sw3);

mturns_gauge;

direction:=2;
while (aw(aw1a*N1+aw2a*N2+aw3a*N3+awtemp)*2)do
begin
inc(record_no);
Get_core(ac,aw,ferrite);
N1:=round((Vcmm*Dmm)/(Bm*ac*p(10,-6)*fs));
N3:=N1;
N2:=round(n*N1);
mturns_gauge;
end;{of while}

rp:=(1.72*p(10,-5)*1e*N1)/aw1a;
rs:=(1.72*p(10,-5)*1e*N2)/aw2a;
Lp:=a1*N1*N1*p(10,-9);
Imag:=(Dmm*Vcmin)/(fs*Lp);
End;

PROCEDURE HALF_XFORMER_DESIGN;

var
ac,aw,aw1a,aw2a,aw3a:real
Begin
errstrg:="transformer";
record_no:=0;
Pos:=((1.1*Vo+Vd)*Io)+Pom;

if direction=1 then
begin
Use_core (ac,aw,ferrite);
end
else
begin
ap:=((Pos*(Sqrt(2)+(1/eff)))/(4*Kw*J*p(10,6)*Bm*fs))*p(10,12);
cal_ap:=ap;
choose_core(ac,aw,ferrite);
end;
direction:=2;
N1:=round((Vcmm)/8Bm*ac*p(10,-6)*fs));
N2:=round(n*N1);
awire:=(Io*Sqrt(Dmm))/J;
If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw2a,sw2);

awire:=(n*Io)/J;
for i:=1 to num do
begin
multi_variables;
awire:=awire+(nm*Iom[i]/J;
end;

If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw1a,sw1);
direction:=2;

mturns_gauge;

while(aw(aw1a*N1+2*aw2a*N2+2*awtemp)*2)do
begin
inc(record_no);
Get_core(ac,aw,ferrite);
N1:=round((Vcmm)/(8*Bm*ac*p(10,-6)*fs));
N2:=round(n*N1);
mturns_gauge;
end;{of while}

rb:=(1.72*p(10,-5)*1e*N1)/aw1a;
rs:=(1.72*p(10,-5)*1e*N2)/aw2a;
Lp:=a1*N1*N1*p(10,-9);
Imag:=(Dmm*Vcmin)/(2*fs*Lp);
End;

PROCEDURE FULL_XFORMER_DESIGN:

var
ac,aw,aw1a,aw2a,aw3a:real;

Begin
errstrg:="transformer";
record_no:=0;
Pos:=((1.1*Vo+Vd)*Io)+Pom;
If direction=1 then
begin
Use_core (ac,aw,ferrite);
end
else
begin
ap:=((Pos*(sqrt(2)+(1/eff)))/4*Kw*J*p(10,6)*Bm*fs))*p(10,12);
cal_ap:=ap;
choose_core(ac,aw,ferrite);
end;
direction:=2;

N1:=round((Vcmm)/(4*Bm*ac*p(10,-6)*fs));
N2:=round(n*N1);
awire:=(Io*Sqrt (Dmm))/J;
If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw2a,sw2);

awire:=(n*Io)/J;
for i:=1 to num do
begin
multi_variables;
awire:=awire+nm*Iom[i]/J;
end;

If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw1a,sw1);

mturns_gauge;

direction:=2;
while (aw(aw1a*N1+2*aw2a*N2+2*awtemp)*2)do
begin
inc(record_no);
Get_core(ac,aw,ferrite);
N1:=round((Vcmm)/(4*Bm*ac*p(10,-6)*fs));
N2:=round(n*N1);
mturns_gauge;
end;{of while}
rb:=(1.72*p(10,-5)*1e*N1)/aw1a;
rs:=(1.72*p(10,-5)*1e*N2)/aw2a;
Lp:=a1*N1*N1*p(10,-9);
Imag:=(Dmm*Vcmin)/(2*fs*Lp);
end;

PROCEDURE PUSH_XFORMER_DESIGN:

var
ac,aw,aw1a,aw2a,aw3a:real;

Begin
errstrg:="transformer";
record_no:=0;
Pos:=((1.1*Vo+Vd)*Io)+Pom;

If direction=1 then
begin
Use_core(ac,aw,ferrite);
end
else
begin
ap:=((sqrt(2)*Pos*(1+(1/eff)))/(4*Kw*J*p(10,6)*Bm*fs))*p(10,12);
cal_ap:=ap;
choose_core(ac,aw,ferrite);
end;
direction:=2;

N1:=round((Vcmm)/(4*Bm*ac*p(10,-6)*fs));
N2:=round(n*N1);
awire:=(Io*Sqrt(Dmm))/J;
If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw2a,sw2);
awire:=(n*Io*sqrt(Dmm))/J;
for i:=1 to num do
begin
multi_variables;
awire:=awire+nm*Iom[i]*sqrt(Dmm))/J;
end;

If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw1a,sw1);

mturns_gauge;

direction:=2;
while (aw(2*aw1a*N1+2*aw2a*N2+2*awtemp)*2)do
begin
inc(record_no);
Get_core(ac,aw,ferrite);
N1:=round((Vcmm)/(4*Bm*ac*p(10,-6)*fs));
N2:=round(n*N1);
mturns_gauge;
end;{of while}

rb:=(1.72*p(10,-5)*1e*N1)/aw1a;
rs:=(1.72*p(10,-5)*1e*N2)/aw2a;
Lp:=a1*N1*N1*p(10,-9);
Imag:=(Dmm*Vcmin)/(2*fs*Lp);
End;

PROCEDURE FLY_XFORMER_DESIGN:

var
ac,aw,aw1a,aw2a,aw3a:real;
DI1,DI2,DIn,DBn,DB,I1p,alpha:real;
Begin
errstrg:="transformer";
record_no:=0;

clrscr;
write1n;
write1n("Enter your choice");
write1n;
write1n("1:Incomplete energy transfer mode(CCM)");
write1n("2:Complete energy transfer mode(DCM)");
write1n;
write("Enter choice=");

case choice of

1: begin
clrscr;
write("Enter degree of energy transfer=");
write("Enter normalized flux density=");
end;

2: begin
DIn:=1;
DBn:=1;
end

end;{of case};

I1p:=(2*n*Io)/(2-DIn);
DI1:=IIp*DIn;
DI2:=DI1/n;
DB:=DBn*Bm;
alpha:=1.((1-Din)/sqr(2-DIn)+Pom;

Pos:=((Vo+Vd)*Io*(1-Dimin)/Dimin)+Pom;
If direction=1 then
begin
Use_core(ac,aw,ferrite);
end
else
begin
ap:=((Pos*(sqrt(4*alpha*(1-Dmm)/3)+(sqrt(4*Dmm*alpha/3))/eff))/
(Kw*J*p(10,6)*DB*fs))*p(10,12);
cal_ap:=ap;
choose_core(ac,aw,ferrite);
end;
direction:=2;

N1:=round((Vcmm*Dmin)/(DB*ac*p(10,-6)*fs));
N2:=round(n*N1);
awire:=(sqrt(((1-Dmm)/3)*(DI2*DI2+0.75*(sqr((2*Io)/(1-Dmm))
-DI2*DI2)))/J;
If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;
choose_wire(aw2a,sw2);

awire:=(sqrt(((1-Dmm)/3)*(DI1*DI1+0.75*(sqr((2*Io*n)/(1-Dmm))-
DI1*DI1))))/J;

If awire3.243 then
begin
error_message(4,errstrg);
halt;
end;

choose_wire(aw1a,sw1);

mturns_gauge;

direction:=2;
while(aw(aw1a*N1+aw2a*N2+awtemp)*2)do
begin
inc(record_no);
Get_core(ac,aw,ferrite);
N1:=round((Vcmm*Dmin)/(DB*ac*p(10-6)*fs));
N2:=round(n*N1);
mturns_gauge;
end;{of while}

rb:=(1.72*p(10,-5)*1e*N1)/aw1a;
rs:=(1.72*p(10,-5)*1e*N2)/aw2a;
Lp:=(Vcmin*Dmm)/(DI1*fs);
Ifg:=(4*pi*p(10-7)*N1*N1*ac*p(10-6)/Lp)*p(10,3);
Imag:=(Dmax*Vcmin)/(fs*Lp);
End;

END.