summaryrefslogtreecommitdiff
path: root/147/CH2/EX2.13/Example2_13.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /147/CH2/EX2.13/Example2_13.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '147/CH2/EX2.13/Example2_13.sce')
-rw-r--r--147/CH2/EX2.13/Example2_13.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/147/CH2/EX2.13/Example2_13.sce b/147/CH2/EX2.13/Example2_13.sce
new file mode 100644
index 000000000..c5c253aba
--- /dev/null
+++ b/147/CH2/EX2.13/Example2_13.sce
@@ -0,0 +1,18 @@
+close();
+clear;
+clc;
+I1 = 10; //A
+I2 = 100; //A
+R1 = 5; //ohm
+R2 = 10; //ohm
+R3 = 20; //ohm
+R4 = 30; //ohm
+//applying KCL
+A = [(1/R1+1/R2) (-1/R2);(1/R2) (-1/R2-1/R4-1/R3)];
+C = [I1;-I2/R4];
+B = inv(A)*C;
+V1 = B(1,1);
+V2 = B(2,1);
+I1 = (V1-V2)/R2;
+I2 = (V2-I2)/R4;
+mprintf("I1 = %0.2f A\nI2 = %0.2f A",I1,I2); \ No newline at end of file