summaryrefslogtreecommitdiff
path: root/1319/CH12/EX12.23
diff options
context:
space:
mode:
Diffstat (limited to '1319/CH12/EX12.23')
-rw-r--r--1319/CH12/EX12.23/i_23.sce35
1 files changed, 35 insertions, 0 deletions
diff --git a/1319/CH12/EX12.23/i_23.sce b/1319/CH12/EX12.23/i_23.sce
new file mode 100644
index 000000000..c4c99e838
--- /dev/null
+++ b/1319/CH12/EX12.23/i_23.sce
@@ -0,0 +1,35 @@
+// Determine the current in the branches of the network using nodal analysis
+
+clc;
+clear;
+
+// Supply voltages
+V1=30;
+V2=40;
+
+// Resistances in the network
+R1=4;
+R2=2;
+R3=4;
+
+Vb=poly([0 1],'Vb','c');
+
+AD=(V1-Vb)/R1;
+BD=(V2-Vb)/R3;
+CD=Vb/R2;
+
+X=AD+BD-CD;
+
+disp('The Characterictic Equation to find Vb is')
+
+disp(CD,'=',AD,' +',BD)
+
+Vb=roots(X);// Stores the numerical value of Vb
+
+i1=(V1-Vb)/R1;
+i2=(V2-Vb)/R3;
+i3=Vb/R2;
+
+disp('amperes',i1,'Current through 4 ohm resistor on the 30V supply side =')
+disp('amperes',i2,'Current through 4 ohm resistor on the 40V supply side =')
+disp('amperes',i3,'Current through 2 ohm resistor =')