blob: 26c869c9b137b7bdbf86a890b05637af58192d3e (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
-->lines(0)
-->disp("Example 2.1")
Example 2.1
-->printf("\n")
-->printf("Given")
Given
-->disp("Resistance used is 4 ohm")
Resistance used is 4 ohm
-->disp("Current flow is i=2.5*sin(w*t)")
Current flow is i=2.5*sin(w*t)
-->disp("Angular frequency(w)=500 rad/s")
Angular frequency(w)=500 rad/s
-->R=4;
-->iamp=2.5;w=500;
-->t=0:0.001:0.012566
t =
0. 0.001 0.002 0.003 0.004 0.005 0.006 0.007 0.008 0.009 0.01 0.011 0.012
-->i=2.5*sin(w*t)
i =
0. 1.1985638 2.1036775 2.4937375 2.2732436 1.4961804 0.3528000 - 0.8769581 - 1.8920062 - 2.4438253 - 2.3973107 - 1.7638508 - 0.6985387
-->Vamp=iamp*R;
-->printf("v=%d*sin(%d*t)(V)\n",Vamp,w)
v=10*sin(500*t)(V)
-->pamp=iamp*iamp*R;
-->printf("p=%d(sin(%d*t))^2(W)\n",pamp,w)
p=25(sin(500*t))^2(W)
-->p=pamp*sin(w*t)^2;
-->//On integrating p with respect to t
-->W=25*(t/2-sin(2*w*t)/(4*w))
W =
0. 0.0019816 0.0136338 0.035736 0.0594600 0.0744866 0.0784927 0.0792877 0.0876330 0.1073485 0.1318003 0.1499999 0.1567072
-->funcion p=f(t),p=pamp*sin(w*t)^2,endfunction
funcion p=f(t),p=pamp*sin(w*t)^2,endfunction
!--error 4
Undefined variable: funcion
at line 26 of exec file called by :
exec('/home/cheese/cloud/soc/static/tmp/mLnhjbU1jr3BCrLv8tMJai6ElivgI1dJ.sci')
|