blob: 6ea01ce445054a5c4decd35cdd080184c42e3586 (
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
25
26
27
28
29
30
31
32
33
34
35
|
//Book Name:Fundamentals of Electrical Engineering
//Author:Rajendra Prasad
//Publisher: PHI Learning Private Limited
//Edition:Third ,2014
//Ex1_1.sce.
clc;
clear;
P=200; //power rating of lamp in watts
V=110; //voltage rating of lamp in volts
//case1
printf("\n(a)")
I=(P/V);
printf("\nCurrent in the lamp=%f A",I)
//case2
printf("\n(b)")
T=1; //time in hour for electric charge flow through the lamp
t=T*60*60; //time in seconds for electric charge flow through the lamp
q=I*t;
printf("\nElectric charge flowing through the lamp for one hour=%f coloumb",q)
//case3
printf("\n(c)")
Numberofdaysinmay=31;
time=10; //on time of lamp in hour per day
unitcharge=1.20; //electricity charge in rupees (1kwhr = 1unit)
t1=time*Numberofdaysinmay; //on time of lamp in hour per month
Energyconsumed=P*t1; //consumption of energy in watt-hour
Energyconsumedinkwhr=Energyconsumed/(1e3);//consumption of energy in kilowatt-hour
charges=Energyconsumedinkwhr*unitcharge;
printf("\nCharge for electricity=%f rupees",charges)
|