summaryrefslogtreecommitdiff
path: root/147/CH1/EX1.22/Example1_22.sce
diff options
context:
space:
mode:
Diffstat (limited to '147/CH1/EX1.22/Example1_22.sce')
-rw-r--r--147/CH1/EX1.22/Example1_22.sce12
1 files changed, 12 insertions, 0 deletions
diff --git a/147/CH1/EX1.22/Example1_22.sce b/147/CH1/EX1.22/Example1_22.sce
new file mode 100644
index 000000000..47adb0e1f
--- /dev/null
+++ b/147/CH1/EX1.22/Example1_22.sce
@@ -0,0 +1,12 @@
+//Resistance R, Current I
+close();
+clear;
+clc;
+R1 = 15;//ohm
+R2 = 25;//ohm
+I = 5;//A
+I1 = R2/(R1+R2)*I;
+I2 = R1/(R1+R2)*I;
+P1 = I1^2*R1;
+P2 = I2^2*R2;
+mprintf('Power consumed by Resistance R1, P1 = %0.1f W \nPower consumed by Resistance R2, P2 = %0.1f W',P1,P2); \ No newline at end of file