diff options
Diffstat (limited to '149/CH10/EX10.16/ques15_16_17.sce')
-rwxr-xr-x | 149/CH10/EX10.16/ques15_16_17.sce | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/149/CH10/EX10.16/ques15_16_17.sce b/149/CH10/EX10.16/ques15_16_17.sce new file mode 100755 index 000000000..315e16813 --- /dev/null +++ b/149/CH10/EX10.16/ques15_16_17.sce @@ -0,0 +1,19 @@ +//error
+//ques15,16,17
+//yo=[1.98 1.30 1.05 1.30 -0.88 -.25 1.98]
+//x0=[0 1/6 1/3 1/2 2/3 5/6 1]
+disp('Practical harmonic analysis');
+syms x T
+xo=input('Input xo matrix (in factor of T) : ');
+yo=input('Input yo matrix : ');
+ao=2*sum(yo)/length(xo);
+s=ao/2;
+n=input('No of sin or cos term in expansion : ');
+ i=1
+ an=2*(yo.*cos(i*xo*2*%pi))/length(yo);
+ bn=2*(yo.*sin(i*xo*2*%pi))/length(yo);
+ s=s+float(an)*cos(i*x*2*%pi/T)+float(bn)*sin(i*x*2*%pi/T);
+
+ disp(s);
+ disp('Direct current :');
+ i=sqrt(an^2+bn^2);
|