{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# Part1 - for i = 1:10 A = 3*x(i)^2-4*x(i-6 delta =...

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

clear c % Mismatch calculations for 5 bus system % Example 7.9 bus system data ex7_9; % Calculate the initial mismatches V = V.*(cos(delta)+j*sin(delta)); S=V.*conj(Ybus*V); % Power injections deltaP = P - real(S) % Ingore errors at slace bus (1) deltaQ = Q - imag(S) % Ingore errors at gen buses (1 and 3) d %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Numerical iteration problem disp('Gauss-Seidel iteration on polynomial, first guess x=3') % Part a: Gauss-Seidel with first guess x=3 x(1) = 3; A = -5; for i=1:10 delta = x(i)^3 -2*x(i)^2 - 6*x(i) + 3; x(i+1) = x(i) - (1/A)*delta; end; root = x(i) r %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Part b: Newton-Raphson with first guess x=3 x(1) = 3; disp('Newton-Raphson iteration on polynomial, first guess x=3')
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: for i = 1:10 A = 3*x(i)^2-4*x(i)-6; delta = x(i)^3 -2*x(i)^2 - 6*x(i) + 3; x(i+1) = x(i) - (1/A)*delta; end; root = x(i) r %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Part c: Gauss-Seidel with first guess x=-1 x(1) = -1; A = -5; disp('Gauss-Seidel iteration on polynomial, first guess x=-1') for i=1:10 delta = x(i)^3 -2*x(i)^2 - 6*x(i) + 3; x(i+1) = x(i) - (1/A)*delta; end; root = x(i) r %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Part d: Newton-Raphson with first guess x=-1 x(1) = -1; disp('Newton-Raphson iteration on polynomial, first guess x=-1') for i = 1:10 A = 3*x(i)^2-4*x(i)-6; delta = x(i)^3 -2*x(i)^2 - 6*x(i) + 3; x(i+1) = x(i) - (1/A)*delta; end; root = x(i) r...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online