Page 274 - Solutions Manual to accompany Electric Machinery Fundamentals
P. 274

legend ('Ea     line','Vt line',4);
                 hold off;
                 grid on;
                 (d)  A  MATLAB program to calculate and plot the terminal characteristic of this generator is shown
                 be low.

                 % M-file: prob8_27d.m
                 % M-file to calculate the terminal characteristic of a
                 %   cumulatively      compounded dc generator without armature
                 %    reaction.

                 % Get the magnetization curve.  This file contains                 the
                 % three var    iables if_values, ea_values, and n_0.
                 clear all
                 load p87_mag.dat;
                 if_values = p87_mag(:,1);
                 ea_values = p    87_mag(:,2);
                 n_ 0 = 1800;

                 % First, initialize the values needed in this progr                 am.
                 r_f = 20;               % Field resistance (ohms)
                 r_adj = 10;             % Adjustable resistance (ohms)
                 r_a = 0.21;             % Armature + series r               esistance (ohms)
                 i_f = 0:0.02:6;         % Field current (A)
                 n = 1800;               % Generator speed (r/               min)
                 n_f = 1000;             % Shunt field turns
                 n_ se = 25;              % Series field turns

                 % Calculate Ea versus If
                 Ea  = interp1(if_values,ea_values,i_f);

                 % Calculate Vt versus If
                 Vt  = (r_f + r_adj) * i_f;

                 % Find the point where the difference between the two
                 % lines is exactly equal to i_a*r_a.  This will be the
                 % point where     the line line "Ea - Vt - i_a*r_a" goes
                 % negative.
                 i_a = 0:1:55;
                 fo r jj = 1:length(i_a)

                    % Calculate the Ea v        alues modified by mmf due to the
                    % armature current
                     Ea_a = interp1(if_values,ea_values,i_f + i_a(jj)*n_se/n_f);

                    % Get the voltage difference
                     diff = Ea_a - Vt - i_a(jj)*r_a;

                    % This code prevents us from reporting              the first (unstable)
                    % location sat      isfying the criterion.
                    was_pos = 0;
                    for ii = 1:length(i_        f);
                       if diff(ii) > 0
                          wa    s_pos = 1;
                       end

                                                           268
   269   270   271   272   273   274   275   276   277   278   279