summaryrefslogtreecommitdiff
path: root/3830/CH1/EX1.1/Ex1_1.sce
blob: e88d8175459d7c8c31fd677485e94a2279284a58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Exa 1.1

clc;
clear;

// Given

I = 10; // Current in Amp
dI = 0.1; // Probability of error in I (Amp)
R = 100; // Resistor value in Ohms
dR = 2; // Probability of error in R (Ohms)


// Solution

printf('The power dissipated P = I^2*R \n');

printf(' The probable error can be determined with the help of Erss(Root Sum Square) Formula, i.e Error = sqrt((dR*I^2)^2 + (2*I*R*dI)^2)  \n');

PE = sqrt((dR*I^2)^2 + (dI*2*I*R)^2); // Probable error
P = I^2 * R;

printf(' Error = %d W \n',round(PE));
printf(' Power dissipated P = %d kW \n',P*10^-3);