will you please tell me why am i not getting the graph?

1 次查看(过去 30 天)
if true
hfin=1;
tsi=20
W=2*hfin*tsi;
Vth=1;
Leff=180;
DIBL=1.127*(W\Leff);
vth=Vth-DIBL;
lambda=25*10^-5;
un=100;
Cox=1;
ld=0.1;
Ec=1;
vgs=2;
for vds=1:4;
Ids(vds)=(2*W*un*Cox/Leff-ld+(vds/Ec))+(lambda*2*W*Cox/(Leff-ld)^2)*((vgs-Vth)*vds-0.5*vds^2);
end
plot(Ids,vds)
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
end
  2 个评论
ES
ES 2014-1-6
and the reason why your code does not give a plot is because you have used vds in the loop variable. when the loop exits, vds is = 4. so the plot is essentially (Ids,4) which is not something you want. You want plot of (Ids, 1:4).
make it this way,
if true
hfin=1;
tsi=20
W=2*hfin*tsi;
Vth=1;
Leff=180;
DIBL=1.127*(W\Leff);
vth=Vth-DIBL;
lambda=25*10^-5;
un=100;
Cox=1;
ld=0.1;
Ec=1;
vgs=2;
for vds=1:4;
Ids(vds)=(2*W*un*Cox/Leff-ld+(vds/Ec))+(lambda*2*W*Cox/(Leff-ld)^2)*((vgs-Vth)*vds-0.5*vds^2);
end
vds=1:4;%New line for making vds=[1,2,3,4] instead of vds=4;
plot(Ids,vds)
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
end
ARTI
ARTI 2014-1-6
The graph obtained by running the above program is a straight line which is not the actual one. it must me same as that of Ids vs Vds characteristics of n mosfet or p mosfet

请先登录,再进行评论。

回答(2 个)

ES
ES 2014-1-6
TRY THIS:
%n-channel enhancement mode MOSFET output characteristics
clear all;
%kn=un*cox = 100 microA/Volts
kn=1e-4;
%Let W/L= 2
W=360*(10^(-9));
L=180*(10^(-9));
beta=kn*W/L;
%Vth is the threshold voltage
Vth=1;
%lambda is the inverse of early voltage in voltage inverse
lambda=1/1000;
%Sweep drain to source voltge from 0 to 10V
vds=0:0.5:10;
%Ask the user to enter gate to source voltage
vgs=input('ENTER THE Vgs in volts');
%Estimate length of the array
m=length(vds);
for i=1:m
if vgs < Vth
current(1,i)=0;
current1(1,i)=0;
elseif vds(i) >= (vgs - Vth)
current(1,i)=0.5* beta * ((vgs - Vth)^2)*(1+lambda*vds(i));
current1(1,i)=0.5* beta * ((vgs - Vth)^2);
elseif vds(i) < (vgs - Vth)
current(1,i)= beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2))*(1+lambda*vds(i));
current1(1,i)=beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2));
end
end
plot(vds,current(1,:),'b',vds,current1(1,:),'r')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
or THIS
%n-channel enhancement mode MOSFET output characteristics
clear all;
%kn=un*cox = 100 microA/Volts
kn=1e-4;
%Let W/L= 2
W=360*(10^(-9));
L=180*(10^(-9));
beta=kn*W/L;
%Vth is the threshold voltage
Vth=1;
%Sweep drain to source voltge from 0 to 10V
vds=0:0.5:10;
%Ask the user to enter gate to source voltage
vgs=input('ENTER THE Vgs in volts');
%Estimate length of the array
m=length(vds);
for i=1:m
if vgs < Vth
current(1,i)=0;
elseif vds(i) >= (vgs - Vth)
current(1,i)=0.5* beta * (vgs - Vth)^2;
elseif vds(i) < (vgs - Vth)
current(1,i)= beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2));
end
end
plot(vds,current(1,:),'b')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')
  3 个评论
ES
ES 2014-1-6
I have modified your code at the top too.. Please have a look at it.. It is a small change anyway..
ARTI
ARTI 2014-1-6
The graph obtained by running the above program is a straight line which is not the actual one. it must me same as that of Ids vs Vds characteristics of n mosfet or p mosfet

请先登录,再进行评论。


kajal sharma
kajal sharma 2022-3-5
this program is not run it showing the error in enter the vgs value

类别

Help CenterFile Exchange 中查找有关 Semiconductors and Converters 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by