Sample Lab Report PSA 3
Sample Lab Report PSA 3
2. Theoretical Background
2.1. Gauss Seidel Method
The Gauss-Seidel method is an iterative numerical technique used to solve a system of
linear equations. It updates the solution by using the most recent values, allowing for faster
convergence compared to methods like Jacobi. This technique is particularly effective for
diagonally dominant or symmetric positive definite matrices, ensuring reliable results.
Page 1 of 4
Power System Analysis Lab
Update each variable xi iteratively using the formula until the solution converges.
Convergence is determined by checking whether the change in the solution is below a given
tolerance:
where ϵ is the specified tolerance, and ∥⋅∥ represents a suitable norm (e.g., Euclidean or
maximum norm).
3. Activity 1:Code Gauss Seidel Method for single variable and test an
equation
F(x)=x^3-6x^2+9x-4
3.1. MATLAB Code
clc
clear all
close all
x(1)=2;
errorrate=1;y=1;
while errorrate>0.001
x_new=(-1/9*x(y)^3+(6/9)*x(y)^2+4/9);
errorrate=abs(x_new-x(y));
disp(['root of iteration',num2str(y),'=',num2str(x_new)]);
y=y+1;x(y)=x_new;
end
disp(['root of equation is ',num2str(x(y))])
3.2. Results/Output
The output of the code is given by
Page 2 of 4
Power System Analysis Lab
4. Activity 2:Code Gauss Seidel Method for two variables and test on
system.
x1+x1x2=10
x1+x2=6
4.2. Results/Output
Page 3 of 4
Power System Analysis Lab
4.4. Results/Output
6. Lesson Learnt
Learned the fundamental principles of the Gauss-Seidel method, including its iterative nature
and convergence criteria for solving linear systems.Gained hands-on experience in
implementing the Gauss-Seidel algorithm in MATLAB.developed an understanding of the
importance of initial guesses, error tolerance on convergence.
Page 4 of 4