summaryrefslogtreecommitdiff
path: root/147/CH2/EX2.1/Example2_1.sce
diff options
context:
space:
mode:
Diffstat (limited to '147/CH2/EX2.1/Example2_1.sce')
-rw-r--r--147/CH2/EX2.1/Example2_1.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/147/CH2/EX2.1/Example2_1.sce b/147/CH2/EX2.1/Example2_1.sce
new file mode 100644
index 000000000..c8cd05b65
--- /dev/null
+++ b/147/CH2/EX2.1/Example2_1.sce
@@ -0,0 +1,27 @@
+close();
+clear;
+clc;
+//Three resistances 'R1', 'R2', 'R3' connected in parrallel
+R1 = 2100; //ohm
+R2 = 2100; //ohm
+R3 = 2100; //ohm
+V = 210; //V
+Req = 1/((1/R1)+(1/R2)+(1/R3));
+
+//(a)
+//total current 'I'
+I = V/Req;
+mprintf("The total current, I = %0.1f A\n\n",I);
+
+//(b)
+//current through each resistor
+I1 = V/R1;
+I2 = V/R2;
+I3 = V/R3;
+mprintf("The current through %d ohm resistor is %0.1f A\nThe current through %d ohm resistor is %0.1f A\nThe current through %d ohm resistor is %0.1f A\n\n",R1,I1,R2,I2,R3,I3);
+
+//(c)
+//total power dissipated in resistors 'P'
+P = V*I;
+mprintf("Total power dissipated in resistors, P = %d W",round(P));
+