summaryrefslogtreecommitdiff
path: root/Working_Examples/154/DEPENDENCIES/ch2_3.sce
blob: cb92e89cde96a9fbb5c889f9ae48551722557ffa (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
clc
disp("Example 2.3")
printf("\n")
printf("Given")
disp("Capacitance used is 20uF")
disp("Voltage is v=50*sin(200*t)")
C=20*10^-6;
v=50*sin(200*t);
vamp=50;
t=0:0.001:0.015;
//q=C*v
qamp=vamp*C
q=qamp*sin(200*t)
//i=C*d/dt(v)
//d/dt(sin 200t)=200*cos t
iamp=C*vamp*200;
i=iamp*cos(200*t)

//sinA*cosB=(sin(A+B)+sin(A-B))/2

pamp=vamp*iamp/2;
p=pamp*sin(400*t)

//On integrating 'p' w.r.t  t

wC=12.5*(1-cos(400*t));

figure
a= gca ();
plot(t,wC)
xtitle ('wC vs wt','wt','wC (mJ)');
a. thickness = 2;