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

1 visualización (últimos 30 días)
ARTI
ARTI el 6 de En. de 2014
Respondida: kajal sharma el 5 de Mzo. de 2022
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 comentarios
ES
ES el 6 de En. de 2014
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 el 6 de En. de 2014
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

Iniciar sesión para comentar.

Respuestas (2)

ES
ES el 6 de En. de 2014
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 comentarios
ES
ES el 6 de En. de 2014
I have modified your code at the top too.. Please have a look at it.. It is a small change anyway..
ARTI
ARTI el 6 de En. de 2014
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

Iniciar sesión para comentar.


kajal sharma
kajal sharma el 5 de Mzo. de 2022
this program is not run it showing the error in enter the vgs value

Categorías

Más información sobre Semiconductors and Converters en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by