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 /1445/CH1/EX1.6 | |
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 '1445/CH1/EX1.6')
-rw-r--r-- | 1445/CH1/EX1.6/ch1_ex_6.sce | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/1445/CH1/EX1.6/ch1_ex_6.sce b/1445/CH1/EX1.6/ch1_ex_6.sce new file mode 100644 index 000000000..db39be0af --- /dev/null +++ b/1445/CH1/EX1.6/ch1_ex_6.sce @@ -0,0 +1,27 @@ +//CHAPTER 1- D.C. CIRCUIT ANALYSIS AND NETWORK THEOREMS +//Example 6 + +disp("CHAPTER 1"); +disp("EXAMPLE 6"); + +//VARIABLE INITIALIZATION +non=4; //number of nodes +nob=6; //number of branches + +//SOLUTION +nome=nob-non+1; //number of mesh equations +disp(sprintf("Number of mesh equations are %d",nome)); +none=non-1; +disp(sprintf("Number of node equations are %d",none)); + +//(5/2)I1+(-2)I2+(-1/2)I3=4.....eq (1) +//(0)I1+(0)I2+(1)I3=-2..........eq (2) +//(-2)I1+(10/3)I2+(-1/3)I3=0....eq (3) +//using matrix method to solve the set of equations +A=[5/2 -2 -1/2;-2 10/3 -1/3;0 0 1]; +b=[4;0;-2]; +x=inv(A)*b; +I=x(1,:); //to access the 1st element of 3X1 matrix +disp(sprintf("The current from the source V is %d A",I)); + +//END |