Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Newton Raphson - Problem 1
- close;
- clear;
- clc;
- P2 = 1.8 % P p.u.
- Q2 = 0.6 % Q p.u.
- Z= i*0.1; % impedance
- Y = [1/Z , -1/Z ;
- -1/Z , 1/Z]; % admittance matrix (2x2)
- Gik = real(Y); % takes real component of Y matrix (ie Gik) into 2x2 matrix
- Bik = imag(Y); % take imaginary cmponents of Y matrix (ie Bik) into 2x2 matrix
- x = [0;1]; % initial conditions
- for n = 1:50 % n = # iterations
- f = [Bik(2,1)*x(2)*sin(x(1)) + P2;
- -Bik(2,1)*x(2)*cos(x(1)) - Bik(2,2)*x(2)^2 + Q2];
- J = [Bik(2,1)*x(2)*cos(x(1)) , Bik(2,1)*sin(x(1));
- Bik(2,1)*x(2)*sin(x(1)) , -Bik(2,1)*cos(x(1))-2*Bik(2,2)*x(2)];
- x = x - inv(J)*f;
- end
- k1 = x(1,1); % this is the angle in radians
- k2 = x(2,1); % this is the voltage (V2)
- k3 = k1*(180/pi); % radians to degree
- fprintf('V =');
- disp(x(2,1)); % displays voltage
- fprintf('theta =');
- disp(k3); % Displays angle (in degrees)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement