summaryrefslogtreecommitdiff
path: root/1445/CH1/EX1.6
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1445/CH1/EX1.6
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1445/CH1/EX1.6')
-rw-r--r--1445/CH1/EX1.6/Ex1_6.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/1445/CH1/EX1.6/Ex1_6.sce b/1445/CH1/EX1.6/Ex1_6.sce
new file mode 100644
index 000000000..f5e6536c4
--- /dev/null
+++ b/1445/CH1/EX1.6/Ex1_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
+n=4; //number of nodes
+b=6; //number of branches
+
+//SOLUTION
+m=b-n+1; //number of mesh equations
+disp(sprintf("Number of mesh equations are %d",m));
+nd=n-1; //number of node equations
+disp(sprintf("Number of node equations are %d",nd));
+
+//(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 Vs is %d A",I));
+
+//END