summaryrefslogtreecommitdiff
path: root/147/CH1/EX1.3/Example1_3.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /147/CH1/EX1.3/Example1_3.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/CH1/EX1.3/Example1_3.sce')
-rw-r--r--147/CH1/EX1.3/Example1_3.sce28
1 files changed, 28 insertions, 0 deletions
diff --git a/147/CH1/EX1.3/Example1_3.sce b/147/CH1/EX1.3/Example1_3.sce
new file mode 100644
index 000000000..0502dc7ac
--- /dev/null
+++ b/147/CH1/EX1.3/Example1_3.sce
@@ -0,0 +1,28 @@
+close();
+clear;
+clc;
+//Three resistances in parallel 'R1', 'R2', 'R3', Voltage source 'V'
+R1 = 5; //ohm
+R2 = 10; //ohm
+R3 = 20; //ohm
+V = 100; //V
+
+//(a)
+//current through R1 'I1'
+I1 = V/R1; //A
+//current through R2 'I2'
+I2 = V/R2; //A
+//current through R3 'I3'
+I3 = V/R3; //A
+
+mprintf("Current through %d ohm resistor, I1 = %d A\n\n",R1,I1);
+mprintf("Current through %d ohm resistor, I2 = %d A\n\n",R2,I2);
+mprintf("Current through %d ohm resistor, I3 = %d A\n\n",R3,I3);
+
+//(b)
+//Total current drawn from source 'I'
+I = I1 + I2 + I3; //A
+//Power supplied by source 'P'
+P = V*I; //W
+
+mprintf("Current drawn from the source, I = %d A\nPower supplied by source, P = %d W",I,P); \ No newline at end of file