summaryrefslogtreecommitdiff
path: root/147/CH1/EX1.22/Example1_22.sce
blob: 47adb0e1f6494010ef361111247f0cb65a370eb1 (plain)
1
2
3
4
5
6
7
8
9
10
11
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);