diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3872/CH6/EX6.1 | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3872/CH6/EX6.1')
-rw-r--r-- | 3872/CH6/EX6.1/Ex6_1.jpg | bin | 0 -> 28319 bytes | |||
-rw-r--r-- | 3872/CH6/EX6.1/Ex6_1.sce | 32 |
2 files changed, 32 insertions, 0 deletions
diff --git a/3872/CH6/EX6.1/Ex6_1.jpg b/3872/CH6/EX6.1/Ex6_1.jpg Binary files differnew file mode 100644 index 000000000..d44900eee --- /dev/null +++ b/3872/CH6/EX6.1/Ex6_1.jpg diff --git a/3872/CH6/EX6.1/Ex6_1.sce b/3872/CH6/EX6.1/Ex6_1.sce new file mode 100644 index 000000000..644100431 --- /dev/null +++ b/3872/CH6/EX6.1/Ex6_1.sce @@ -0,0 +1,32 @@ +//Book - Power System: Analysis & Design 5th Edition
+//Authors - J. Duncan Glover, Mulukutla S. Sarma, and Thomas J. Overbye
+//Chapter - 6 ; Example 6.1
+//Scilab Version - 6.0.0 ; OS - Windows
+
+clc;
+clear;
+
+A=[10 5;2 9];
+y=[6;3];
+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
+
+//Back Substitution step
+x2=y(2)/A(2,2)
+x1=(y(1)-A(1,2)*x2)/A(1,1);
+disp(A,'The triangularized matrix using gauss elemination is:')
+disp(y,'and the corresponding y matrix is:')
+printf('The solution using back substitution is x1=%.4f and x2=%.4f',x1,x2)
+
|