420 Appendix C: Pascal Statements for the Simulation
q2: = h*f2(VQ,Rs,reg1.diQ+(q1/2),reg2.dVcQ+(t1/2),Vqr,w,M,reg1.
diD+(k1/2),Rr,reg1.diqr+(p1/2),Lr,reg1.didr+(r1/2),A1,A2);
p2: = h*f3(VQ,Rs,reg1.diQ+(q1/2),reg2.dVcQ+(t1/2),Vqr,w,M,reg1.
diD+(k1/2),Rr,reg1.diqr+(p1/2),Lr,reg1.didr+(r1/2),A2,A3);
r2: = h*f4(VD,Rs,reg1.diD+(k1/2),reg2.dVcD+(s1/2),Vdr,w,M,reg1.
diQ+(q1/2),Lr,reg1.diqr+(p1/2),Rr,reg1.didr+(r1/2),A2,A3);
s2: = h*f5(reg1.diD+(k1/2),reg1.dilD+(u1/2),C);
t2: = h*f6(reg1.diQ+(q1/2),reg1.dilQ+(z1/2),C);
u2: = h*f7(reg2.dVcD+(s1/2),R,reg1.dilD+(u1/2),L);
z2: = h*f8(reg2.dVcQ+(t1/2),R,reg1.dilQ+(z1/2),L);
k3: = h*f1(VD,Rs,reg1.diD+(k2/2),reg2.dVcD+(s2/2),Vdr,w,M,reg1.
diQ+(q2/2),Lr,reg1.diqr+(p2/2),Rr,reg1.didr+(r2/2),A1,A2);
q3: = h*f2(VQ,Rs,reg1.diQ+(q2/2),reg2.dVcQ+(t2/2),Vqr,w,M,reg1.
diD+(k2/2),Rr,reg1.diqr+(p2/2),Lr,reg1.didr+(r2/2),A1,A2);
p3: = h*f3(VQ,Rs,reg1.diQ+(q2/2),reg2.dVcQ+(t2/2),Vqr,w,M,reg1.
diD+(k2/2),Rr,reg1.diqr+(p2/2),Lr,reg1.didr+(r2/2),A2,A3);
r3: = h*f4(VD,Rs,reg1.diD+(k2/2),reg2.dVcD+(s2/2),Vdr,w,M,reg1.
diQ+(q2/2),Lr,reg1.diqr+(p2/2),Rr,reg1.didr+(r2/2),A2,A3);
s3: = h*f5(reg1.diD+(k2/2),reg1.dilD+(u2/2),C);
t3: = h*f6(reg1.diQ+(q2/2),reg1.dilQ+(z2/2),C);
u3: = h*f7(reg2.dVcD+(s2/2),R,reg1.dilD+(u2/2),L);
z3: = h*f8(reg2.dVcQ+(t2/2),R,reg1.dilQ+(z2/2),L);
k4: = h*f1(VD,Rs,reg1.diD+k3,reg2.dVcD+s3,Vdr,w,M,reg1.diQ+q3,Lr,
reg1.diqr+p3,Rr,reg1.didr+r3,A1,A2);
q4: = h*f2(VQ,Rs,reg1.diQ+q3,reg2.dVcQ+t3,Vqr,w,M,reg1.diD+k3,Rr,
reg1.diqr+p3,Lr,reg1.didr+r3,A1,A2);
p4: = h*f3(VQ,Rs,reg1.diQ+q3,reg2.dVcQ+t3,Vqr,w,M,reg1.diD+k3,Rr,
reg1.diqr+p3,Lr,reg1.didr+r3,A2,A3);
r4: = h*f4(VD,Rs,reg1.diD+k3,reg2.dVcD+s3,Vdr,w,M,reg1.diQ+q3,Lr,
reg1.diqr+p3,Rr,reg1.didr+r3,A2,A3);
s4: = h*f5(reg1.diD+k3,reg1.dilD+u3,C);
t4: = h*f6(reg1.diQ+q3,reg1.dilQ+z3,C);
u4: = h*f7(reg2.dVcD+s3,R,reg1.dilD+u3,L);
z4: = h*f8(reg2.dVcQ+t3,R,reg1.dilQ+z3,L);
reg1.diD: = reg1.diD+((k1+2*k2+2*k3+k4)/6) ;
reg1.diQ: = reg1.diQ+((q1+2*q2+2*q3+q4)/6) ;
reg1.diqr: = reg1.diqr+((p1+2*p2+2*p3+p4)/6) ;
reg1.didr: = reg1.didr+((r1+2*r2+2*r3+r4)/6) ;
reg2.dVcD: = reg2.dVcD+((s1+2*s2+2*s3+s4)/6) ;
reg2.dVcQ: = reg2.dVcQ+((t1+2*t2+2*t3+t4)/6) ;
reg1.dIlD: = reg1.dIlD+((u1+2*u2+2*u3+u4)/6) ;
reg1.dIlQ: = reg1.dIlQ+((z1+2*z2+2*z3+z4)/6) ;
t: = t+h ;
dif: = 1 ;
if t>15 then
begin
R: = 10;
421Appendix C: Pascal Statements for the Simulation
L: = 0.009;
end;
end;
close(arq1);
clrscr ;
step : = t0 ;
writeln ;
gotoxy(25,2) ;
writeln(‘ => RESULTS <=’) ;
writeln ;
writeln(‘INTERVAL : ’,h) ;
line : = 0 ;
for k : = 0 to (1000) do
begin
gotoxy(5,7+line) ;
writeln(‘INTERVAL : ‘,step) ;
gotoxy(40,7+line) ;
writeln(‘dVcD: ‘,reg2.dVcD) ;
step : = step+h ;
line : = line+1 ;
if line = 14 then
begin
gotoxy(5,23) ;
write(‘Press <ENTER> to continue…’) ;
a : = readkey ;
clrscr ;
line : = 0 ;
end ;
end ;
END.
Get Modeling and Analysis with Induction Generators, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.