%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % cumgen.m - plots terminal characteristic for cumulative % compound dc generator. Armature reaction neglected. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear; clf; VtR=600; % Rated terminal voltage PR=60e03; % Rated output power Ra=0.25; % Armature resistance Rs=0.03; % Series field resistance Nf=650; % Shunt field turns/pole Ns=1; % Series field turns/pole ILR=PR/VtR; % Rated output current load eif % Load stored OCC m=length(eif); npts=200; E=eif(1:m,1); If=eif(1:m,2); % Iterative determination of rated If IfR=0; for i=1:50; IfR=interp1( E, If, VtR+(ILR+IfR)*(Ra+Rs))-Ns/Nf*(ILR-IfR); end Rfeq=VtR/IfR; % Total shunt field circuit resistance IL=linspace(0,1.5*ILR,npts); % Iterative determination of Vt-IL for i=1:npts If1=IfR; for j=1:100 Vt1=interp1(If, E, If1+Ns/Nf*(IL(i)-If1))- ... (IL(i)+If1)*(Ra+Rs); If2=Vt1/Rfeq; if abs(If2-If1)<= 0.001; Vt(i)=Vt1; break; end; If1=If2; end end plot(0,0,IL,Vt,ILR,VtR,'o'); grid; title('Cumulative compound dc generator'); xlabel('Load current, A'); ylabel('Terminal voltage, V');