diff options
Diffstat (limited to '3872/CH6/EX6.2/Ex6_2.sce')
-rw-r--r-- | 3872/CH6/EX6.2/Ex6_2.sce | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/3872/CH6/EX6.2/Ex6_2.sce b/3872/CH6/EX6.2/Ex6_2.sce new file mode 100644 index 000000000..b5d9f5dda --- /dev/null +++ b/3872/CH6/EX6.2/Ex6_2.sce @@ -0,0 +1,26 @@ +//Book - Power System: Analysis & Design 5th Edition
+//Authors - J. Duncan Glover, Mulukutla S. Sarma, and Thomas J. Overbye
+//Chapter - 6 ; Example 6.2
+//Scilab Version - 6.0.0 ; OS - Windows
+
+clc;
+clear;
+
+A=[2 3 -1;-4 6 8;10 12 14];
+y=[5;7;9];
+N=length(y); //Number of variables
+st=N-1; //Number of Gauss elimination steps
+
+//Gauss Elimination step:
+B=A;
+for i=1:st
+ for j=i+1:N
+ m=(B(j,i)/B(i,i));
+ A(j,i+1:N)=A(j,i+1:N)-m*(A(i,i+1:N));
+ A(i+1:N,i)=0;
+ y(j)=y(j)-m*y(i);
+ end
+ B=A;
+end
+disp(A,'The triangularized matrix using gauss elemination is:')
+disp(y,'and the corresponding y matrix is:')
|