summaryrefslogtreecommitdiff
path: root/147/CH2/EX2.14/Example2_14.sce
diff options
context:
space:
mode:
Diffstat (limited to '147/CH2/EX2.14/Example2_14.sce')
-rw-r--r--147/CH2/EX2.14/Example2_14.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/147/CH2/EX2.14/Example2_14.sce b/147/CH2/EX2.14/Example2_14.sce
new file mode 100644
index 000000000..fa565240b
--- /dev/null
+++ b/147/CH2/EX2.14/Example2_14.sce
@@ -0,0 +1,26 @@
+//Resistance R, Current source , Voltage source V1
+close();
+clear;
+clc;
+R1 = 30;//ohm
+R2 = 20;//ohm
+R3 = 10;//ohm
+R4 = 5;//ohm
+I = 10;//A
+V = 100;//V
+//From previous question
+I1 = 0.37;//A
+I2 = -1.85;//A
+//Current through R4 'I3'
+I3 = I - I1;
+V1 = I3*R4;
+V2 = V+I2*R1;
+//Power from Current source 'P1'
+P1 = I*V1;
+//Power from voltage source 'P2'
+P2 = V*(-I2);
+//Total Power 'P'
+P = P1+P2;
+//Power dissipated in resistances 'Pr'
+Pr = V1^2/R4+I1^2*R3 + V2^2/R2 + I2^2*R1;
+mprintf('Sum of power from the sources P = %0.2f W\nPower dissipated by resistances P = %0.2f W \nHence Sum of the powers from the two sources is the total power dissipated in all the resistances.',P,Pr); \ No newline at end of file