diff options
Diffstat (limited to '149/CH10')
-rwxr-xr-x | 149/CH10/EX10.1/ques1.sce | 13 | ||||
-rwxr-xr-x | 149/CH10/EX10.10/ques10.sce | 13 | ||||
-rwxr-xr-x | 149/CH10/EX10.11/ques11.sce | 12 | ||||
-rwxr-xr-x | 149/CH10/EX10.12/ques12.sce | 13 | ||||
-rwxr-xr-x | 149/CH10/EX10.13/ques13.sce | 8 | ||||
-rwxr-xr-x | 149/CH10/EX10.14/ques14.sce | 18 | ||||
-rwxr-xr-x | 149/CH10/EX10.15/ques15_16_17.sce | 19 | ||||
-rwxr-xr-x | 149/CH10/EX10.16/ques15_16_17.sce | 19 | ||||
-rwxr-xr-x | 149/CH10/EX10.17/ques15_16_17.sce | 19 | ||||
-rwxr-xr-x | 149/CH10/EX10.2/ques2.sce | 8 | ||||
-rwxr-xr-x | 149/CH10/EX10.3/ques3.sce | 13 | ||||
-rwxr-xr-x | 149/CH10/EX10.4/ques4.sce | 13 | ||||
-rwxr-xr-x | 149/CH10/EX10.5/ques5.sce | 12 | ||||
-rwxr-xr-x | 149/CH10/EX10.6/ques6.sce | 14 | ||||
-rwxr-xr-x | 149/CH10/EX10.7/ques7.sce | 13 | ||||
-rwxr-xr-x | 149/CH10/EX10.8/ques8.sce | 13 | ||||
-rwxr-xr-x | 149/CH10/EX10.9/ques9.sce | 14 |
17 files changed, 234 insertions, 0 deletions
diff --git a/149/CH10/EX10.1/ques1.sce b/149/CH10/EX10.1/ques1.sce new file mode 100755 index 000000000..383f7dde4 --- /dev/null +++ b/149/CH10/EX10.1/ques1.sce @@ -0,0 +1,13 @@ +//ques1
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=1/%pi*integ(exp(-1*x),x,0,2*%pi);
+s=ao/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=1/%pi*integ(exp(-x)*cos(i*x),x,0,2*%pi);
+ bi=1/%pi*integ(exp(-x)*sin(i*x),x,0,2*%pi);
+ s=s+float(ai)*cos(i*x)+float(bi)*sin(i*x);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.10/ques10.sce b/149/CH10/EX10.10/ques10.sce new file mode 100755 index 000000000..b6e22ae22 --- /dev/null +++ b/149/CH10/EX10.10/ques10.sce @@ -0,0 +1,13 @@ +//ques10
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=2/2*(integ(x,x,0,2));
+s=ao/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=2/2*(integ(x*cos(i*%pi*x/2),x,0,2));
+ //bi=1/%pi*(integ(-1*%pi*x^0*sin(i*x),x,-1*%pi,0)+integ(x*sin(i*x),x,0,%pi));
+ s=s+float(ai)*cos(i*%pi*x/2);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.11/ques11.sce b/149/CH10/EX10.11/ques11.sce new file mode 100755 index 000000000..cde2bd21a --- /dev/null +++ b/149/CH10/EX10.11/ques11.sce @@ -0,0 +1,12 @@ +//ques3
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=0;
+s=ao;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ bi=2/1*(integ((1/4-x)*sin(i*%pi*x),x,0,1/2)+integ((x-3/4)*sin(i*%pi*x),x,1/2,1));
+ s=s+float(bi)*sin(i*%pi*x);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.12/ques12.sce b/149/CH10/EX10.12/ques12.sce new file mode 100755 index 000000000..3fc674ef0 --- /dev/null +++ b/149/CH10/EX10.12/ques12.sce @@ -0,0 +1,13 @@ +//ques1
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=1/%pi*integ(x^2,x,-%pi,%pi);
+s=ao/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=1/%pi*integ((x^2)*cos(i*x),x,-%pi,%pi);
+ bi=1/%pi*integ((x^2)*sin(i*x),x,-%pi,%pi);
+ s=s+float(ai)*cos(i*x)+float(bi)*sin(i*x);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.13/ques13.sce b/149/CH10/EX10.13/ques13.sce new file mode 100755 index 000000000..cc34c6029 --- /dev/null +++ b/149/CH10/EX10.13/ques13.sce @@ -0,0 +1,8 @@ +//ques13
+clc
+disp('The complex form of series is summation of f(n,x) where n varies from -%inf to %inf and f(n,x) is given by :');
+syms n x
+cn=1/2*integ(exp(-x)*exp(-%i*%pi*n*x),x,-1,1);
+fnx=float(cn)*exp(%i*n*%pi*x);
+
+disp(float(fnx));
diff --git a/149/CH10/EX10.14/ques14.sce b/149/CH10/EX10.14/ques14.sce new file mode 100755 index 000000000..b47a044de --- /dev/null +++ b/149/CH10/EX10.14/ques14.sce @@ -0,0 +1,18 @@ +//ques15
+//yo=[1.80 1.10 0.30 0.16 1.50 1.30 2.16 1.25 1.30 1.52 1.76 2.00]
+//x0=[0 %pi/6 %pi/3 %pi/2 2*%pi/3 5*%pi/6 %pi 7*%pi/6 4*%pi/3 3*%pi/2 5*%pi/3 11*%pi/6]
+disp('Practical harmonic analysis');
+syms x
+xo=input('Input xo matrix : ');
+yo=input('Input yo matrix : ');
+ao=2*sum(yo)/length(xo);
+s=ao/2;
+n=input('No of sin or cos term in expansion : ');
+for i=1:n
+ an=2*sum(yo.*cos(i*xo))/length(yo);
+ bn=2*sum(yo.*sin(i*xo))/length(yo);
+ s=s+float(an)*cos(i*x)+float(bn)*sin(i*x);
+
+ end
+ disp(s);
+
diff --git a/149/CH10/EX10.15/ques15_16_17.sce b/149/CH10/EX10.15/ques15_16_17.sce new file mode 100755 index 000000000..315e16813 --- /dev/null +++ b/149/CH10/EX10.15/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);
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);
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);
diff --git a/149/CH10/EX10.2/ques2.sce b/149/CH10/EX10.2/ques2.sce new file mode 100755 index 000000000..5462cacc3 --- /dev/null +++ b/149/CH10/EX10.2/ques2.sce @@ -0,0 +1,8 @@ +//error
+//ques2
+disp('To find the fourier transform of given function ');
+syms x s
+F=integ(exp(%i*s*x),x,-1,1);
+disp(F);
+//produces error->
+F1=integ(sin(x)/x,x,0,%inf);
diff --git a/149/CH10/EX10.3/ques3.sce b/149/CH10/EX10.3/ques3.sce new file mode 100755 index 000000000..5c9878df5 --- /dev/null +++ b/149/CH10/EX10.3/ques3.sce @@ -0,0 +1,13 @@ +//ques3
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=1/%pi*(integ(-1*%pi*x^0,x,-%pi,0)+integ(x,x,0,%pi));
+s=ao/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=1/%pi*(integ(-1*%pi*cos(i*x),x,-1*%pi,0)+integ(x*cos(i*x),x,0,%pi));
+ bi=1/%pi*(integ(-1*%pi*x^0*sin(i*x),x,-1*%pi,0)+integ(x*sin(i*x),x,0,%pi));
+ s=s+float(ai)*cos(i*x)+float(bi)*sin(i*x);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.4/ques4.sce b/149/CH10/EX10.4/ques4.sce new file mode 100755 index 000000000..ca427a584 --- /dev/null +++ b/149/CH10/EX10.4/ques4.sce @@ -0,0 +1,13 @@ +//ques4
+clc
+disp('finding the fourier series of given function');
+syms x l
+ao=1/l*integ(exp(-1*x),x,-l,l);
+s=ao/2
+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=1/l*integ(exp(-x)*sin(i*%pi*x/l),x,-l,l);
+ s=s+float(ai)*cos(i*%pi*x/l)+float(bi)*sin(i*%pi*x/l);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.5/ques5.sce b/149/CH10/EX10.5/ques5.sce new file mode 100755 index 000000000..307c0987b --- /dev/null +++ b/149/CH10/EX10.5/ques5.sce @@ -0,0 +1,12 @@ +//ques5
+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 terms in the expansion : ');
+for i=1:n
+
+ bi=2/%pi*integ(x*sin(i*x),x,0,%pi);
+ s=s+float(bi)*sin(i*x);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.6/ques6.sce b/149/CH10/EX10.6/ques6.sce new file mode 100755 index 000000000..175e87102 --- /dev/null +++ b/149/CH10/EX10.6/ques6.sce @@ -0,0 +1,14 @@ +//error no output
+//ques6
+clc
+disp('finding the fourier series of given function');
+syms x l
+ao=2/l*integ(x^2,x,0,l);
+s=float(ao)/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=2/l*integ(x^2*cos(i*%pi*x/l),x,0,l);
+ //bi=1/l*integ(exp(-x)*sin(i*x),x,-l,l);
+ s=s+float(ai)*cos(i*%pi*x/l);
+ end
+disp(float(s));
diff --git a/149/CH10/EX10.7/ques7.sce b/149/CH10/EX10.7/ques7.sce new file mode 100755 index 000000000..13e9b311d --- /dev/null +++ b/149/CH10/EX10.7/ques7.sce @@ -0,0 +1,13 @@ +//ques1
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=2/%pi*(integ(cos(x),x,0,%pi/2)+integ(-cos(x),x,%pi/2,%pi));
+s=ao/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=2/%pi*(integ(cos(x)*cos(i*x),x,0,%pi/2)+integ(-cos(x)*cos(i*x),x,%pi/2,%pi));
+ //bi=1/%pi*(integ(-1*%pi*x^0*sin(i*x),x,-1*%pi,0)+integ(x*sin(i*x),x,0,%pi));
+ s=s+float(ai)*cos(i*x);
+end
+disp(float(s));
diff --git a/149/CH10/EX10.8/ques8.sce b/149/CH10/EX10.8/ques8.sce new file mode 100755 index 000000000..f33ed7916 --- /dev/null +++ b/149/CH10/EX10.8/ques8.sce @@ -0,0 +1,13 @@ +//ques8
+clc
+disp('finding the fourier series of given function');
+syms x
+ao=2/%pi*(integ((1-2*x/%pi),x,0,%pi));
+s=ao/2;
+n=input('enter the no of terms upto each of sin or cos terms in the expansion : ');
+for i=1:n
+ ai=2/%pi*(integ((1-2*x/%pi)*cos(i*x),x,0,%pi));
+ //bi=1/%pi*(integ(-1*%pi*x^0*sin(i*x),x,-1*%pi,0)+integ(x*sin(i*x),x,0,%pi));
+ s=s+float(ai)*cos(i*x);
+end
+disp(float(s));
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));
+
|