diff options
Diffstat (limited to '149/CH10/EX10.9/ques9.sce')
-rwxr-xr-x | 149/CH10/EX10.9/ques9.sce | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/149/CH10/EX10.9/ques9.sce b/149/CH10/EX10.9/ques9.sce new file mode 100755 index 000000000..9f8369333 --- /dev/null +++ b/149/CH10/EX10.9/ques9.sce @@ -0,0 +1,14 @@ +//ques9
+clc
+disp('finding the fourier series of given function');
+syms x l
+
+s=0;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+// ai=1/l*integ(exp(-x)*cos(i*%pi*x/l),x,-l,l);
+ bi=integ(x*sin(i*%pi*x/2),x,0,2);
+ s=s+float(bi)*sin(i*%pi*x/2);
+end
+disp(float(s));
+
|