From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 149/CH10/EX10.17/ques15_16_17.sce | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 149/CH10/EX10.17/ques15_16_17.sce (limited to '149/CH10/EX10.17') diff --git a/149/CH10/EX10.17/ques15_16_17.sce b/149/CH10/EX10.17/ques15_16_17.sce new file mode 100755 index 000000000..315e16813 --- /dev/null +++ b/149/CH10/EX10.17/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); -- cgit