sixth - Vt=abs(VT); % Terminal voltage magnitude...

This preview shows page 1. Sign up to view the full content.

function xdot=sixth(t,x) f % % Again global parameters global Ra Xdp Xd Xq Td0p H KD KA KSTAB TA TW . .. % Machine parameters T1 T2 Efdmin Efdmax . .. ws Pm Vref EB XE RE XTq XTd D; % Network and load parameters % Name state variables for readability wd=x(1); delta=x(2); Eqp=x(3); Efd=x(4); % Enforce field limiter voltage if (Efd>Efdmax) Efd=Efdmax; elseif (Efd<Efdmin) Efd=Efdmin; end; V2=x(5); Vs=x(6); V % Solve algebraic equations (Ra outside terminals) id=((Eqp-EB*cos(delta))*XTq-RE*EB*sin(delta))/D; % D-axis current i iq=(EB*sin(delta)+RE*id)/XTq; % Q-axis current i IT=(id+j*iq)*(cos(delta-pi/2)+j*sin(delta-pi/2)); % Terminal current referred to inf. bus VT=EB+IT*RE+IT*j*XE; % Terminal voltage referred to inf. bus (Ra outside)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Vt=abs(VT); % Terminal voltage magnitude Pe=real(VT*conj(IT)); % Electrical power output % % Now write differential equations xdot(1)=ws/(2*H)*(Pm-Pe-KD*wd/ws); % Acceleration xdot(2)=wd; % Speed deviation xdot(3)=1/Td0p*(Efd-Eqp-(Xd-Xdp)*id); % Eqp derivative xdot(4)=1/TA*(-Efd+KA*(Vref-Vt+Vs)); % Field voltage derivative xdot(5)=-1/TW*V2+KSTAB/ws*xdot(1); % Washout filter out. derivative xdot(6)=1/T2*(-Vs+V2+T1*xdot(5)); % Output of PSS out. derivative x % Limits on exciter if ((Efd&gt;=Efdmax)&amp;(xdot(4)&gt;0)) xdot(4)=0; elseif ((Efd&lt;=Efdmin)&amp;(xdot(4)&lt;0)) xdot(4)=0; end; e xdot=xdot'; return;...
View Full Document

Ask a homework question - tutors are online