summaryrefslogtreecommitdiff
path: root/1523/CH3/EX3.12/3_12.sce
diff options
context:
space:
mode:
Diffstat (limited to '1523/CH3/EX3.12/3_12.sce')
-rwxr-xr-x1523/CH3/EX3.12/3_12.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/1523/CH3/EX3.12/3_12.sce b/1523/CH3/EX3.12/3_12.sce
new file mode 100755
index 000000000..49b99eac4
--- /dev/null
+++ b/1523/CH3/EX3.12/3_12.sce
@@ -0,0 +1,26 @@
+//Network Theorem 2
+//pg no 3.13
+//example 3.12
+//when 18 V source is acting alone
+disp("Vx+I1=0");//equation 1
+disp("Applying KVL to mesh,");
+disp("3Vx-6I1=-18");//equation 2
+A=[1 1;3 -6];//solving equation in matrix form
+B=[0 -18]'
+X=inv(A)*B;
+disp(X);
+disp("I1 = 2 A");
+//when the 3 A source is acting alone
+disp("from the figure,");
+disp("Vx=2 V");//equation 1
+disp("Applying KCL at node 1,");
+disp("3Vx-6I2=0");//equation 2
+A=[1 0;3 -6];//solving equation in matrix form
+B=[2 0]'
+X=inv(A)*B;
+disp(X);
+disp("I2 =1 V");
+a=2;
+b=1;
+x=a+b;
+mprintf("\nBy superposition theorem, \n I = I1+I2 = %.f A ",x);