Clear Filters
Clear Filters

Fourier Coefficient Plots with variable n or m

1 view (last 30 days)
I'm trying to plot Dsf w.r.t n for a particular m or vice versa code is attached with this How can I get the Plot of Dsf w.r.t n ,for a fix m Also,Dsf w.r.t m,for a fix n
clc
%--------Define Constants all are in MKS-------%
q=1.602e-19;
h=8.85e-12;
Eox=3.9*h;
Esi=11.8*h;
Ni=1e16;
Na=1e16;
Vgs=0;
L=35e-9;
tox=3e-9;
tsi=10e-9;
y=tox;
Vds=1;
Q=-q*Na;
V=Vgs;
t1=0.0259;%thermal voltage in V%
Vbi=0.55;%source side potential%
d1=0;
phi2=0;
for n=1:1:500
kn=n*pi/L;
X1=((cosh(kn*(tox+tsi-y)))+(cosh(kn*(tox-y))))/(sinh(kn*tsi));
d2=L*(V*(1-(-1)^n))/((cosh(kn*tox))*pi*n);
d4=1/(kn*Esi*tanh(kn*tsi))+1/(kn*Esi*sinh(kn*tsi))+tanh(kn*tox)/(kn*Eox) ;
d3=(((Vbi*(1-(-1)^n))/kn+(Vds*(-1)^(n+1))/kn+(Q*((1-(-1)^n)))/(Esi*kn*kn*kn)));
for m=1:1:100
k1=(2*m-1)*pi/(2*tox);
A1=V/k1+(sin(k1*tox)*(Vbi-Vgs))/(k1^2);
A2=V/k1+(sin(k1*tox)*(Vbi+Vds-Vgs))/(k1^2);
d1=d1+(2*(sin(k1*(tox)))*kn*(A1+A2*((-1)^(n+1)))/(tox*(kn^2+k1^2)));
end
Dsf=((d1+d2-d3))/(kn*d4);
end
plot(n,Dsf, 'r')
d1
Dsf
end

Accepted Answer

Walter Roberson
Walter Roberson on 10 Sep 2017
%--------Define Constants all are in MKS-------%
q=1.602e-19;
h=8.85e-12;
Eox=3.9*h;
Esi=11.8*h;
Ni=1e16;
Na=1e16;
Vgs=0;
L=35e-9;
tox=3e-9;
tsi=10e-9;
y=tox;
Vds=1;
Q=-q*Na;
V=Vgs;
t1=0.0259;%thermal voltage in V%
Vbi=0.55;%source side potential%
d1=0;
phi2=0;
nvals = 1:500;
for n=nvals
kn=n*pi/L;
X1=((cosh(kn*(tox+tsi-y)))+(cosh(kn*(tox-y))))/(sinh(kn*tsi));
d2=L*(V*(1-(-1)^n))/((cosh(kn*tox))*pi*n);
d4=1/(kn*Esi*tanh(kn*tsi))+1/(kn*Esi*sinh(kn*tsi))+tanh(kn*tox)/(kn*Eox) ;
d3=(((Vbi*(1-(-1)^n))/kn+(Vds*(-1)^(n+1))/kn+(Q*((1-(-1)^n)))/(Esi*kn*kn*kn)));
for m=1:1:100
k1=(2*m-1)*pi/(2*tox);
A1=V/k1+(sin(k1*tox)*(Vbi-Vgs))/(k1^2);
A2=V/k1+(sin(k1*tox)*(Vbi+Vds-Vgs))/(k1^2);
d1=d1+(2*(sin(k1*(tox)))*kn*(A1+A2*((-1)^(n+1)))/(tox*(kn^2+k1^2)));
end
Dsf(n)=((d1+d2-d3))/(kn*d4);
end
plot(nvals,Dsf, 'r')
  3 Comments
NILESH PANDEY
NILESH PANDEY on 10 Sep 2017
I got it I used disp command in for loop to get all values If any one has another way to do the same I'd like to know
Walter Roberson
Walter Roberson on 10 Sep 2017
%--------Define Constants all are in MKS-------%
q=1.602e-19;
h=8.85e-12;
Eox=3.9*h;
Esi=11.8*h;
Ni=1e16;
Na=1e16;
Vgs=0;
L=35e-9;
tox=3e-9;
tsi=10e-9;
y=tox;
Vds=1;
Q=-q*Na;
V=Vgs;
t1=0.0259;%thermal voltage in V%
Vbi=0.55;%source side potential%
d1(1) = 0;
phi2=0;
nvals = 1:500;
for n=nvals
td1 = d1(n);
kn=n*pi/L;
X1=((cosh(kn*(tox+tsi-y)))+(cosh(kn*(tox-y))))/(sinh(kn*tsi));
td2=L*(V*(1-(-1)^n))/((cosh(kn*tox))*pi*n);
td4=1/(kn*Esi*tanh(kn*tsi))+1/(kn*Esi*sinh(kn*tsi))+tanh(kn*tox)/(kn*Eox) ;
td3=(((Vbi*(1-(-1)^n))/kn+(Vds*(-1)^(n+1))/kn+(Q*((1-(-1)^n)))/(Esi*kn*kn*kn)));
for m=1:1:100
k1=(2*m-1)*pi/(2*tox);
A1=V/k1+(sin(k1*tox)*(Vbi-Vgs))/(k1^2);
A2=V/k1+(sin(k1*tox)*(Vbi+Vds-Vgs))/(k1^2);
td1=td1+(2*(sin(k1*(tox)))*kn*(A1+A2*((-1)^(n+1)))/(tox*(kn^2+k1^2)));
end
Dsf(n)=((td1+td2-td3))/(kn*td4);
d1(n+1) = td1;
d2(n+1) = td2;
d3(n+1) = td3;
d4(n+1) = td4;
end
d1(1) = []; d2(1) = []; d3(1) = []; d4(1) = [];
subplot(1,5,1); plot(nvals, Dsf, 'r'); title('Dsf');
subplot(1,5,2); plot(nvals, d1, 'g'); title('d1');
subplot(1,5,3); plot(nvals, d2, 'b'); title('d2');
subplot(1,5,4); plot(nvals, d3, 'k'); title('d3');
subplot(1,5,5); plot(nvals, d4, 'c'); title('d4');

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!